Planar Network Download

New to OSM usage, so kind of a newb. Can someone provide me with steps to download a single US state worth of vector data so I can build a planar network from the OSM data. I’ve downloaded a subset of data using a rectangle selection, but the resulting .osm data when viewed and queried in QGIS is not a complete planar graph. For instance, when I try to select a single vertex the resulting line transcends across multiple vertices. Is OSM data a true planar graph or will I have to run an intersect algorithm on it? I’ve tried the QGIS intersect function on the sample set I downloaded, but it crashes. My end goal is to have a bounded administration vector layer(state level in my case) with all vectors terminated at all intersections and no dangles outside of the bounding admin boundary.

Attached picture is what happens when I try to select a single feature in QGIS from the downloaded sample I got from OSM. The selected vector as you can see spans across multiple vertices without any breaks.

I don’t fully know how .osm files work.

In OSM lines can overlap. This is usefull for bridges for example.
If you want those to be planar, you need an intersection algorithm.

For connecting roads however, the best practice is that they share nodes.
I don’t know how this sharing is represented in the .osm file, but you could try to detect nodes with identical coördinates and split lines at those nodes.
Maybe the QGIS intersect function crashes because it might not properly handle the case of a line ending exactly on another line. So after seperating it might work?

You may be interested in OSMnx 1.7.1 documentation.

The OSM data model supports topological connectivity, at least.

Yes, that’s the way we do it : if tags don’t change, we don’t split a way at each intersections.
The OSM data model is extremely simple: Elements - OpenStreetMap Wiki

But is has to be processed in order to be routed.

1 Like