Graph From Place¶

Create graph from OSM within the boundaries of some geocodable place(s).

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 [ ]:
query = '중구, 서울특별시, 대한민국'
network_type = 'all_private' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create graph from OSM within the boundaries of some geocodable place(s).
G = ox.graph_from_place(
    query, 
    network_type=network_type, 
    simplify=True, 
    retain_all=False, 
    truncate_by_edge=False, 
    which_result=None, 
    buffer_dist=None, 
    clean_periphery=True, 
    custom_filter=None)

# Plot a graph.
fig, ax = ox.plot_graph(G)
/Users/junhyun/.pyenv/versions/3.8.5/envs/gis/lib/python3.8/site-packages/osmnx/geocoder.py:110: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  gdf = gdf.append(_geocode_query_to_gdf(q, wr, by_osmid))

all¶

In [ ]:
query = '중구, 서울특별시, 대한민국'
network_type = 'all' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create graph from OSM within the boundaries of some geocodable place(s).
G2 = ox.graph_from_place(
    query, 
    network_type=network_type, 
    simplify=True, 
    retain_all=False, 
    truncate_by_edge=False, 
    which_result=None, 
    buffer_dist=None, 
    clean_periphery=True, 
    custom_filter=None)

# Plot a graph.
fig, ax = ox.plot_graph(G2)
/Users/junhyun/.pyenv/versions/3.8.5/envs/gis/lib/python3.8/site-packages/osmnx/geocoder.py:110: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  gdf = gdf.append(_geocode_query_to_gdf(q, wr, by_osmid))

bike¶

In [ ]:
query = '중구, 서울특별시, 대한민국'
network_type = 'bike' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create graph from OSM within the boundaries of some geocodable place(s).
G3 = ox.graph_from_place(
    query, 
    network_type=network_type, 
    simplify=True, 
    retain_all=False, 
    truncate_by_edge=False, 
    which_result=None, 
    buffer_dist=None, 
    clean_periphery=True, 
    custom_filter=None)

# Plot a graph.
fig, ax = ox.plot_graph(G3)
/Users/junhyun/.pyenv/versions/3.8.5/envs/gis/lib/python3.8/site-packages/osmnx/geocoder.py:110: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  gdf = gdf.append(_geocode_query_to_gdf(q, wr, by_osmid))

drive¶

In [ ]:
query = '중구, 서울특별시, 대한민국'
network_type = 'drive' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create graph from OSM within the boundaries of some geocodable place(s).
G4 = ox.graph_from_place(
    query, 
    network_type=network_type, 
    simplify=True, 
    retain_all=False, 
    truncate_by_edge=False, 
    which_result=None, 
    buffer_dist=None, 
    clean_periphery=True, 
    custom_filter=None)

# Plot a graph.
fig, ax = ox.plot_graph(G4)
/Users/junhyun/.pyenv/versions/3.8.5/envs/gis/lib/python3.8/site-packages/osmnx/geocoder.py:110: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  gdf = gdf.append(_geocode_query_to_gdf(q, wr, by_osmid))

drive_service¶

In [ ]:
query = '중구, 서울특별시, 대한민국'
network_type = 'drive_service' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create graph from OSM within the boundaries of some geocodable place(s).
G5 = ox.graph_from_place(
    query, 
    network_type=network_type, 
    simplify=True, 
    retain_all=False, 
    truncate_by_edge=False, 
    which_result=None, 
    buffer_dist=None, 
    clean_periphery=True, 
    custom_filter=None)

# Plot a graph.
fig, ax = ox.plot_graph(G5)
/Users/junhyun/.pyenv/versions/3.8.5/envs/gis/lib/python3.8/site-packages/osmnx/geocoder.py:110: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  gdf = gdf.append(_geocode_query_to_gdf(q, wr, by_osmid))

walk¶

In [ ]:
query = '중구, 서울특별시, 대한민국'
network_type = 'walk' # "all_private", "all", "bike", "drive", "drive_service", "walk"

# Create graph from OSM within the boundaries of some geocodable place(s).
G6 = ox.graph_from_place(
    query, 
    network_type=network_type, 
    simplify=True, 
    retain_all=False, 
    truncate_by_edge=False, 
    which_result=None, 
    buffer_dist=None, 
    clean_periphery=True, 
    custom_filter=None)

# Plot a graph.
fig, ax = ox.plot_graph(G6)
/Users/junhyun/.pyenv/versions/3.8.5/envs/gis/lib/python3.8/site-packages/osmnx/geocoder.py:110: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  gdf = gdf.append(_geocode_query_to_gdf(q, wr, by_osmid))