I need to download graphs of European countries. I want "drive" network and need to categorize drive network into following three network types: "Highway/motorway and trunk", "primary/secondary" and "tertiary/residential".
Since, downloading the "drive" network without custom_filter is taking forever, I want to download the above three network types separately.
I know that custom_filter for motorway is this : '["highway"~"motorway|trunk"]'
I would like to ask if the following query is correct or not for "primary/secondary":
countries_list = ['UK', 'BELGIUM', 'LUXEMBURG',
'AUSTRIA', 'POLAND', 'HUNGARY', 'SWEDEN', 'SLOVAKIA',
'NETHERLANDS', 'SPAIN', 'SWITZERLAND', 'PORTUGAL', 'IRELAND',
'ITALY', 'DENMARK', 'ROMANIA', 'FINLAND']
## Download the country graphs and save them
for country in countries_list:
print(country + " *****graph download started****************************************************** !!")
cf = '["highway"~"primary |secondary"]'
G = ox.graph_from_place(country, network_type = 'drive', simplify = True, custom_filter = cf)
ox.save_graph_shapefile(G, filepath = country+"/drive_graph_shapefile/")
ox.save_graphml(G, filepath = country+"/drive_graph.graphml")
ox.save_graph_geopackage(G, filepath = country+"/drive_graph.gpkg")
print(country + "graph download successful *********************************************************** !!")
Please correct the above query if it is wrong. Also, what should be the custom_filter for tertiary/residential types of roads.