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
I'm running the below code to load an xarray, and if I don't transpose lat/lon, then the array is flipped along a diagonal axis.
Am I doing something wrong to cause the data to be flipped?
Steps to Reproduce
importeeimportxarrayasxrimportodc.geo.xr# noqa: F401# Authenticate and initialize# ee.Authenticate()ee.Initialize(opt_url="https://earthengine-highvolume.googleapis.com")
dataset="ACA/reef_habitat/v2_0"ic=ee.ImageCollection(ee.Image(dataset))
# Region of interest. Eventually, we need to do all of -180 to 180 and -32 to 32left=142.0bottom=-10.0right=144.0top=-8.0# Close to full resolutionres=0.00005transform= [res, 0, left, 0, -res, top]
ds=xr.open_dataset(
ic,
engine='ee',
geometry=[left, bottom, right, top],
projection=ee.Projection(
crs="epsg:4326", transform=transform
),
chunks={"time": 1, "lon": 10000, "lat": 10000},
).squeeze().drop_vars("time")
# Load into memory and clean upreef_mask=ds.reef_mask.astype("uint8").compute()
reef_mask=reef_mask.transpose("lat", "lon") # Why is it transposed?!reef_mask.odc.nodata=0reef_mask.odc.write_cog("test.tif", overwrite=True)
Current Behavior
Data is flipped
Expected Behavior
Data comes out in the right orientation
Relevant log output
Xee Version
0.0.20
Contact Details
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Hey Alex! Thanks for bringing this up. It's currently working as initially intended (x / lon, y / lat), but we're planning to introduce a breaking change to (y / lat, x / lon) to be more compatible with plotting for the majority of geospatial libraries and software.
You can see and add to the discussion at #196. Our plan is to release a new version that includes #225 and the transposed coordinates. This work is not scheduled until ~mid H2 this year.
Bug Summary
I'm running the below code to load an xarray, and if I don't transpose lat/lon, then the array is flipped along a diagonal axis.
Am I doing something wrong to cause the data to be flipped?
Steps to Reproduce
Current Behavior
Data is flipped
Expected Behavior
Data comes out in the right orientation
Relevant log output
Xee Version
0.0.20
Contact Details
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: