Questions tagged [osmnx]

OSMnx is a Python package to download, model, analyze, and visualize street networks and other geospatial features from OpenStreetMap. You can download and model walking, driving, or biking networks with a single line of code then easily analyze and visualize them. You can just as easily work with urban amenities/points of interest, building footprints, transit stops, elevation data, street orientations, speed/travel time, and routing.

OSMnx is a package to download, model, analyze, and visualize street networks and other geospatial features from . OSMnx is built on top of and . You can download and model walking, driving, or biking networks with a single line of code then easily analyze and visualize them. You can just as easily work with urban amenities/points of interest, building footprints, transit stops, elevation data, street orientations, speed/travel time, and routing.

596 questions
2
votes
2 answers

module 'osmnx' has no attribute 'graph_from_place'

No matter what attribute I put alongside G = ox.________( ) it returns with an attribute error. Currently the first part of my code is: import osmnx as ox place = ["Grand Rapids, MI"] G = ox.graph_from_place(place, retain_all=True, simplify=True,…
Ambush3
  • 118
  • 1
  • 7
2
votes
0 answers

Railway length with OSMNX

I am a total beginner with OSMNX, and I was wondering if (and how) I could get the length of an electrified railway that connects two specific cities, eg. Hambug and Hannover, in Python. I am looking online, but I feel a little lost. Any…
Natassa
  • 29
  • 1
2
votes
2 answers

How does osmnx know which edges to plot in shortest path

According to the documentation an edge is uniquely defined by three parameters: u, v and k. SO even though u and v can be the same the parameter k differentiates between the edges When I calculate the shortest path between two nodes I use…
DPM
  • 845
  • 7
  • 33
2
votes
0 answers

Use of non-OSM data in OSMnx

I really like the functions of OSMnx, thank you! Nevertheless sometimes OSM-data is limited, especially for human powered modes like walking and cycling. I am working on a project for Zuerich, Switzerland and I am lucky that the city has a full…
jonas_2021
  • 23
  • 3
2
votes
1 answer

Visualize two way streets offset from each other

I am using osmnx package to visualize a street network. I would like to visualize both (two) lanes in opposite directions of a road. I am using this code https://github.com/gboeing/osmnx/issues/162 But I don't know how to add the output point on the…
aba2s
  • 452
  • 2
  • 18
2
votes
2 answers

TypeError: unhashable type: 'LineString' when using ox.simplify_graph()

I have dataset from which I have constructed a NetworkX compatible graph. A shapefile has been converted to dictionaries for nodes and edges, which has then been converted to a GeoDataFrame. From there on, I have used ox.graph_from_gdfs() to create…
Samuel
  • 211
  • 2
  • 10
2
votes
1 answer

The Osmnx python graph_to_gdfs sometimes returns a list in the name column, what's causing this?

I'm using OSmnx to create some nice maps where I color streets based on the name of the street, inspired by puntofisso (eg: if it's a street, it needs to be red, a lane is green, etc). I noticed that sometimes the name of an edge is not a string,…
Sanne Hombroek
  • 105
  • 1
  • 6
2
votes
1 answer

Python - Osmnx - Use cache or local maps to reduce computation time

I have a dataframe composed of different trips, categorised by the type of trip (e.g. by car or by bike). Each line of the dataframe represents a stop of a given trip, including the sequence of the stop in the trip as well as its latitude/longitude…
2
votes
0 answers

OSMNX graph to distance matrix and DBSCAN

I'm having troubles programming to get the distance matrix from a Graph of coordinates (LAT,LON). I want to connect an arbitrarily group of points (let's say, 200.000 firms), get their nearests representations in the Graph, created with…
arioboo
  • 185
  • 1
  • 1
  • 10
2
votes
1 answer

OSMNX - trying to plot graph in console without any luck

I have the following code import pandas as pd import geopandas as gpd from shapely.geometry import Point, LineString import matplotlib.pyplot as plt import networkx as nx import osmnx as ox ox.config(use_cache=True, log_console=True) G =…
nostres
  • 89
  • 1
  • 9
2
votes
1 answer

Unable to install osmnx

I am trying to install osmnx library in linux using pip and I get below error. # pip3 install osmnx Collecting osmnx Using cached osmnx-0.16.1-py2.py3-none-any.whl (87 kB) Requirement already satisfied: pyproj>=2.6 in…
mockash
  • 1,204
  • 5
  • 14
  • 26
2
votes
1 answer

Save and re-load a weighted graph from OSMnx for NetworKX

I am using OSMnx to get a graph and add a new edge attribute (w3) representing a custom weight for each edge. Then I can successfully find 2 different shortest paths between 2 points using NetworkX and 'length', 'w2'. Everything works fine, this is…
Ferrix
  • 59
  • 1
  • 9
2
votes
1 answer

Osmnx and basemap

Is it possible to have osmnx and basemap in the same environment? I've been trying to install it but had no luck. I need to plot some coordinates with basemap that I got from osmnx and connect them with lines. If anyone knows an alternative to…
Zinic
  • 27
  • 6
2
votes
0 answers

Creating new nodes using redistribute_vertices

I am working on a graph flow model in the context of transport networks. I have the position of sensors (lat/lon) and would like to associate these sensors with nodes on a graph retrieved using osmnx. At present, I use get_nearest_node to map a…
Joseph Redfern
  • 939
  • 1
  • 6
  • 13
2
votes
1 answer

OSMnx : how to provide more complex feature into the custom_filter parameter

I would like to pass some overpass request into ox.graph_from_place, but I don't really understand how it works with the doc. I would like to create a graph with 2 types of roads (where the buses can pass and where the psv can pass too) Am'i obliged…