[OSM-dev] API 0.5 is on the way

Frederik Ramm frederik at remote.org
Fri Sep 14 23:42:04 BST 2007


Hi,

> A question that occurred to me this evening while fixing some unordered 
> ways: what will happen to forked ways?

These will be split into as many parts as required. The algortihm
works like this:

1. take any segment
2. look for another segment that fits before or after that; if so, add
it, and repeat; if there are no more segments that fit, you have one
way.
3. if segments are left over, go to 1.

In your case, this will create one part with the trunk and one branch,
the other will be one branch only.

There are cases where the results of this simple algorithm may be
sub-optimal, e.g. if you have a road with little residential branches:

----+-----+----
    |     |

This might well be split into

----+  and  ----+  and  -----
    |           |

instead of

----+-----+----   and  |  and |

but I don't think that would pose a problem.

> I've also seen a couple of cases where segments 
> 1 to 4 of a way have been in one place whilst segments 5 and 6 were 
> completely separated, some hundreds of metres away.  Will those cases 
> also get handled nicely?

The above algorithm handles that automatically, and nicely I'd say.

Bye
Frederik

-- 
Frederik Ramm  ##  eMail frederik at remote.org  ##  N49°00.09' E008°23.33'





More information about the dev mailing list