Questions tagged [osmnx]

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

Filter by
Sorted by
Tagged with
1 vote
0 answers
36 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", &...
user avatar
  • 111
1 vote
1 answer
236 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 ...
user avatar
1 vote
1 answer
166 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 ...
user avatar
  • 21
2 votes
1 answer
216 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... ...
user avatar
0 votes
0 answers
18 views

How to generate shapely.geomtery.polygon from GTFS feed

I want to generate a graph using osmnx.graph.graph_from_polygon method. It requires a shapely.geometry.polygon as an input. Using GTFS Feed, is it possible to generate the polygon. I am aware, it can ...
user avatar
1 vote
0 answers
53 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 ...
user avatar
  • 195
0 votes
0 answers
22 views

gdal.RasterizeLayer works with one set of TIFFs but not with another where I use a gdf created with osmnx

I have the following functions I'm using. Warning: They are fairly large (actually just one of the TIFFs is). Could it be a size issue? import time import numpy as np import os import rasterio import ...
user avatar
  • 195
0 votes
0 answers
211 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.,...
user avatar
0 votes
0 answers
69 views

How to save geometries and graph together from osmnx?

I've been able to work out how to get all the geometries and shapes I want together with the nodes with osmnx. Now I have two objects, a graph (MultiDiGraph) and an objects geopandas dataframe with ...
user avatar
  • 195
1 vote
0 answers
213 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 ...
user avatar
1 vote
0 answers
310 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 ...
user avatar
1 vote
1 answer
220 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 ...
user avatar
  • 21
0 votes
0 answers
137 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, ...
user avatar
0 votes
0 answers
199 views

HTTPSConnectionPool(host='overpass-api.de', port=443): "Read timed out" on a demanding job (OSMnx)

I am trying to fetch POI (amenities more specifically) of OpenStreetMAp data for every edge of a city street network by using geometries.geometries_from_point function of OSMnx package. I guess, ...
user avatar
  • 3
0 votes
1 answer
341 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 ...
user avatar
0 votes
1 answer
211 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 ...
user avatar
1 vote
0 answers
59 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)...
user avatar
1 vote
0 answers
112 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 ...
user avatar
2 votes
1 answer
144 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 ...
user avatar
  • 195
1 vote
1 answer
533 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 ...
user avatar
  • 413
0 votes
1 answer
518 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, ...
user avatar
2 votes
1 answer
180 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 ...
user avatar
  • 195
3 votes
1 answer
891 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 ...
user avatar
  • 173
1 vote
1 answer
349 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', ...
user avatar
0 votes
1 answer
238 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 ...
user avatar
2 votes
1 answer
460 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)) ...
user avatar
3 votes
1 answer
1k 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 ...
user avatar
  • 6,698
0 votes
0 answers
54 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 ...
user avatar
2 votes
1 answer
405 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 ...
user avatar
3 votes
0 answers
295 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'...
user avatar
1 vote
0 answers
314 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 ...
user avatar
2 votes
0 answers
94 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....
user avatar
  • 6,698
2 votes
1 answer
467 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 ...
user avatar
  • 437
2 votes
0 answers
253 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 ...
user avatar
2 votes
0 answers
256 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 ...
user avatar
1 vote
0 answers
1k 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 ...
user avatar
  • 6,698