[Tagging] Another multipolygon question

Kevin Kenny kevin.b.kenny at gmail.com
Fri Oct 26 03:42:33 UTC 2018


On Thu, Oct 25, 2018 at 10:40 PM Dave Swarthout <daveswarthout at gmail.com>
wrote:

> Thanks again, Adam.
>
> That was also helpful. It brings up a question about sorting. After
> sorting, are the elements arranged according to their coordinates, that is
> to say, spatially? Or nearest node at each end of a member way is checked
> to see which other node ways are closest? Or what?
>

It's a little complicated.  The gist is that 'sort' tries to hook as much
together as possible so that the ways are in 'the right order'.

It starts by making the longest chains possible by putting the ways with
common endpoints together.

Once that's done, I *think* that it greedlly starts with the longest open
chain and drops that in place. Then it successively finds the nearest
endpoint on another open chain and starts from there, so that the gaps are
as short as possible. This may not be the best choice, particularly if the
relation is really messed up, but at least it connects what it can, and if
you zoom to the disconnected ways, you can eyeball where you want them to
go.

Routes are slightly more complicated, but once you learn to read the column
with the arrows in the relation editor, you'll pretty quickly be able to
figure out what's going on.  in that column, the arrows join if the ways
share an endpoint, and the arrowhead points in the direction of the way. If
the ways form a closed ring, the arrows will, too. In a multipolygon, if
all the ways don't form closed rings after sorting, there's a problem.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tagging/attachments/20181025/c70cc007/attachment.html>


More information about the Tagging mailing list