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
3
votes
1 answer

OSMnx: Specify place in "gdf_from_place" better

I am using OSMnx in Python to get the geometries of states (e.g. for Austria). However, OSMnx sometimes chooses the wrong OSM-object as place. Can I specify the OSM-object using its ID? Example: I get the names of the states in Austria using…
Pierre J
  • 33
  • 1
  • 6
2
votes
1 answer

OSMNX find nearest nodes within 1km euclidean distance of a co-ordinate point

I have an osmnx graph G and some co-ordinate points P. Now I want to find all the nodes which are within 1km Euclidean distance of at least one co-ordinate point of P. My code is as follows: import osmnx as ox G =…
Sihan Tawsik
  • 423
  • 3
  • 13
2
votes
1 answer

Add node between existing edge in Networkx Graph generated by OSMnx

I have gotten sensor location data from Highway England. I want to add these sensor locations to OSM multidigraph. How to do that? import numpy as np import pandas as pd import networkx as nx from shapely.geometry import Point, Polygon,…
Aaditya Bhardwaj
  • 362
  • 2
  • 14
2
votes
1 answer

Coordinates of City Centers from OpenStreetMap via OSMnx?

Is it possible to query OpenStreetMap via the Python library OSMnx to retrieve the (lat,long) coordinates for a city? The documentation seems to suggest attribute data should be accessible but I've not yet seen a pathway to retrieving the…
Chris
  • 3,109
  • 7
  • 29
  • 39
2
votes
1 answer

python osmnx geocode_to_gdf Nominatim not working while web-based openstreetmaps does

I am trying to geocode a list of objects (mostly road names) to their coordinates from python wth osmnx.geocode_to_gdf. The problem is that I often get returned with the following error message (example of query "Jln Kuang, Singapore"): ValueError:…
mccoy89
  • 21
  • 6
2
votes
3 answers

How to rearrange a list of tuples (start node ID, end node ID) to create continuous path in Python?

I have a list of tuples with the start and end node ID of a segment. I want to rearrange the tuples (segments) in a way that constructs a continuous path. There can be a loop in the path i.e., one node can be traversed multiple times. I do know the…
amitrm
  • 21
  • 2
2
votes
2 answers

Osmnx error: module 'osmnx.elevation' has no attribute 'add_node_elevations_raster'

I am trying to get elevations from a raster file and add to the road network. I am getting module 'osmnx.elevation' has no attribute 'add_node_elevations_raster' error. Following this…
2
votes
1 answer

Find nearest road and distance to it for a point

I have a list of thousands coordinates (lat, long). I want to find nearest road and distance to it for each point. I tried to use OSMNX: loaded all roads from osmnx and calculate distance from each point to each road (code is below). But it takes a…
Dmitry
  • 35
  • 4
2
votes
1 answer

OSMNX - what "part" of an edge is considered the nearest

I am using the nearest_edges function in OSMNX. It isn't clear to me what "part" of the edge is used when making this calculation. Is it any part of the edge? Is it the midway point? For long edges in the network it would make quite a big…
c_m_conlan
  • 189
  • 2
  • 11
2
votes
1 answer

Extremely long response time with graph_from_place OSMNX

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…
2
votes
1 answer

How to simply compute the travel time from one point to an other? (Without a plot)

I spent a lot of time reading and testing the example notebooks of OSMnx but I couldn't figure out a way to simply calculate the travel time from a given point (GPS coordonates) to an other one. I would like to estimate, for each point from my list,…
Trag0
  • 25
  • 1
  • 6
2
votes
1 answer

OSMNX does not return graph for all European capitals

I am confused by the fact that some European capitals do not return a graph when queried with osmnx. It works perfectly for Lisbon, Berlin, Paris, etc., but when I try to run it with Brussels or Athens, I get a NetworkXPointlessConcept: Connectivity…
N8_Coder
  • 713
  • 3
  • 10
  • 20
2
votes
0 answers

How to plot osmnx geometries on top of graph?

I started playing with the osmnx Python package and have to questions: Is the following minimal working example the correct way to plot additional geometries on top of my graph G or are there better ways? As you can see on the resulting plot below…
N8_Coder
  • 713
  • 3
  • 10
  • 20
2
votes
1 answer

How to create a NetworkX graph from a Geographic Markup Language file?

I wish to create a road network graph in NetworkX/OSMnx from the Ordinance Surveys' (OS') Open Roads dataset which I have downloaded as a Geographic Markup Language (GML) file. After an embarrassingly long time, and thanks to this answer, I realised…
2
votes
1 answer

Selecting buildings from multiple locations in osmnx python

I am new to python as well as in osmnx package. Lets say I have two locations, islands: Nauro and Lakeba Island. What I want to achieve is to have a one dataframe (or geodataframe) which will include buildings from both islands. I have this code but…