Giter Site home page Giter Site logo

gboeing / ppde642 Goto Github PK

View Code? Open in Web Editor NEW
1.3K 122.0 483.0 499 KB

USC urban data science course series with Python and Jupyter

Home Page: https://geoffboeing.com

License: MIT License

TeX 0.22% Shell 0.58% Jupyter Notebook 98.41% Python 0.02% Dockerfile 0.53% Batchfile 0.24%
usc urban-data-science course-materials data-science urban-planning urban-analytics urban-informatics city-government syllabus jupyter

ppde642's People

Contributors

dependabot[bot] avatar gboeing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ppde642's Issues

ox.quadrat_cut_geometry not available anymore?

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!

osm network from bounding box error: 'Server at www.overpass-api.de returned status code 400 and no JSON data'

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

Parameter missing

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)

Are we missing a "data" folder here?

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.

Geojson file not opening in QGIS

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?

AssertionError: Adding more networks than have been reserved

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,

Transformation between coordinate systems

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.

Basemap plotting

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'

License?

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:

screen shot 2016-09-06 at 11 04 22 am

nteract PR for direct geoJSON support: nteract/nteract#688

Attribute Error

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.