On Thu, Oct 25, 2018 at 10:40 PM Dave Swarthout <daveswarth...@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.
_______________________________________________
Tagging mailing list
Tagging@openstreetmap.org
https://lists.openstreetmap.org/listinfo/tagging

Reply via email to