[OSM-dev] Segment-free OSM database and API

80n 80n80n at gmail.com
Fri Jan 5 19:17:36 GMT 2007


I'd be inclined to split ways containing non-contiguous segments into
separate ways.

A way containing contiguous segments would become a way containing an
ordered list of nodes.

A way containing several non-contiguous (or branching segments) would become
several unrelated ways containing ordered lists of nodes.

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.

80n

On 1/5/07, Nick Whitelegg <nick at hogweed.org> wrote:
>
>
> Been thinking a bit more about the idea of a segment-free OSM database and
> its
> benefits for shapefile, and consequently easy Mapnik map, production.
> Therefore, if there's interest, I'll set up a segment free OSM database on
> dev, consisting of linear ways made up of ordered list of nodes, with
> direction (no superways as yet!) and based on planet.osm. It could also
> have
> its own API (Richard - maybe this could tie in with Potlatch?)
>
> Current data will of course need to be cleaned up before adding to the
> database, to correct ways which have the segments in non-sequential order,
> or
> not all aligned in the right direction. Branched ways would also need to
> be
> split.
>
> I've quickly devised some rough, high-level pseudocode for each of these
> tasks. This is based on simply thinking about the problem, maybe there are
> some not-immediately-obvious algorithms which would do it faster, please
> let
> me know if there are.
>
> Thanks,
> Nick
>
> ---------------
>
> Re-order ways:
>
> Find one node common to only one segment
> Add to ordered list of nodes
> Get parent segment
> Until we find another node common to only one segment
>         Find the other node in the segment
>         Add to ordered list of nodes
>         Get parent segment
> Loop
>
> Split branched way:
>
> Find one linear way as in "re-order ways", above
>
> Find the first node in the first linear way belonging to more than two
> segments
> Find another segment common to the node, not done already
> Find another way as in "re-order ways", above
> Recursively repeat this process to completely split the branched way
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20070105/d95a21d0/attachment.html>


More information about the dev mailing list