-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Geopandas 0.7 uses new object type for CRS #19
Comments
Interesting, thanks for reporting this @blakerosenthal! I'm not very familiar with the codebase, but this is happening inside a function called Looks like the function is used internally, to project a lat-lon bounding box into the UTM zone of its centroid in order to calculate the area and potentially subdivide it into smaller units for the data download query in I'm thinking we have a couple of options here:
Option 2 seems appealing. (a) It's simpler. (b) The computational cost is minimal: we might end up calculating the centroid of a unary union without needing to. (c) It's actually closer to the behavior described in the function's docstring -- which says the input will be projected to the UTM zone of its centroid, without mentioning that gdf's already in a UTM projection will be returned untouched. Thoughts, @sablanchard? And some additional info about the Geopandas change, courtesy of @PyMap: https://jorisvandenbossche.github.io/blog/2020/02/11/geopandas-pyproj-crs/ |
the version of this function in |
in the interest of a speedy fix, I could do a PR that copies over the updated function from with that said, though, this function is super handy and applicable to a lot of workflows (we also use it in both Originally, we were importing it from |
I think that a property on the pyproj CRS class that essentially does |
This all sounds great! Yes, @knaaptime, if you'd be interested in implementing a quick fix to OSMNet, I'll get it merged and released. I just set up a clean I was talking about this offline with @sablanchard, and his inclination is to retain the same behavior as OSMNx and return the GeoDataFrame untouched if it's already in a UTM projection. Let's mention this in the docstring, though. And I gather from OSMNx that one of the rationales for this is that the zone calculation isn't appropriate for polar latitudes. Thanks all! |
This is likely helpful as well: https://geopandas.org/docs/reference/api/geopandas.GeoSeries.estimate_utm_crs.html |
Description of the bug
Geopandas 0.7 changed the CRS type from a
str
to apyproj.CRS
class instance in this commit. This causes the check inosmnet/osmnet/load.py
Line 488 in ec2dc95
Environment
Python version: 3.8
OSMnet version: 0.1.5
Paste the code that reproduces the issue here:
Paste the error message (if applicable):
The text was updated successfully, but these errors were encountered: