I’ve been trying to solve this for a few days and it’s impacting my research, so the help would be grately appreciated! I am attempting to run some code that pings Overpass for about 100 different coordinate locations and generates walkshed maps and node density maps for each. See code below:
G_loc = ox.graph_from_point(location, dist=half_mile, network_type=‘walk’)
G_loc_proj = ox.project_graph(G_loc)
nodes_proj = ox.graph_to_gdfs(G_loc_proj, edges=False)
graph_area_m_loc = nodes_proj.unary_union.convex_hull.area
G_loc_basic_stats = ox.basic_stats(G_loc_proj, area=graph_area_m_loc)
G_loc_intersection_density = G_loc_basic_stats[‘intersection_density_km’]/100
intersection_density_list.append(G_loc_intersection_density)
Every time run through about 5 of these requests for different coordinates, my code is shut down because overpass is saying I’ve hit “Max retries” from my URL. How can I get past this?
Overpass serves are being bombarded by requests. If at all possible, I recommend downloading the relevant areas from Geofabrik and doing the querying or processing locally.
So my problem is I’m working off of a map of the US. Might be too big to download, no?
The whole US is a 12 GB download (you can also download individual states if you don’t need all). Afterwards you could use the “osmium” command line utility to extract your areas of interest from that file. Osmium can do many extracts at once, however you’ll probably want to do this in batches of 10 or so in order not to stretch your RAM too thin.
Other options are
- running your very own Overpass server based on that US download;
- using extract.bbbike.org or the Protomaps export server to download data for custom areas of interest
- using metro areas from OSM Extracts - Interline Portal
Slice will give you a small area extract with a bit less ceremony. Lots of options depending on your needs.