You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Noting that the large value coords like 262143.xxx should be something like 0.xxx.
The main issue is transforming from Web Mercator to UTM and back to to Web Mercator, which results in ambiguity, and therefore, coordinates that are one on side or the other of the antimeridian.
The text was updated successfully, but these errors were encountered:
This is the more explicit code illustrating the issue:
transformer_to=Transformer.from_crs(src.crs, dst.crs, always_xy=True)
t_to_wgs=Transformer.from_crs(src.crs, "EPSG:4326", always_xy=True)
# xy_pix_src is in pixel space of sourcexx, yy=np.asarray([pt.xyforptinxy_pix_src]).T# Convert to world coordinatesxx, yy=src.pix2wld(xx, yy)
# Transform to destination crs, which results in some coords that are on the wrong# side of the antimeridianxx_p, yy_p=transformer_to.transform(xx, yy)
# print(f"This should be negative {xx_p[0]}")# Uncommenting this fixes the whole thing, but it's not the right way to do it# for i, n in enumerate(xx_p):# if n > 0:# xx_p[i] = n * -1# Convert back to pixel space of destinationxx, yy=dst.wld2pix(*(xx_p, yy_p))
xys_new= [xy_(x, y) forx, yinzip(xx, yy)]
# Coords are borkedxys_new
The issue is documented in detail in opendatacube/odc-stac#172
The short reproduction of the cause of the issue is this code:
which results in:
Noting that the large value coords like
262143.xxx
should be something like0.xxx
.The main issue is transforming from Web Mercator to UTM and back to to Web Mercator, which results in ambiguity, and therefore, coordinates that are one on side or the other of the antimeridian.
The text was updated successfully, but these errors were encountered: