[OSM-dev] Multipolygon processing (was: osm2spatialite!)

Jukka Rahkonen jukka.rahkonen at latuviitta.fi
Fri Feb 18 13:56:11 GMT 2011

Frederik Ramm wrote:
> Hi,
> On 02/18/11 10:16, Jukka Rahkonen wrote:
>> Once you have found a perfect solution, how about placing it somewhere
>> in
>> front of the OSM database instead? Wouldn't it be better to prevent OSM
>> users from inserting invalid multipolygons than try to fix them
>> temporary
>> every time they are used?
> No, for several reasons. One of them is purely technical; if you wanted
> to disallow the creation of invalid multipolygons, whenever a user does
> something as simple as changing the position of a single node, the
> database would have to find out all ways using that node, and all
> relations using one of these ways, and compute the polygons for them and
> find out if that single node move has maybe caused an intersection to
> appear. That would take way too much time!

I was thinking about the same. What are the other reasons? One that comes
into my mind is a Simple Feature wise invalid case where the inner ring is
touching outer ring in two or more points. Do we need other (multi)polygon
types which are invalid by the restricting simple feature rules?

I must tell that that I have nothing fundamental against on-the-fly
polygon topology and actually I have been working loosely with such a
database since 1998. We have very little problems with invalid polygons
but the editor software and the database have been developed hand in hand
and for sure the digitisers do not need to to pay any attention to inner
and outer rings when they do their work. In addition, we do check the
topology always before changes are saved into database.

-Jukka Rahkonen-

More information about the dev mailing list