Reputation: 809
I'm using OSMnx to extract shapes of roads. However, I found that some ways in OSM seem to be only partially represented geometrically in OSMnx.
A reproducible example that you can run on overpass turbo :
<union>
<bbox-query s="43.604437753042106" w="1.4469172178876575" n="43.60670421020654" e="1.4497628267951939"/>
<recurse type="up"/>
</union>
<print mode="meta"/>
And the command to load this graph with OSMnx :
import osmnx as ox
G = ox.graph_from_bbox(43.60670421020654, 43.604437753042106, 1.4497628267951939, 1.4469172178876575, network_type='drive')
ox.plot_graph(G)
If we take the example of the way 32021916, inspecting the G variable with a debugger shows that G._pred contains 2 edges representating that way :
However, the plotted graph is complete and displays this road's portion. So my question is : how do I get the complete geometry property for this road ?
Upvotes: 2
Views: 1431
Reputation: 809
I think I found the solution from the code of the plot_graph
function : github repo
The plot function draw a straight line between the 2 nodes if geometry is not defined.
Upvotes: 5