osmnx

Clipping a networkx graph according to georeferenced polygon

孤人 提交于 2020-07-23 06:50:25
问题 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 loop is extremely long to compute because the graph is computed for each row. The way I want to quicken the loop is by computing the graph for the whole GeoDataFrame and then clipping the graph into each row (each row has a polygon). You can do this

How to fill water bodies with OSMnx in Python

♀尐吖头ヾ 提交于 2020-06-29 04:08:11
问题 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 argument to OSMnx's graph functions. I can then outline the waterbodies using the plot_graph function. Ideally, I'd want to fill the waterbodies in (rather than only outline them). I feel like this should be possible, as in OpenStreetMap water bodies

OSMnx wont open in Juypter Notebook

徘徊边缘 提交于 2020-06-29 03:39:13
问题 I downloaded osmnx via conda using the code: conda config --prepend channels conda-forge conda create -n ox --strict-channel-priority osmnx This comes from the osmnx documentation: https://osmnx.readthedocs.io/en/stable/ I can see the module has downloaded because in the Anaconda Prompt I can type conda activate ox and it works. However when I go into my jupyter notebook and type import osmnx as ox I get the following error: ​ ------------------------------------------------------------------

OSMnx - tags missing in graph edges

天大地大妈咪最大 提交于 2020-06-16 04:35:10
问题 I'm trying to detect all the streets in a city were bikes can ride. To do this I want to include the footways that include the tag "bicycle":"yes" , but I can't find it in the data downloaded with OSMnx. For example the edge with id 45031879 as an xml downloaded directly from openstreetmap website appears like this: <way id="45031879" visible="true" version="4" changeset="64616340" timestamp="2018-11-18T10:34:12Z" user="livmilan" uid="712033"> <nd ref="571102337"/> ... <nd ref="1587102704"/>

OSMnx - tags missing in graph edges

早过忘川 提交于 2020-06-16 04:34:18
问题 I'm trying to detect all the streets in a city were bikes can ride. To do this I want to include the footways that include the tag "bicycle":"yes" , but I can't find it in the data downloaded with OSMnx. For example the edge with id 45031879 as an xml downloaded directly from openstreetmap website appears like this: <way id="45031879" visible="true" version="4" changeset="64616340" timestamp="2018-11-18T10:34:12Z" user="livmilan" uid="712033"> <nd ref="571102337"/> ... <nd ref="1587102704"/>

OSMNX - visualizing waterway together with footprints and ground

偶尔善良 提交于 2020-06-16 04:00:39
问题 I am trying to plot waterway together with ground (street network/map) and footprints (buildings). My problem is that the waterways are large closed polygon areas , which means instead of plotting a nice blue river with correct thickness it plots the river all over half of the figure (and there's no water there IRL...). This is what I have in Jupyter-Lab so far (example coordinates with few roads for quick test): %matplotlib inline import matplotlib.pyplot as plt import osmnx as ox ox.config

How to import multiple infrastructure type in osmnx?

混江龙づ霸主 提交于 2020-06-01 05:54:46
问题 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 expand this to include multiple categories such as highways = motorway or primary or secondary or highway is not footway I tried the following without success: infrastructure='way["highway"~"motorway"],way["highway"~"primary"]' infrastructure='way[

Installing OSMnx with Anaconda

做~自己de王妃 提交于 2020-03-25 03:36:06
问题 I am trying to install the osmnx package in Python 3 on my computer, following the steps outlined here https://geoffboeing.com/2017/02/python-getting-started/. The steps are: Download miniconda, with the path C:\Anaconda . I am unable to do this as I am using university computers. However, Anaconda is already installed on those computers, with the path C:\Program Files \Anaconda3 . Within the Anaconda Prompt, I tried conda update -n base conda . However, this does not go through because I do

Extract constrained polygon using OSMnx

自闭症网瘾萝莉.ら 提交于 2020-03-22 09:48:26
问题 I'm playing around with OSMnx package in order to solve the following task: - there is a point X on the map defined by latitude and longitude - we need to detect a polygon that contains that point X and is constrained by the neighboring roads - so basically the point X is inside the polygon and the neighboring roads will be borders of that polygon. So far I've managed only to plot the visualization of the graph on the map and find the closest edge/node to point X. In the attached image I've

.plot() command does not display anything

会有一股神秘感。 提交于 2020-02-25 04:15:52
问题 I have this code based on this question, just a different point Extract constrained polygon using OSMnx I am trying to plot the block in which the point is located but it does nothing, it just prints "Done" but I cannot see any image import osmnx as ox import geopandas as gpd import shapely point = (50.090464, 14.400070) streets_graph = ox.graph_from_point(point, distance=500, network_type='drive') streets_graph = ox.project_graph(streets_graph) streets = ox.save_load.graph_to_gdfs(streets