// create using simple feature. useful to read from Shapefile, other generic geospatial data source public void CreateUsingAnonymousConstructor() { var feature1 = new Feature { Geometry = new Point(0, 0, 0), Attributes = { { "Name", "Amsterdam" }, { "Population", 1500000 } } }; var feature2 = new Feature { Geometry = new Point(1, 1, 1), Attributes = { { "Name", "The Hague" }, { "Population", 900000 } } }; var dataSource = new MemoryFeatureDataSource { Features = new [] { feature1, feature2 }.AsQueryable() }; dataSource.FeatureAttributes.Count .Should("query attributes, automatically reconstructed from added features").Be.EqualTo(2); }
public void CreateUsingFeatureClass() { var city1 = new City { Geometry = new Point(0, 0, 0), Name = "Amsterdam", Population = 1500000 }; var city2 = new City { Geometry = new Point(1, 1, 1), Name = "The Hague", Population = 9000000 }; var cities = new [] { city1, city2 }; var dataSource = new MemoryFeatureDataSource { Features = cities.AsQueryable() }; dataSource.FeatureAttributes.Count .Should("query attributes, automatically reconstructed from added features").Be.EqualTo(2); }