Skip to main content

Questions tagged [osmnx]

a Python package that lets you download geospatial data from OpenStreetMap.

Filter by
Sorted by
Tagged with
0 votes
0 answers
12 views

No border connections in OSM data

I used OSMNX to download States in Germany as well as surrounding States from other countries to do mobility-analyses. These States get merged back together in my GDB. However at borders (no matter if ...
RavenS's user avatar
  • 11
0 votes
1 answer
53 views

Timeout error when using features_from_place

I'm trying to execute the following to get all buildings within Manhattan in Python on Google Colab tags = { 'building': True } # Geocode the location to get its geometries ft = ox.geocode_to_gdf(...
Ibrahim's user avatar
  • 13
1 vote
1 answer
163 views

Bus lines/routes from OpenStreetMap using OSMnx

I am trying to obtain bus lines/routes from OpenStreetMap using OSMnx. For example busline 284 in Nootdorp, Netherlands: https://www.openstreetmap.org/relation/2024408#map=15/52.0463/4.3967&layers=...
laurens k's user avatar
0 votes
0 answers
33 views

Streets/roads without any walk-related tags in OSMnx walk network

I downloaded an OSM walk network model from OSMnx: Walk= ox.graph_from_place('Levanger, Norway', network_type='walk') There are several instance where streets have no walk-related tag. See screenshot ...
SPet's user avatar
  • 141
0 votes
0 answers
71 views

OSMnx custom filtering

I'm trying to filter an OSMnx query with a custom filter which excludes all highway=service except segments where service=bus. I copied the network type 'walk' from the overpass and tried to implement ...
napop's user avatar
  • 1
0 votes
0 answers
92 views

QGIS Plugin - How to import external libraries

I'm developing a plugin for QGIS that uses external libraries such as OSMnx, Shapely, and Scikit-learn. In particular, the last one is an optional dependency of OSMnx. At first I created a lib folder ...
Gianmarco's user avatar
1 vote
1 answer
160 views

City Suburbs Polygon using OSMNX

I am trying to do something similar to the question OSMNX - City Suburbs Polygons. The city of Panama, in the Republic of Panama, is composed of corregimientos (like a borough). I am trying to get the ...
Irving Bennett's user avatar
0 votes
0 answers
325 views

Configure OSM Data for ArcGIS Pro Network Analysis

I want to create a Network Dataset in ArcGIS Pro using OSM data downloaded and prepared using osmnx and python. My code is quite crude, but works so far. However, I am now transitioning to using it ...
RavenS's user avatar
  • 11
0 votes
1 answer
441 views

OSMnx custom_filter - get all types of roads

I need to get all existing OSM types of roads from the area, and I'm searching for a simple way of doing this rather than specifying each type with "|" I've tried to write something like ...
Georgy's user avatar
  • 1
0 votes
1 answer
447 views

TypeError("Must pass list-like as `names`."), Network generated via osm, geopandas, momepy. Objective: Run short path analysis via osmnx

I am trying to solve short path analysis via osmnx.distance.k_shortest_paths(G, orig, dest, k, weight='length') I have used this approach as I am limited in the SSL/memory, that is why I am not using ...
T.A's user avatar
  • 1
0 votes
0 answers
144 views

OSMNX: How do I create a graph that has a union custom query?

My goal is to determine a long distance driving route from A to B, and then within a half mile radius of that driving route, determine: The road network Gas stations Hotels I am almost there: I ...
Kevin P.'s user avatar
  • 101
1 vote
1 answer
490 views

Osmnx.plot_graph_folium() not working; folium is not recognized

I'm trying to display a osmnx map like: graph_map = ox.plot_graph_folium(coordinates, popup_attribute ="name", edge_width=2) but I get an error: Cell In[40], line 1 ----> 1 graph_map = ...
simonericmoon's user avatar
2 votes
1 answer
431 views

Extracting relations with osmnx?

I am using osmnx package https://osmnx.readthedocs.io/en/stable/osmnx.html to extract data from OSM. I aim to obtain relations from the cyclist node network in Flanders. After some info about tagging, ...
ajchavez94's user avatar
1 vote
1 answer
264 views

Issues with graph generated by momepy from GeoPandas Data Frame

I'm trying to create a graph from a GeoPandas Data Frame, but am having an issue where some roads are being excluded, and others are not joined up correctly. As well as that, I'm getting these large ...
George Willcox's user avatar
0 votes
2 answers
2k views

How to calculate the length and duration of trip for a GeoDataFrame of points on OpenStreetMap using OSMnX package?

I have a GeoDataFrame of GPS points and I want to calculate the length and duration of trip from each point to all other points. My input GeoDataFrame looks like this: id Longitude Latitude ...
milad's user avatar
  • 729
0 votes
1 answer
2k views

Create a GeoDataFrame with all the countries in the world with osmnx, efficiently

I'm trying to create a GeoDataFrame with the names and geometries of all 195 countries in the world. My attempt was to create a rectangle covering the entire world, and then query it with osmnx. ...
SeF's user avatar
  • 121
2 votes
0 answers
1k views

Color osmnx map by place (using graph_from_place() method)

Let's say we want to graph the two below villages, which are in the UK. We also want to colour the streets by length. We can do: # Get data import osmnx as ox place = ["Broughton Hackett", &...
johnjohn's user avatar
  • 121
2 votes
1 answer
5k views

Convert a list of coordinates to an OSM path using Python

I have GPS coordinates recorded from vehicles for an itinerary and I need the get the path on osm so I can extract features like highways. I tried to use ox.get_nearest_node method for each point in ...
Ziad Fellah-Idrissi's user avatar
2 votes
1 answer
1k views

Point projection in GeoPandas for OSMnx graph

I am struggling with a crs conversion in GeoPandas. Basically I just want to calculate the distance between a point and an edge of my OSMnx graph. The coordinates of the point are retrieved from the ...
eagle's user avatar
  • 31
3 votes
1 answer
3k views

Creating a geodataframe from a list of LineStrings or routes

I have created a separate LineString for each origin-destination couples of subdivisions and I did it manually cause when I use a for loop it creates a dataframe with 1 LineString from all lines... ...
Kareem Alaraby's user avatar
1 vote
0 answers
230 views

Using Rasterio to create mask from osmnx graph edges creates black .tif

I am using rasterio to create a mask of some .tif with an edge graph that I created with osmnx. I'm assuming that there is something I have to do to the graph to make it work correctly as it works ...
Oliver's user avatar
  • 195
0 votes
0 answers
996 views

Adding a new point to a graph in NetworkX

I am working with some points between which I need to find the shortest paths along a graph in NetworkX. I'm trying to take a point that is currently not on the graph and connect it to the graph, i.e.,...
Borillar0821's user avatar
1 vote
0 answers
843 views

Folium map not updating when adding Tooltip attribute in PyQt GUI

I am trying to create a geospatial Python GUI app using PyQT5, Geopandas, OSMnX, and Folium. I am converting the app into an .EXE file using pyinstaller. The app looks something like this: I am using ...
Magnum Python 93''s user avatar
1 vote
0 answers
904 views

Pyinstaller .EXE AttributeError: partially initialized module 'fiona' has no attribute '_loading' (most likely due to a circular import)

I am trying to create a geospatial Python GUI app using PyQT5, Geopandas, OSMnX, and Folium. I am converting the app into an .EXE file using pyinstaller. Previously, I was successfully able to create ...
Magnum Python 93''s user avatar
1 vote
1 answer
2k views

How to make necessary changes to Geodataframe to export as geopackage or shapefile

I am trying to export a geodatabase I created via the OMSNX package. () When I attempt to convert the file from a geodatabase to shapefile I get an error "ValueError: Invalid field type <class ...
cadejs's user avatar
  • 61
0 votes
0 answers
593 views

Shortest-path algorithms used in Networkx: what about points not near nodes?

I am new to Networkx, but am I right that Dijkstra's is the algorithm Networkx uses by default? From what I understand, Dijkstra's algorithm traces a shortest path between two nodes on a graph. What, ...
Borillar0821's user avatar
0 votes
1 answer
4k views

Syntax for retrieving the coordinates of point features using GeoPandas

I have two point shapefiles (with just one point each, let's call them 'Origin' and 'Destination'). I need to find the shortest path between them over a street network extracted using OSMnx from ...
Borillar0821's user avatar
0 votes
1 answer
1k views

Seeing which node has given node ID in osmnx [closed]

I have been reading the documentation on OSMnx and I am trying to use the command osmnx.shortest_path(G, orig, dest, weight = "length") on a graph of a city. I know which nodes I want to ...
Lucas Silva's user avatar
1 vote
0 answers
136 views

Issue with creating sub graphs from Los Angeles County graph

I am trying to extract a subgraph using networkx ego_graph function from Los Angeles County graph. When i plot this graph and compare it with graph generated from graph_from_point (which looks correct)...
Rahul Agnihotri's user avatar
1 vote
0 answers
295 views

Loading intersections consolidated graphs

To get the right connected components, I projected a graph then use osmnx.simplification.consolidate_intersections to consolidate intersections. import osmnx as ox import pandas as pd import networkx ...
Peter Fu2's user avatar
2 votes
1 answer
740 views

Parallel offset on Folium

Is there any way to add parallel offset for those lines which oneway road are False? All line here are straight (segment). So We just have two points for each line (start and end points). # There is ...
aba2s's user avatar
  • 191
1 vote
1 answer
2k views

Downloading buildings data from OSM with a polygon (shapefile) as the bounding box

I am struggling to complete this task. I am trying OSMnx which can be used to download data from OSM above however I am getting an error when using its from_polygon feature when trying to download ...
hbk's user avatar
  • 434
0 votes
1 answer
2k views

OSMNX - City Suburbs Polygons

I'd like to extract, given a city name, all suburbs and relative polygon geometries. For instance: https://nominatim.articque.com/details.php?place_id=230259366 So, I run the code: place = 'Torino, ...
GiuseppeBrenk's user avatar
2 votes
1 answer
606 views

Showing two roads lane of one road

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 ...
aba2s's user avatar
  • 191
3 votes
1 answer
3k views

osmnx.get_nearest_edge(s) behaves randomly

I'm struggling with a rather odd problem with the python package OSMNx. I have lots of GPS points in a pandas dataframe that were originally in EPSG 4326, but I've already projected them onto EPSG ...
Ben's user avatar
  • 193
2 votes
1 answer
975 views

Convert Linestrings from OSMnx into Multipolygon

I'm retrieving some geometries from OpenStreetMap with OSMnx library with the following code: G = ox.graph_from_place('Casco Viejo, Bilbao, Spain', network_type='walk', ...
Rodrigo Vargas's user avatar
0 votes
1 answer
1k views

Is there a way to see the type of tags/features pulled in an OSMnx multigraph?

I'm new to OSMnx / Overpass queries. I'm trying to pull data on rail networks in global cities. I'm using the script in Python below to pull rail data in London, for example. There are a number of ...
Daniel Thomas's user avatar
2 votes
1 answer
1k views

Query to Calculating Rail Length Using Overpass API / OSMnx Python

I'm new to overpass queries. I'm trying to write a python script to pull data on the length of rail in major global cities. I am having a problem in the length of track (using osmnx.basic_stats(G)) ...
Daniel Thomas's user avatar
4 votes
1 answer
3k views

Cannot get OSM tags when downloading data with osmnx functions which are based on Nominatim requests

Context I am trying to download some footway graph from OpenStreetMap (OSM) using osmnx. Here is a piece of code: import os, sys import pandas as pd import geopandas as gpd import matplotlib.cm as cm ...
swiss_knight's user avatar
  • 10.4k
0 votes
0 answers
177 views

How to retrieve oneway taxiways from Overpas API?

I have was able to make a query to http://overpass-turbo.eu/ where I request the taxiways of a specific airport like this: [out:xml]/*fixed by auto repair*/[timeout:25]; // fetch area “airport” to ...
Federico Gentile's user avatar
2 votes
1 answer
768 views

How to save overpy query to .osm?

I am using overpy to collect data information about taxiways, taxilanes and parking positions of an airport (icao code LOWW). I was able to achieve my goal I wrote the following lines of code: import ...
Federico Gentile's user avatar
3 votes
0 answers
529 views

Polygon projection fail with osmnx [closed]

I download a graph and plotted an accessability polygon on the projected graph according to tutorial G = ox.project_graph(G) # Then I wanted to project my accessibilty polygon g1 back to 'epsg:3857'...
James Flash's user avatar
1 vote
0 answers
622 views

OSMNx Extracting blocks from point and save coordinates of corners of each block

I am playing with OSMNx and I would like to extract street blocks, I have this code which should display the blocks import osmnx as ox import geopandas as gpd import shapely from shapely.geometry ...
Mechatrnk's user avatar
2 votes
0 answers
205 views

OSMNX KeyError when trying to compute edge_centrality on a graph composition

Context: I am trying to merge several different graphs (some sharing nodes with others) downloaded from openstreetmap using omsmx. While storing these different graphs in a list, I use the nx....
swiss_knight's user avatar
  • 10.4k
2 votes
1 answer
1k views

Writing osmnx queried footprints to shapefile

I'm attempting to pull a set of building footprints from open street map using a shapefile boundary. I have success getting the buildings into a geodataframe, but when I attempt to write them out to ...
jport's user avatar
  • 437
2 votes
0 answers
366 views

Street traffic flow (from Azure Map GeoJSON) to OpenStreetMap street network (graph)

The Ultimate Goal: I am trying to find the shortest and least traffic path between two points for a given pair of latitudes and longitudes on the map. This is rather standard in most of the maps, but ...
TwinPenguins's user avatar
2 votes
0 answers
386 views

Save polygon on map

It is probably a noob question but I'm still a beginner with maps and these libraries. I used OSMnx, NetworkX and GeoPandas the draw a map with two polygons on it. Each polygon have the begin with ...
Roy Ancri's user avatar
2 votes
0 answers
2k views

Getting pedestrian network with osmnx

Context I would like to extract into a network (i.e. a graph with a topology that can be used for routing), all pathways that can be 'legally' walked by pedestrians in an geographical area. I am ...
swiss_knight's user avatar
  • 10.4k