aspectumapp / osm2geojson

Convert OSM and Overpass XML/JSON to GeoJSON
MIT License
100 stars 14 forks source link

Failed to convert MultiPolygon relation 'with more than one hole' to shape depending on shapely version #44

Open phersu42 opened 6 months ago

phersu42 commented 6 months ago

Hello,

At first: thank you, your library is very useful!

Second: As mentioned in the title, my problem is that the conversion of MultiPolygons with more than one hole fails. I tried version 0.2.3, 0.2.4, 0.1.33 and 0.2.0. It seems that the problem depends on the shapely version, because it worked with osm2geojson v0.2.0 and shapely v2.0.3 but not with osm2geojson v0.2.4 and shapely v2.0.3 (I didn't try more combinations but maybe there are more) The problem might be related to #39.

The query I used: [out:json][timeout:1000];area["ISO3166-2"="SE-W"];(nwr['natural'='water'](area););out geom;

(My output was very long but similar to the output in #39 )

Do you have any recommendations how to use your library (e.g. combination of versions)? To chose the right version works for me but it feels a bit strange that it does not work "out of the box". Maybe I have overlooked something

rapkin commented 6 months ago

https://github.com/aspectumapp/osm2geojson/issues/35 it could be another example of the same issue. Unfortunately, current algorithm could fail on some relations. The problem is if we will change that algorithm to support these relations - other places could break.

PS. It requires deep research of every example and how to find perfect algorithm which could satisfy all of them. And right now I don't have much time to do that.