Graph From¶

Create a graph from OSM within some distance of some (lat, lng) point.

In [ ]:
# OSMnx: New Methods for Acquiring, Constructing, Analyzing, and Visualizing Complex Street Networks
import osmnx as ox

ox.config(use_cache=True, log_console=False)
ox.__version__
Out[ ]:
'1.1.2'

all_private¶

In [ ]:
center_point = (37.5661, 126.9783) # (lat, lng) Seoul, South Korea
dist = 1000
dist_type = 'bbox' # "network", "bbox"
network_type = 'all_private' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create a graph from OSM within some distance of some (lat, lng) point.
G = ox.graph_from_point(
    center_point,
    dist=dist, 
    dist_type=dist_type,
    network_type=network_type,
    simplify=True, 
    retain_all=False, 
    truncate_by_edge=False, 
    clean_periphery=True, 
    custom_filter=None)

# Plot a graph.
fig, ax = ox.plot_graph(G)
In [ ]:
center_point = (37.5661, 126.9783) # (lat, lng) Seoul, South Korea
dist = 1000
dist_type = 'network' # "network", "bbox"
network_type = 'all_private' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create a graph from OSM within some distance of some (lat, lng) point.
G2 = ox.graph_from_point(
    center_point,
    dist=dist, 
    dist_type=dist_type,
    network_type=network_type,
    simplify=True, 
    retain_all=False, 
    truncate_by_edge=False, 
    clean_periphery=True, 
    custom_filter=None)

# Plot a graph.
fig, ax = ox.plot_graph(G2)

all¶

In [ ]:
center_point = (37.5661, 126.9783) # (lat, lng) Seoul, South Korea
dist = 1000
dist_type = 'bbox' # "network", "bbox"
network_type = 'all' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create a graph from OSM within some distance of some (lat, lng) point.
G3 = ox.graph_from_point(
    center_point,
    dist=dist, 
    dist_type=dist_type,
    network_type=network_type,
    simplify=True, 
    retain_all=False, 
    truncate_by_edge=False, 
    clean_periphery=True, 
    custom_filter=None)

# Plot a graph.
fig, ax = ox.plot_graph(G3)
In [ ]:
center_point = (37.5661, 126.9783) # (lat, lng) Seoul, South Korea
dist = 1000
dist_type = 'network' # "network", "bbox"
network_type = 'all' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create a graph from OSM within some distance of some (lat, lng) point.
G4 = ox.graph_from_point(
    center_point,
    dist=dist, 
    dist_type=dist_type,
    network_type=network_type,
    simplify=True, 
    retain_all=False, 
    truncate_by_edge=False, 
    clean_periphery=True, 
    custom_filter=None)

# Plot a graph.
fig, ax = ox.plot_graph(G4)

bike¶

In [ ]:
center_point = (37.5661, 126.9783) # (lat, lng) Seoul, South Korea
dist = 1000
dist_type = 'bbox' # "network", "bbox"
network_type = 'bike' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create a graph from OSM within some distance of some (lat, lng) point.
G5 = ox.graph_from_point(
    center_point,
    dist=dist, 
    dist_type=dist_type, 
    network_type=network_type, 
    simplify=True, 
    retain_all=False, 
    truncate_by_edge=False, 
    clean_periphery=True, 
    custom_filter=None)

# Plot a graph.
fig, ax = ox.plot_graph(G5)
In [ ]:
center_point = (37.5661, 126.9783) # (lat, lng) Seoul, South Korea
dist = 1000
dist_type = 'network' # "network", "bbox"
network_type = 'bike' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create a graph from OSM within some distance of some (lat, lng) point.
G6 = ox.graph_from_point(
    center_point,
    dist=dist, 
    dist_type=dist_type, 
    network_type=network_type, 
    simplify=True, 
    retain_all=False, 
    truncate_by_edge=False, 
    clean_periphery=True, 
    custom_filter=None)

# Plot a graph.
fig, ax = ox.plot_graph(G6)

drive¶

In [ ]:
center_point = (37.5661, 126.9783) # (lat, lng) Seoul, South Korea
dist = 1000
dist_type = 'bbox' # "network", "bbox"
network_type = 'drive' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create a graph from OSM within some distance of some (lat, lng) point.
G7 = ox.graph_from_point(
    center_point,
    dist=dist, 
    dist_type=dist_type, 
    network_type=network_type, 
    simplify=True, 
    retain_all=False, 
    truncate_by_edge=False, 
    clean_periphery=True, 
    custom_filter=None)

# Plot a graph.
fig, ax = ox.plot_graph(G7)
In [ ]:
center_point = (37.5661, 126.9783) # (lat, lng) Seoul, South Korea
dist = 1000
dist_type = 'network' # "network", "bbox"
network_type = 'drive' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create a graph from OSM within some distance of some (lat, lng) point.
G8 = ox.graph_from_point(
    center_point,
    dist=dist, 
    dist_type=dist_type, 
    network_type=network_type, 
    simplify=True, 
    retain_all=False, 
    truncate_by_edge=False, 
    clean_periphery=True, 
    custom_filter=None)

# Plot a graph.
fig, ax = ox.plot_graph(G8)

drive_service¶

In [ ]:
center_point = (37.5661, 126.9783) # (lat, lng) Seoul, South Korea
dist = 1000
dist_type = 'bbox' # "network", "bbox"
network_type = 'drive_service' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create a graph from OSM within some distance of some (lat, lng) point.
G9 = ox.graph_from_point(
    center_point,
    dist=dist, 
    dist_type=dist_type, 
    network_type=network_type, 
    simplify=True, 
    retain_all=False, 
    truncate_by_edge=False, 
    clean_periphery=True, 
    custom_filter=None)

# Plot a graph.
fig, ax = ox.plot_graph(G9)
In [ ]:
center_point = (37.5661, 126.9783) # (lat, lng) Seoul, South Korea
dist = 1000
dist_type = 'network' # "network", "bbox"
network_type = 'drive_service' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create a graph from OSM within some distance of some (lat, lng) point.
G10 = ox.graph_from_point(
    center_point,
    dist=dist, 
    dist_type=dist_type, 
    network_type=network_type, 
    simplify=True, 
    retain_all=False, 
    truncate_by_edge=False, 
    clean_periphery=True, 
    custom_filter=None)

# Plot a graph.
fig, ax = ox.plot_graph(G10)

walk¶

In [ ]:
center_point = (37.5661, 126.9783) # (lat, lng) Seoul, South Korea
dist = 1000
dist_type = 'bbox' # "network", "bbox"
network_type = 'walk' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create a graph from OSM within some distance of some (lat, lng) point.
G11 = ox.graph_from_point(
    center_point,
    dist=dist, 
    dist_type=dist_type, 
    network_type=network_type, 
    simplify=True, 
    retain_all=False, 
    truncate_by_edge=False, 
    clean_periphery=True, 
    custom_filter=None)

# Plot a graph.
fig, ax = ox.plot_graph(G11)
In [ ]:
center_point = (37.5661, 126.9783) # (lat, lng) Seoul, South Korea
dist = 1000
dist_type = 'network' # "network", "bbox"
network_type = 'walk' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create a graph from OSM within some distance of some (lat, lng) point.
G12 = ox.graph_from_point(
    center_point,
    dist=dist, 
    dist_type=dist_type, 
    network_type=network_type, 
    simplify=True, 
    retain_all=False, 
    truncate_by_edge=False, 
    clean_periphery=True, 
    custom_filter=None)

# Plot a graph.
fig, ax = ox.plot_graph(G12)