omniscale / imposm3

Imposm imports OpenStreetMap data into PostGIS
http://imposm.org/docs/imposm3/latest/
Apache License 2.0
725 stars 159 forks source link

MultiPolygon builder only uses members with inner or outer role. #74

Closed bdon closed 8 years ago

bdon commented 8 years ago

MultiPolygon builder should only use inner/outer members as ring parts

In the case of a building relation such as http://www.openstreetmap.org/relation/2853424#map=19/40.71317/-74.00356 composed of multiple parts, it seems like Imposm3 is interpreting the building parts that lie within the footprint as holes, when instead they should not be part of the outer multipolygon.

This change seemed to work for me - appreciate any suggestions on what other changes may need to be made

olt commented 8 years ago

A lot of multipolygon relations have members with with empty roles. E.g. http://www.openstreetmap.org/relation/2098969 Your example uses role=part. Maybe a check for inner, outer and empty would provide better results? Not sure if this will work for all other multipolygon/boundary relations.

bdon commented 8 years ago

Yeah, the current PR will use the check for inner, outer only to make the holes - your linked example is formed of discrete overlapping building parts as well (not holes).

We know there will be mis-tagged cases but I suspect the cases where a multipolygon with holes is untagged is outnumbered by the case of building parts being untagged

A compromise might be to use the inner, outer check only in the case where the relation itself has the building tag

olt commented 8 years ago

Just noticed that both buildings are type=building not type=multipolygon. These relations are not handled by Imposm at all. It only imports the outer ways that are also tagged with building=*. This explains why the buildings do not have holes.

You are right that there are more parts than empty roles for buildings, but not for multipolygons.

It should be possible to import buildings relations with #81 when it's finished.

olt commented 8 years ago

Closing as #81 is merged.