3

Is there a a protocol followed to break long roads into segments (LineString)? Is it different for different countries. Or is it all random? I couldn't find anything relevant in OSM Wiki.

I've imported OpenStreetMap road data through imposm.org. I understand the distinction between OSM features for example highways and how they map to imposm schema motorways, mainroads and minorroads.

I am specifically curious about the splitting of roads into smaller LineSegments

  • 3
    Ways are at least split when the value of any tag changes: speed limit, surface, lit, ref, name, anything. – user30184 Jan 25 '17 at 21:32
  • That makes sense, @user30184. Is this a documented guideline? – Manav Kataria Jan 25 '17 at 21:36
  • 3
    It belongs to the data model of OSM, there is no other way to give different properties to segments of ways. I do not know if it is especially documented. – user30184 Jan 25 '17 at 21:49
  • 1
    It is even more complicated than tag changes on a way: if a new relation is to be added (e.g. for a bus route, or maybe some hiking route), a way also needs to be split, so that only the relevant parts of the original way are included in the relation. Suggested read would be the OSM data model on the wiki. BTW: OSM doesn't use the terms segment or LineString, there are only nodes, ways and relations. – mmd Jan 28 '17 at 11:41
1

A line in OSM (aka linestring, polyline, or in OSM speak a 'way') is generally split into two where the data which belongs to each of the two different segments needs to be different. So for instance one line might have data recording that it represents a path, with a tarmac surface, and with the name 'Frank's Path'. The adjoining line might have data recording that it's a path, and again that the name is 'Frank's Path', but that the surface is grass. This is fundamental to how OSM works.

Lines are split at will. There's no convention to suggest that they should be kept unsplit when possible. Splits may therefore also arise simply because one feature happened to be drawn by two people, or by being partially mapped on the first occasion and finished on a second (without the mapper bothering to join them into a single line - to be honest I've never even checked whether joining is possible).

Another logical reason exists to split - which is when one part of a line belongs to a 'relation' and another part does not. For example, one part of a road can be on a bus route (and therefore it belongs to the relation which represents that route), but you don't want the whole road to be part of that bus route - just the section of road which is used by the bus. The line therefore requires a split at either end of the section used by the bus - so that just this section can belong to the relation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.