[OSM-dev] multipolygon relation and non-closed ways
Frederik Ramm
frederik at remote.org
Sun Oct 14 10:52:38 BST 2012
Hi,
On 14.10.2012 00:36, Pedro Larroy wrote:
> So for overlapping inner polygons the only way to differentiate them
> is by tagging as far as I can see.
I'm not sure I understand. There must not be any overlapping rings in a
multipolyon, no matter what the role is, and inner rings must not touch
outer rings either. Touching inner rings are not allowed in simple
features but we have chosen to allow them in OSM (for the "big forest
containing a lake and adjacent meadow" type of situation).
> Otherwise, looking at the Algorithm page that you mentioned, doesn't
> the step RA-4 become ambiguous?
It is indeed not immediately clear which connecting way to choose, and a
perfect algorithm would have to be complemented with a backtracking
scheme to evaluate several possibilities. But even if one were to
include the role in the equation that would not change things: If you
have four non-closed ways meeting in one point like this (fixed font, *
= meeting point)
111111*3333334
2 24 4
22 24 4
22222224444444
and these four ways together form two touching inner rings, then they
will *all* have the "inner" role - so looking at the role won't help!
> The algorithm that I'm using stores the endpoint on a hash to make the
> rings, so if there's more than two is not possible to have an clear
> result.
In the above situation, if you mistakenly combine ways 1+3 and ways 2+4
you will not end up with a valid multipolygon, so you have to go back
and try the other option which will work. I added a note to the
algorithm page explaining that.
> Am I missing something here?
No, you were right in spotting the problem; it is however one that
seldom occurs in practice because in most cases, the inner rings are not
groups of multiple ways but just a single closed way.
Bye
Frederik
--
Frederik Ramm ## eMail frederik at remote.org ## N49°00'09" E008°23'33"
More information about the dev
mailing list