Skip to content
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

transform_to_crs(crs) unable to handle polygons with z dimension (3D polygons) #173

Open
LaurenSchenk1 opened this issue Jul 26, 2024 · 1 comment

Comments

@LaurenSchenk1
Copy link

Hi! I tried running a polygon with the WIT notebook and the error message "TypeError: CRS.transformer_to_crs..result() takes 2 positional arguments but 3 were given" appeared.

I removed the "Z"/elevation values/dimension from the shapefile and it seems to work. However, this required me opening the shapefile in ArcGIS and manually removing them.

After speaking with Ariana, it seems transform_to_crs(crs) in both odc.geo.geometry and datacube.utils.geometry cannot handle having 3 values even though shapely can handle the optional Z values.

If it's not possible for this function to handle the 3 values, can the error message be updated to make it clearer that it's the 3 dimensions (presence of "Z" coordinates) which is causing the issue.

Hopefully this makes sense.

@SpacemanPaul
Copy link
Contributor

SpacemanPaul commented Jul 28, 2024

Shapely knows nothing about CRS's and doesn't handle coordinate transforms, so it's about what PyProj can support rather than Shapely. However, PyProj DOES support 3D coordinate transforms, so this should be doable, although I'm not sure how major the required changes would be. (digging into the source code a bit, pretty major. the 2D assumption goes pretty deep)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants