0

I am looking for a tool or query to split the OSM highways into multiple segments. Each segment should only consist of two nodes (start and end).

I should do the same as described in this GIS Stackexchange answer but with PostGIS.

Is there an importing tool like osm2po that I can do this with? Note I don't only want to split it at intersections.

Or alternatively, how could I use ST_Split() or ST_Dump() to do this?

ustroetz
  • 7,994
  • 10
  • 72
  • 118
  • See if this helps you http://stackoverflow.com/questions/7595635/how-to-convert-polygon-data-into-line-segments-using-postgis – user30184 Dec 02 '14 at 21:53

1 Answers1

2

You are going to split at each point? This may produce tons of data!

Yes, osm2po can do that. Usually osm2po splits at intersections or at important nodes such as levelcrossings if necessary. The trick is, to give these nodes an importance. Namely, by setting the Node-Clazz >0. A good example of how to do it you'll find inside the plugins-source-zip. Look for TrafficSignals. In your case every node seems important, so just remove the condition.

Carsten
  • 3,318
  • 1
  • 12
  • 9
  • Yes I want to split it at each point. I will only do this for a small extract, so I am not to concerned about the data volume. Can you point out a little further where exactly I have to set the Node-Clazz or where exactly inside the plugins-source-zip I can find an example? – ustroetz Dec 03 '14 at 17:07
  • Are you familiar with Java? If not, try to convert the created road segments with PostGIS means. – Carsten Dec 05 '14 at 21:27