[GIS] How are OSM road segments (LineStrings) split

imposmopenstreetmaproadsplitting

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

Best Answer

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.