-
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
Differences in shape using from_geopolygon with odc.geo.GeoBox and datacube.utils.geometry.GeoBox #130
Comments
Difference from #38 released in v0.1.2. Specifically this commit 16714c29 according to git bisect:
|
from odc.geo.math import snap_grid
bbox = geom.to_crs(dst_crs).boundingbox
tol = 0.01
offx, nx = snap_grid(bbox.left, bbox.right, rx, None, tol=tol)
offy, ny = snap_grid(bbox.bottom, bbox.top, ry, None, tol=tol)
(ny, nx), (offx, offy)
tol = 0.01
offx, nx = snap_grid(bbox.left, bbox.right, rx, 0, tol=tol)
offy, ny = snap_grid(bbox.bottom, bbox.top, ry, 0, tol=tol)
(ny, nx), (offx, offy)
from datacube.utils.geometry._base import _align_pix
offx, nx = _align_pix(bbox.left, bbox.right, rx, 0)
offy, ny = _align_pix(bbox.bottom, bbox.top, ry, 0)
(ny, nx), (offx, offy)
|
There are some minor differences between odc-geo GeoBox and datacube.utils GeoBox, yes. 1.9 will use the odc-geo GeoBox internally, but still provide the old datacube.utils class with a deprecation warning. |
I'm not surprised that difference exists. I guess a more important question is which one is "more correct", it's good to have such definition, ideally backed by rigorous tests. |
IMO the way Core's current behaviour is unclear, inconsistent and poorly documented. |
With the datacube 1.9 release coming soon, I wanted to make sure that some minor differences are expected between the behavior of the
GeoBox
classes. This issue will also serve as a reference for others who encounter this.Library versions:
Base setup:
odc.geo
:datacube.utils.geometry
:I am going to dig into the history
The text was updated successfully, but these errors were encountered: