I'm working on a project involving historical data, which I'm wanting to turn into an .osm XML file as a routable network (e.g. using OSRM) and for rendering (using Mapnik/CartoCSS). The data will not be added into OSM. My aim is to convert the Shapefiles into .osm format, and be routable, so that I then get the benefits of the OSM toolsets. I'm very familiar with OSM and its ecosystem, being a long-time contributor and user. What I'm not so familiar is the GIS world, where a Shapefile (in my case from ArcGIS) has to contain ways and nodes as separate layers. The main problem I'm having is making the network actually topographically routable. Can anyone suggest a workflow which would enable the two layers containing lines and junction points to be merged into a single .osm file where the points become nodes actually as properties of the ways? Currently I am:
The routability partly works - stretches of route do route, but where there are junctions, the routability stops. My clear hunch is that the .osm data contains all the ways and nodes but that the ways themselves do not reference the nodes. Is there some adjustment or different toolchain I could use the merge the two layers properly rather than treat them as two sets of items in the one .osm file? I'm trying to avoid having to pick through and modify XML directly, which will not fun. Any pointers would be appreciated. asked 09 May '16, 12:42 fooquency |
Can you elaborate on the role of the "points" shape file. Since the "lines" file will already contain geometries for each road, and could be turned into a routable file by unrolling these geometries into OSM ways and nodes, what purpose does the "points" file have?
The points file was created to have the actual junctions in, as distinct from places where the lines simply cross over (e.g. a bridge). However, I will check on whether this is actually needed. I think we previously tried just the lines file and that didn't give us a properly-routable network.
Seems this has worked. Thanks again, Frederik. Turns out the main issue was that I'd chosen highway=motorway in the Osmosis tag conversion, resulting in lots of implied one ways in the router.