I am getting familiar with the package and I have been trying to find a list of all the possible custom filters for network_type.
Looking directly at the code has provided some ideas, but I wonder if there is a list somewhere with all the type of filters (motorway, primary, residential) per network_type (drive, walking,bike)
Here is a link to all the types of filters road network analysis and OpenStreetMap Wiki.
The network_type
parameter allows you to specify the type of network (e.g., driving, walking, biking). Each network_type
includes a predefined set of OSM highway tags.
drive
Included Highway Types:
motorway
, motorway_link
trunk
, trunk_link
primary
, primary_link
secondary
, secondary_link
tertiary
, tertiary_link
unclassified
, residential
living_street
, service
import osmnx as ox
# Fetch driving network
G = ox.graph_from_place('Your Location', network_type='drive')
drive_service
Included Highway Types:
drive
service
roadsG = ox.graph_from_place('Your Location', network_type='drive_service')
bike
Included Highway Types:
cycleway
primary
, primary_link
secondary
, secondary_link
tertiary
, tertiary_link
unclassified
, residential
living_street
, service
path
, road
, track
G = ox.graph_from_place('Your Location', network_type='bike')
walk
Included Highway Types:
footway
, pedestrian
path
, steps
residential
, living_street
service
cycleway
, road
(for crossings and walkways)G = ox.graph_from_place('Your Location', network_type='walk')
all
Included Highway Types:
motorway
, trunk
, primary
, etc.unclassified
, residential
, service
, etc.footway
, pedestrian
, path
, etc.cycleway
, steps
, track
, bridleway
, raceway
, busway
, etc.G = ox.graph_from_place('Your Location', network_type='all')
all_private
Included Highway Types:
all
G = ox.graph_from_place('Your Location', network_type='all_private')
You can use a Custom filter
highway_types = [
'motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'residential', 'unclassified',
'motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link',
'living_street', 'service', 'road'
]
custom_filter = '["highway"~"{}"]'.format('|'.join(highway_types))
G = ox.graph_from_place('Your Location', custom_filter=custom_filter)