This commit is contained in:
Dane Springmeyer 2014-05-16 12:21:36 -07:00
parent 461c3dab18
commit 87e69a20c3
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,18 @@
{
"type": "FeatureCollection",
"properties": {
"fc_name": "fc_value"
},
"features": [
{
"type": "Feature",
"properties": {
"feat_name": "feat_value"
},
"geometry": {
"type": "Point",
"coordinates": [ -122, 48 ]
}
}
]
}

View file

@ -66,6 +66,14 @@ if 'geojson' in mapnik.DatasourceCache.plugin_names():
# query.add_property_name('bogus') # query.add_property_name('bogus')
# fs = ds.features(query) # fs = ds.features(query)
def test_parsing_feature_collection_with_top_level_properties():
ds = mapnik.Datasource(type='geojson',file='../data/json/feature_collection_level_properties.json')
f = ds.all_features()[0]
desc = ds.describe()
eq_(desc['geometry_type'],mapnik.DataGeometryType.Point)
eq_(f['feat_name'], u'feat_value')
if __name__ == "__main__": if __name__ == "__main__":
setup() setup()
run_all(eval(x) for x in dir() if x.startswith("test_")) run_all(eval(x) for x in dir() if x.startswith("test_"))