-
Notifications
You must be signed in to change notification settings - Fork 363
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
RDD reproject: GeoAttrsError #3559
Comments
Thanks for reporting! Yes, sounds like a not convenient edge case. |
Thanks, I'm looking into creating a PR myself. |
Thank you! Also I wonder that in some of these edge cases a slim math solution may work 🤔 That's not the first time smth like that arises. |
Indeed, there are in fact options at this level: geotrellis/raster/src/main/scala/geotrellis/raster/reproject/ReprojectRasterExtent.scala Line 63 in 7960ea1
The problem occurs if the new extent width or height is smaller than 0.5 * pixelSize In that case however, there's alternatives to throwing an exception: The solution I'll be testing first is at the level of TileRDDReproject and focuses on the case where a LayoutDefinition is available, I really think we can go for a more robust way of constructing an aligned target extent in that case. |
… case a LayoutDefinition is available locationtech#3559
Describe the bug
Original source: Open-EO/openeo-geopyspark-driver#984
This method call:
geotrellis/spark/src/main/scala/geotrellis/spark/reproject/TileRDDReproject.scala
Line 72 in 7960ea1
Can result in:
geotrellis.raster.GeoAttrsError: invalid cols: 0
in case of very specific inputs:
Stack trace:
To Reproduce
This example shows the full reprojection case and throws the error:
The code below shows inputs to TileRDDReproject and the specific call to ReprojectRasterExtent which subsequently fails:
Note: I'm also looking into a test case at the level of TileRDDReproject...
Expected behavior
While this is clearly an edge case, it seems that it could be solved easily in the case where
targetLayout: Either[LayoutScheme, LayoutDefinition],
is actually a 'LayoutDefinition'.
In that case, the call to ReprojectRasterExtent is not needed at all, and we can compute a target extent that is aligned with the layout definition.
More specifically something like this:
Environment
any
The text was updated successfully, but these errors were encountered: