Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GeoJSON: fix handling empty feature collections #4035

Open
artemp opened this issue Mar 12, 2019 · 1 comment · May be fixed by #4040
Open

GeoJSON: fix handling empty feature collections #4035

artemp opened this issue Mar 12, 2019 · 1 comment · May be fixed by #4040
Assignees

Comments

@artemp
Copy link
Member

artemp commented Mar 12, 2019

{"type":"FeatureCollection","features":[]}

Valid (empty FeatureCollection) GeoJSON above ^ currently results in an exception thrown while parsing.

/opt/mapnik/bin/mapnik-index /tmp/empty.geojson 
max tree depth:8
split ratio:0.55
processing '/tmp/empty.geojson' as GeoJSON
Invalid extent box2d(INVALID)

^ the 'Invalid extentreported is not very helpful here. Better option is to reportno features to indexor similar for an emptyFeatureCollection`

@artemp
Copy link
Member Author

artemp commented Mar 12, 2019

@four43 Some more background.
Current behaviour to throw on empty FeatureCollection is expected:
https://github.com/mapnik/mapnik/blob/master/test/unit/datasource/geojson.cpp#L103-L113
but I think this is an oversight. The fix can be straight forward but I need to ponder and test it doesn't break other things. Cheers.

@artemp artemp linked a pull request Sep 24, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant