gboeing / ppde642

USC urban data science course series with Python and Jupyter
https://geoffboeing.com
MIT License
1.26k stars 487 forks source link

ox.quadrat_cut_geometry not available anymore? #9

Closed eccc-Antoine closed 4 years ago

eccc-Antoine commented 4 years ago

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!

gboeing commented 4 years ago

Thanks for the heads-up. Yes it is still available as an internal function. See https://github.com/gboeing/osmnx/issues/526 for details of how to access it now. See also its documentation in the OSMnx internals reference. I'll update that old blog post so it works with recent OSMnx releases.

eccc-Antoine commented 4 years ago

Thanks!