Ways are an *ordered* list of segments.<br><br>Does the order have any significance?  Sometimes no, sometimes yes;  For some purposes it is OK to treat a way as a collection of segments, for other purposes the order is important.
<br><br>For example, the order of the segments is used by Osmarender to draw the path along a way which guides the position of the name.<br><br>Loops and branches are examples where all segments in a way cannot be contiguous.  I think the consensus is that roundabouts should be drawn as a separate way, but branches are often added to ways regardless of continuity.
<br><br>For an editor it is important that it does not gratuitously alter the order of the segments in the way.  Some editors, such as JOSM, do not give the user any feedback about how the segments are ordered, but as far as I can tell it has the following behaviour (Imi will confirm or deny this):
<br><br>- Segment order is preserved from download to upload<br>- When a segment is split, the order of both segments in a way is preserved.  So A->B->C becomes A->B1->B2->C.<br>- When a segment is added to way it is *always* added to the end of the list.
<br><br>Etienne<br><br><br><div><span class="gmail_quote">On 8/11/06, <b class="gmail_sendername">Michael Strecke</b> <<a href="mailto:MStrecke@gmx.de">MStrecke@gmx.de</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;">
After reading various documents, how-tos, and comments I'm still<br>wondering if the order in which the segment IDs appear in a way is<br>significant or not.<br><br>For a programmer this point is important for all operations which add
<br>segments to a way (e.g. split segment, extend way with segments). Do I<br>simply add the ID to the list, or do I have to guess where I have to<br>insert it into the list.<br><br>Before you say yes, keep in mind:<br>- that E- and Y-shaped ways exist, in which case no "natural" order
<br>scheme exists.<br>- that the "oneway" attribute is assigned to segments (and is not<br>dependent on the order of the way segment list).<br><br>On the other hand, the SQL definition of the OSM database (from SVN)
<br>suggests some kind of order:<br><br>--<br>-- Table structure for table `way_segments`<br>--<br><br>DROP TABLE IF EXISTS `way_segments`;<br>CREATE TABLE `way_segments` (<br>  `id` bigint(64) NOT NULL default '0',<br>  `segment_id` int(11) default NULL,
<br>  `version` bigint(20) NOT NULL default '0',<br>  `sequence_id` bigint(11) NOT NULL auto_increment,<br>  PRIMARY KEY  (`id`,`version`,`sequence_id`)<br>) ENGINE=MyISAM DEFAULT CHARSET=latin1;<br><br>Any insights?<br><br>
<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>