osmnx

Subdividing streets with interpolate points function

Subdividing streets with interpolate points function Question: I want to subdivide streets by maximum distance as described in this question and response. My problem is that I do not understand the "Interpolate Points" function output. My current code is: # Imports !pip install osmnx import osmnx as ox import networkx as nx # Enter the …

Total answers: 1

Change road network to bidirectional in osmnx

Change road network to bidirectional in osmnx Question: I wonder if I can set all road networks to bidirectional using osmnx? I hope it is bidirectional rather than undirected because I still hope to use some functions like osmnx.truncate. So osmnx.get_undirected(G) cannot help me. I saw @gboeing mentioned this can be done by changing the …

Total answers: 1

Set z-order of Edges in Pandas Dataframe

Set z-order of Edges in Pandas Dataframe Question: I’m using OSMnx to create some plots of road networks with data shown by colour, below is an example which produces an image with colour showing betweenness centrality. The problem I’m having is that, due to the zordering, some of the lighter regions are covered by other …

Total answers: 2

OSMNX not choosing shorter route

OSMNX not choosing shorter route Question: I’m using OSMnx to do routing between two nodes in a graph and an obvious route is not being returned as one of the shortest. The relevant code: start = (42.73843806388065, -84.51908658324757) distance_max = 3163.834987247283 G = ox.graph_from_point(start, network_type="drive", dist=distance_max, simplify=False)#, truncate_by_edge=True) G = ox.utils_graph.get_undirected(G) lng_orig = -84.51858078986406 lat_orig …

Total answers: 1

Load a Graph from .osm file using Osmnx/Python

Load a Graph from .osm file using Osmnx/Python Question: I want to load a graph from XML, i.e. .osm file, using Osmnx Python library. The .osm file contains roads not connected each other, for example only highway=primary and highway=primary_link of a country’s region. I use the parameter retain_all to avoid discarding all the roads, since …

Total answers: 1

Extremely long response time with graph_from_place OSMNX

Extremely long response time with graph_from_place OSMNX Question: I’m trying to download the map of Mexico to avoid querying using save_graphml and avoiding long response times in the graph_from_place, but I’ve already left this code running for almost six hours and absolutely nothing happens. import osmnx as ox ox.config(use_cache=True, log_console=True) G = ox.graph_from_place(‘Mexico’, network_type = …

Total answers: 1

Isochrones with OSMnx

Isochrones with OSMnx Question: I have a large data (10k rows) of locations (lat, lon) and I would like to compute a 10min-walk isochrone starting from each point with OSMnx. (I tried with openrouteservice but have some limitations). I tried with this example: https://github.com/gboeing/osmnx-examples/blob/v0.13.0/notebooks/13-isolines-isochrones.ipynb import pandas as pd import geopandas as gpd from shapely.geometry import …

Total answers: 2

python osmnx – extract only big freeways of a country

python osmnx – extract only big freeways of a country Question: I know it is possible to extract the road network of a city via the OSMNX python package. See details at https://geoffboeing.com/2016/11/osmnx-python-street-networks/ . paris_network = ox.gdf_from_place(“Paris”) But, let’s say I do not want that level of high details, but rather only big freeways of …

Total answers: 2