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

Accept FeatureCollection in geojson extract polygon #72

Closed
nextstopsun opened this issue Aug 30, 2017 · 4 comments
Closed

Accept FeatureCollection in geojson extract polygon #72

nextstopsun opened this issue Aug 30, 2017 · 4 comments
Labels
enhancement Wishlist item. fixed Issue was fixed.

Comments

@nextstopsun
Copy link

Though this may not be the right thing to do, the fact is most geojson generating libraries (i.e. GDAL OGR) do generate "type": "FeatureCollection" root element, even if there is only one polygon or multipolygon in features array.
Could be great if osmium extract accepts this geojson format, so there won't be any effort to reformat geojson (extract the feature element) to fit the expected osmium format.
It could simply use the first object in features array ignoring all the others, if there are more than one feature.
@joto What do you think of it?

@joto joto added enhancement Wishlist item. fixed Issue was fixed. labels Aug 31, 2017
joto added a commit that referenced this issue Aug 31, 2017
Instead of a Feature a FeatureCollection is also allowed. Only the
first feature of this collection is used.

See #72.
@joto
Copy link
Member

joto commented Aug 31, 2017

This should work now. Please test.

@nextstopsun
Copy link
Author

@joto Thanks a lot!! I'll test this and write back.

@bkowshik
Copy link

It could simply use the first object in features array ignoring all the others, if there are more than one feature.

I have just started using osmium-tool in my projects. Curious to understand why we don't want to do all features (more than 1 feature) in a FeatureCollection?

@joto
Copy link
Member

joto commented Sep 24, 2017

@bkowshik Because to use all features we'd have to merge them somehow first. That's a potentially complex geometry operation with possibly overlapping polygons. This is outside the scope of Osmium.

@joto joto closed this as completed Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Wishlist item. fixed Issue was fixed.
Development

No branches or pull requests

3 participants