I'd be inclined to split ways containing non-contiguous segments into separate ways.<br><br>A way containing contiguous segments would become a way containing an ordered list of nodes.<br><br>A way containing several non-contiguous (or branching segments) would become several unrelated ways containing ordered lists of nodes.
<br><br>Ideally superways should be used to create un-ordered sets of ways in this case. Alternatively the split ways could be given a common tag so that they can be regrouped later when superways are implemented.<br><br>
80n<br><br><div><span class="gmail_quote">On 1/5/07, <b class="gmail_sendername">Nick Whitelegg</b> <<a href="mailto:nick@hogweed.org">nick@hogweed.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Been thinking a bit more about the idea of a segment-free OSM database and its<br>benefits for shapefile, and consequently easy Mapnik map, production.<br>Therefore, if there's interest, I'll set up a segment free OSM database on
<br>dev, consisting of linear ways made up of ordered list of nodes, with<br>direction (no superways as yet!) and based on planet.osm. It could also have<br>its own API (Richard - maybe this could tie in with Potlatch?)<br>
<br>Current data will of course need to be cleaned up before adding to the<br>database, to correct ways which have the segments in non-sequential order, or<br>not all aligned in the right direction. Branched ways would also need to be
<br>split.<br><br>I've quickly devised some rough, high-level pseudocode for each of these<br>tasks. This is based on simply thinking about the problem, maybe there are<br>some not-immediately-obvious algorithms which would do it faster, please let
<br>me know if there are.<br><br>Thanks,<br>Nick<br><br>---------------<br><br>Re-order ways:<br><br>Find one node common to only one segment<br>Add to ordered list of nodes<br>Get parent segment<br>Until we find another node common to only one segment
<br> Find the other node in the segment<br> Add to ordered list of nodes<br> Get parent segment<br>Loop<br><br>Split branched way:<br><br>Find one linear way as in "re-order ways", above<br>
<br>Find the first node in the first linear way belonging to more than two<br>segments<br>Find another segment common to the node, not done already<br>Find another way as in "re-order ways", above<br>Recursively repeat this process to completely split the branched way
<br><br>_______________________________________________<br>dev mailing list<br><a href="mailto:dev@openstreetmap.org">dev@openstreetmap.org</a><br><a href="http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev">http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev
</a><br></blockquote></div><br>