python osmnx - extract only big freeways of a country
python osmnx - extract only big freeways of a country
I know it is possible to extract the road network of a city via the OSMNX python package. See details at https://geoffboeing.com/2016/11/osmnx-python-street-networks/ .
paris_network = ox.gdf_from_place("Paris")
But, let's say I do not want that level of high details, but rather only big freeways of a whole country. I'm looking for something like :
france_big_expressway_network = ox.gdf_from_place("France", road_type = "freeway")
I guess it might comes from the "infrastructure" argument but as a newbie I really do not get how to use it precisely.
1 Answer
1
Yes you can do this with OSMnx:
import osmnx as ox
ox.config(use_cache=True, log_console=True)
G = ox.graph_from_place('France', network_type='none', infrastructure='way["highway"~"motorway"]')
fig, ax = ox.plot_graph(G)
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Thank you sir @gboeing
– hans glick
Sep 20 '18 at 9:44