gboeing / ppde642 Goto Github PK
View Code? Open in Web Editor NEWUSC urban data science course series with Python and Jupyter
Home Page: https://geoffboeing.com
License: MIT License
USC urban data science course series with Python and Jupyter
Home Page: https://geoffboeing.com
License: MIT License
Hi, I freshly installed osmnx 0.15.1 on Linux from conda-forge channel.
I try to run an old code using the technique described in your article (https://geoffboeing.com/2016/10/r-tree-spatial-index-python/)
at this line :
geometry_cut = ox.quadrat_cut_geometry(geometry, quadrat_width=0.1)
I get an error message saying that osmnx doesn't have "quadrat_cut_geometry" attribute
Downgrading to osmnx 0.10 with "conda install -c conda-forge osmnx=0.10" command. I run the same code and everything runs fine!
Therefore I'm just asking if "ox.quadrat_cut_geometry" is not available in newer version of osmnx? If so, what it has been replaced with? And maybe an update of this really usefull article would be needed.
Thanks for your great work!
Hi Geoff,
Thank you so much for you contributions, they have been very valuable! I have the following issue regarding walkabality/accessability analysis. I've managed to download the POI's of Amsterdam that I'm interested in but when trying to get the network from osm, it produces the following error: ' Server at www.overpass-api.de returned status code 400 and no JSON data'
I've tried on multiple locations with different bounding box coordinates however, I can't manage to get it to work. Is there something that I've overlooked?
Kind regards,
Martijn Verhoeven
line geometry_cut = ox.quadrat_cut_geometry(geometry)
throws an error
"quadrat_cut_geometry() missing 1 required positional argument: 'quadrat_width'"
It would probably be a good idea to have an optional parameter there (e.g. max width/10, you know better)
Hi Professor Boeing,
Thank you very much for making this course available to public. When I try to go through the notebooks here, I found that they are referring to a "data" folder that contains some csv files, but I do not see such a folder under the PPD599 directory. I checked some of your other public courses such as PPD534 and PPD430 and saw that the csv files are usually provided in a "data" folder. Could you help add the data folder here, or point to another way of accessing the csv files? Thank you.
The output of the code is a '.js' file. is the extension correct? should it not be json or geojson?
ANyways, using either of the above extensions, the file still does not open in WGIS, saying 'Invalid Data Source: E:/dataset.json is not a valid or recognized data source.'
could you please help me with what could be wrong?
hi Geoff,
I am trying to query the OSM API for the street network specifying this bounding box
bbox = [6.196,-75.575, 6.212, -75.553] and I encounter the following error:
AssertionErrorTraceback (most recent call last)
in ()
----> 1 network = osm.network_from_bbox(bbox[0], bbox[1], bbox[2], bbox[3])
/Users/arianna/anaconda/envs/Access/lib/python2.7/site-packages/pandana-0.2.0-py2.7-macosx-10.5-x86_64.egg/pandana/loaders/osm.py in network_from_bbox(lat_min, lng_min, lat_max, lng_max, network_type, two_way)
320 return Network(
321 nodes['lon'], nodes['lat'],
--> 322 pairs['from_id'], pairs['to_id'], pairs[['distance']])
323
324
/Users/arianna/anaconda/envs/Access/lib/python2.7/site-packages/pandana-0.2.0-py2.7-macosx-10.5-x86_64.egg/pandana/network.py in init(self, node_x, node_y, edge_from, edge_to, edge_weights, twoway)
99 reserve_num_graphs(1)
100
--> 101 assert NUM_NETWORKS < MAX_NUM_NETWORKS, "Adding more networks than "
102 "have been reserved"
103 self.graph_no = NUM_NETWORKS
AssertionError: Adding more networks than have been reserved
Any idea what might be going wrong?
thanks,
Hi Geoff,
First of all I want to thank for sharing your expertise, it's unvaluable.
I'm working with Google Maps API and as backend I'm using Python (Django as my framework). I've used your code to transform my data to GeoJson and then trying to use it with Google Maps Data Layers.
When trying to visualize my GeoJson in Google Maps nothing is being shown and after a silly research I've noticed that I'm using Lat Lng coords such as [-28, 137] (a place somewhere in Australia).....however GeoJson coordinates expect coordinates in another specific system in something like this [123.61, -22.14] which is the same place in Australia.
https://developers.google.com/maps/documentation/javascript/datalayer
Do you know what is the GeoJson system for coordinates?
Is it possible to make such transformations in python?
Thanks in advance.
I've been trying to run /notebooks/urban-data-science/20-Accessibility-Walkability/pandana-accessibility-demo-full.ipynb. The first plot cell [22] is not working. The initial error was due to basemap not being installed. I separately went and installed basemap with conda. Once that was done, I now get a different error and an empty plot box.
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-22-5de67c376af3> in <module>()
2 n = 1
3 bmap, fig, ax = network.plot(all_access[n], bbox=bbox, plot_kwargs=plot_kwargs, fig_kwargs=fig_kwargs,
----> 4 bmap_kwargs=bmap_kwargs, cbar_kwargs=cbar_kwargs)
5 ax.set_axis_bgcolor(bgcolor)
6 ax.set_title('Walking distance (m) to nearest amenity around Berkeley/Oakland', fontsize=15)
/home/shrividya/anaconda2/lib/python2.7/site-packages/pandana/network.pyc in plot(self, data, bbox, plot_type, fig_kwargs, bmap_kwargs, plot_kwargs, cbar_kwargs)
440 bbox[1], bbox[0], bbox[3], bbox[2], ax=ax, **bmap_kwargs)
441 bmap.drawcoastlines()
--> 442 bmap.drawmapboundary()
443
444 x, y = bmap(self.nodes_df.x.values, self.nodes_df.y.values)
/home/shrividya/anaconda2/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.pyc in drawmapboundary(self, color, linewidth, fill_color, zorder, ax)
1621 # if fill_color is string 'none', really don't fill.
1622 if fill_color is None:
-> 1623 fill_color = ax.get_axis_bgcolor()
1624 elif fill_color == 'none' or fill_color == 'None':
1625 fill_color = None
AttributeError: 'AxesSubplot' object has no attribute 'get_axis_bgcolor'
Hey @gboeing can you put a license on these notebooks? I'd love to include them in some example/test notebooks in nteract.
In particular, I want to show how to go straight from geojson to rendered:
nteract PR for direct geoJSON support: nteract/nteract#688
Dear @gboeing , in this notebook (https://github.com/gboeing/urban-data-science/blob/59afcff905649c5f8d1f8256ec37f28496e0c740/20-Accessibility-Walkability/pandana-accessibility-demo-full.ipynb), when i copy the line In [7], occur this:
AttributeError Traceback (most recent call last)
in ()
10
11 # identify nodes that are connected to fewer than some threshold of other nodes within a given distance
---> 12 lcn = network.low_connectivity_nodes(impedance=1000, count=10, imp_name='distance')
13 network.save_hdf5(net_filename, rm_nodes=lcn) #remove low-connectivity nodes and save to h5
14
AttributeError: 'tuple' object has no attribute 'low_connectivity_nodes'
Do you know how I could solve it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.