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

Coloring edges in OSMnx graph based on edge attribute

I want to create a map of the roads within a country, and color the edges based on their "highway" attribute, so that motorways are yellow, trunk green, etc... However, when following the osmnx example files and attempting to replicate, i receive…
Samuel
  • 211
  • 2
  • 10
3
votes
1 answer

How to get the number of roundabouts in a given city/ area in OSMnx?

I am still trying to figure out OSM and OSMnx. I want to count how many roundabouts are there in Paris for example. The problem is that many roundabouts are stored as ways, but in pieces. So, if I count all the tags where junction=roundabout, I will…
ctrl_z
  • 268
  • 1
  • 15
3
votes
1 answer

How to 'zoom' to a specific area in an osmnx plot

I have a osmnx plot that has two routes, but the map is quite vast therefore I cannot see the routes properly. Is there a fast way to limit my plot, to sort of 'zoom in', using for example bbox? I know I could search for districts instead of a whole…
DPM
  • 845
  • 7
  • 33
3
votes
2 answers

OSMnx: Is there a way to find an accurate shortest path between 2 coordinates?

I want to ask if there is a way to find the accurate shortest path between 2 coordinates. The 2 coordinates are (-33.889606, 151.283306), (-33.889927, 151.280497) as shown in the picture. The black path is the ideal path, and the red one uses…
李祐齊
  • 57
  • 1
  • 5
3
votes
2 answers

How to fill water bodies with OSMnx in Python

I currently use OSMnx for a project to draw road networks in an area. I'd now like to add water bodies so that we can clearly see which parts of an area are water and land. So far, I've been able to identify waterbodies using the custom_filter…
Michael Toth
  • 75
  • 10
3
votes
1 answer

Shortest route when converted to LineString misses the path in OSMNX

I'm trying to save the route to the disk which i plotted using OSMNX. The route generated follows the road path but, when i try to convert the path to LineString which I can easily save to disk, the route is changed in a manner where it doesn't…
3
votes
1 answer

How to import multiple infrastructure type in osmnx?

Is there any way to specify multiple subcategories for an infrastructure type while importing roads using osmnx. From this question I understand that we can select only freeways by specifying infrastructure='way["highway"~"motorway"]'. How can we…
PPR
  • 395
  • 1
  • 5
  • 17
3
votes
1 answer

Accelerate a loop in Python

I am running a loop that computes a networkx.classes.multidigraph.MultiDiGraph for each row (neighbourhood) of a list of GeoDataFrames (cities). It then computes some statistics for each row and writes the file out to disk. The problem is that the…
Ben Mann
  • 173
  • 4
  • 11
3
votes
1 answer

Use OSMnx to evaluate the travel time depending on the OSM highway=* key: maxspeed. Possible?

I'm working me throu the impressiv OSMnx jupyter notebook of gboenig, I'm a MA Architecture Student from Germany and would like to use some Code to bring some fundametal Arguments to my MasterThesis, so I tried a lot and I'm very happy with the…
Paul Pink
  • 31
  • 2
3
votes
2 answers

OSMnx: Shortest path for a set of origins and destinations

Suppose I have a point shapefile with origins and destinations. 1) How can I use nx.shortest_path to calculate for each origin and its destination? 2) How can save the corresponding route as a shapefile? I've checked Save a route and conserve its…
Mohammad
  • 47
  • 1
  • 5
3
votes
0 answers

how to select a subgraph from an omsnx graph?

I have extracted the road network from Haiti using osmnx impor omsmnx as ox place = ox.gdf_from_place('Haiti', which_result=2) coords = place.geometry.total_bounds G = ox.graph_from_bbox(coords[3], coords[1], coords[2], coords[0]) that's the…
emax
  • 6,965
  • 19
  • 74
  • 141
3
votes
1 answer

Calculating shortest paths from points that originates mid-edge

I have a set of origin-destination coordinates that I want to calculate the shortest paths between them. My origin-destination coordinates are sometimes located in the middle of a long straight-line road. However, the shortest path calculated by…
ShizukuF
  • 31
  • 3
3
votes
1 answer

subdividing edges based on a maximum length

Is there any way in osmnx or networkx to subdivide/resample/split street edges based on a maximum length? I'm doing shortest path routing based on addresses, but my maps often don't have enough node resolution to put a node close enough to each…
3
votes
1 answer

GeoPandas and OSMnx- plotting on map

I want to plot my Geopandas df on a map. as a background i want a (road) map of the area. loving the OSMnx package, i'm trying to figure out how to use it's output (shapefile? network?) as my plot background import osmnx as ox G=…
batch
  • 31
  • 1
  • 3
3
votes
1 answer

OSMnx - Euclidean Buffers Around Point

A relative novice here so help will be much appreciated. I'm going through the process of classifying station areas internationally using the connectivity metrics in OSMnx. I need to get the street networks within 400m euclidean buffers from each…
1 2
3
39 40