[OSM-dev] Interpreting segments of a way

Etienne 80n80n at gmail.com
Mon Oct 23 18:06:15 BST 2006


On 10/23/06, bvh <bvh-osm at irule.be> wrote:
>
> > >On Mon, Oct 23, 2006 at 03:37:19PM +0100, Etienne wrote:
> > >> Ways are *ordered* lists of segments.
> > >
> > >On what basis should the ordering take place?
> >
> >
> > In a .osm file the <seg> elements within a <way> element are listed in
> the
> > order defined in the database.
> >
> > In JOSM segments are sequenced in ways in the order in which they were
> > added.  So each time a segment is added it will be added to the end of
> the
> > list.  Once exception, if a node is inserted then the new segment is
> > inserted adjacent to the segment at the insertion point (which is what
> you
> > would expect).
> >
> > There is no direct way of viewing or altering the segment order in
> JOSM.  I
> > think there is a way view and edit the segment order in the Applet.
> >
>
> So basically, although a way is an ordered list of segments, there
> is no (easy) way to change or view the order, the server doesn't care
> about the order and there is no rule as to how the order should be
> interpreted in terms of structures in reality.


The order of segments is used for a number of purposes:
1) Route planning applications need to know where a way starts, where it
ends and how long it is between those two points.
2) Osmarender uses the node order (implied by the segment order and
direction) to be able to draw names along the path of a street
3) Node order (implied from segment direction) is used to indicate one-way
streets, river flow, etc.


For all intents and purposes it seems that a way is actually
> an unordered list of segments from the point of view of a client
> editor.
>
> I think I agree more with the other poster, that a way is (should be)
> conceptually just an (unordered) collection of segments.
>
> > Each non-contiguous part of the street would be a separate way.  There
> is a
> > subsiduary proposal to implement a hierarch of ways which would enable a
> > group of ways to be annotated with a common set of tag values (such as
> the
> > street's name).
>
> That's just absurd! What would be the advantage to the current system?
> To me that just seems as if ways become segments and something newly
> invented becomes ways. It is better the way it is imho.


The current system does not allow two ways to share the same pair of nodes
but with different directions.

An alternative implementation would be to allow segments to be polylines (an
ordered list of nodes) and then treat ways as an unordered collection of
segments.  You might feel more comfortable about this, but in fact it is
structurally the same solution as that which I tried to explain earlier.

Etienne

cu bart
>
> _______________________________________________
> 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/20061023/2835c084/attachment.html>


More information about the dev mailing list