[OSM-dev] multipolygon relation and non-closed ways

Jukka Rahkonen jukka.rahkonen at latuviitta.fi
Mon Oct 15 15:24:49 BST 2012


Martin Koppenhoefer wrote:
> 2012/10/15 Jukka Rahkonen <jukka.rahkonen at latuviitta.fi>:
>> Perhaps examples B and F could also contain at least two ways? If there is
>> only one way, why to make a multipolygon relation at all?
>
>
> there can be reasons. E.g. you want to distinguish linear features from
areas. The way could be tagged barrier=fence/wall/etc. and the area
landuse=* (this is a quite common situation).

Yes, that is understandable situation indeed.

What do you think would be the best thing to do if an user wants to re-use
a zig-zagging linestring for creating a multipolygon relation? In a raw
format with vertices in the same order as they appear in a linestring the
resulting polygon will be invalid as OGC polygon because of
self-intersections. I guess it is pretty expensive to do topology checks
in the main OSM database triggered automatically every time when relations
are saved. Other alternatives I can imagine are
- Make OSM editor to check the topology of multipolygon relations before
saving and warn users about conflicts.
- Run some kind of validating bots which harvest areas and multipolygons
from OSM database, resolve simple cases and make topology error reports
from the remaining.
- Do nothing in the OSM db side and trust that programs which consume OSM
data and need OGC style validity can resolve the conflicts in a reasonable
way.
- All of those together.

What I have been doing myself in just to accept the results from osm2pgslq
and ogr2ogr and in addition delete all the imported features which are
reported invalid by IsValid function.

-Jukka Rahkonen-





More information about the dev mailing list