gboeing / osmnx

OSMnx is a Python package to easily download, model, analyze, and visualize street networks and other geospatial features from OpenStreetMap.
https://osmnx.readthedocs.io
MIT License
4.86k stars 826 forks source link

Get all country data #310

Closed JiweiZh closed 5 years ago

JiweiZh commented 5 years ago

Hi, I want to get the graph for whole country to calculte the distance between some points, my code is like this:

ox.config(use_cache=True, log_console=True)
G = ox.graph_from_place('France', network_type='drive', which_rresult=2)

But I think that is too large, so I got python request's time out errors each time, I try to change these two parameters: max_query_area_size, timeout, but I seem also take so much time.

Is this the right way to get all the graph for the whole country ? or some other way?

Thx a lot!

gboeing commented 5 years ago

Your which_result argument is misspelled. But the main issue here will be RAM on your computer. OSMnx automatically handles large queries, subdividing them so the API can handle it. But your computer needs enough memory to construct a massive country-wide graph. You might want to filter to only retain freeways or something like that if memory is an issue.

In general, the issue tracker is for documenting bugs or proposing new features. Best to ask how-to questions at the user community on StackOverflow, per the contributing guidelines.