tests for #2245
This commit is contained in:
parent
461c3dab18
commit
87e69a20c3
2 changed files with 26 additions and 0 deletions
18
tests/data/json/feature_collection_level_properties.json
Normal file
18
tests/data/json/feature_collection_level_properties.json
Normal 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 ]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -66,6 +66,14 @@ if 'geojson' in mapnik.DatasourceCache.plugin_names():
|
|||
# query.add_property_name('bogus')
|
||||
# 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__":
|
||||
setup()
|
||||
run_all(eval(x) for x in dir() if x.startswith("test_"))
|
||||
|
|
Loading…
Reference in a new issue