On Wed, Jul 29, 2009 at 12:26 PM, Ben Supnik <bsup...@xsquawkbox.net> wrote:

> Hi Y'all,
>
> I am trying to build an algorithm to produce correctly layered,
> correctly connected road networks from OSM ways + the layer tag.
>
> There are a few "easy" cases:
>
> - When two ways cross laterally but have different layers and have no
> node at the intersection, clearly they do not connect in space, and the
> layer of each of the four partial ways at the intersection point is clear.
>
> - When two (and only two) ways end at a common node, and the ways have
> different layers, it's probably a safe bet to say that this is where the
> layers transition and the two ways should connect.  (E.g. a way with
> layer=1 and a way with layer=0 form a highway that has a bridge...this
> junction is where the bridge "hits the ground".
>
> There are two cases I am wondering about though:
>
> - Two ways cross and have different layers, but a common node exists at
> the crossing point.
>
> - Three ways come together, two of one layer, and one of another layer.
>
> An example of this last case might be a residential road that is about
> to "bridge" over a highway, but the bridge ends at a T junction to
> another residential road, e.g.
>
> ----*=====
>     |
>
> (Sorry for the ASCII drawing...)
>
> These two cases seem tricky to me because there may be some cases where
> ways of different layer need to be brought together and some where they
> need to be kept separate.
>
> Does anyone have thoughts (or has anyone implemented) a heuristic to
> decide when two ways need to be put into the same layer at a given node?
>
> Thanks!
> Ben
>

The topology rules are simple--if the ways share a node, then they are
connected and it is possible to navigate from any of the connected ways to
another (subject to turn restrictions, etc.) The layer tag is primarily a
hint for renderers for proper display of vertically separated features. If
the data is otherwise, then it is an error and should be corrected.

Karl
_______________________________________________
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev

Reply via email to