Open jessjaco opened 1 year ago
After exhaustive testing, it appears using odc.stac.load
with anchor=odc.geo.geobox.AnchorEnum.CENTER
or anchor=odc.geo.geobox.AnchorEnum.FLOATING
is the only thing that preserves the grid on write using odc.geo.xr.write_cog
or rio.to_raster
. rioxarray.open_rasterio
also works. It appears that stackstac does not load the data correctly, using xy_coords="top_center"
or xy_coords="center"
. The latter is the closest, but appears to shift data by a full cell.
We also need to check out clipping
Here's a complication. If the anchor option is not set to center as described above things appear to always be resampled, even if the resolution and projection etc. are the same. So basically other coastline datasets were never using the raw data, as far as I can tell, it was always smoothed.
I noticed that
odc.stac.load
andstackstac.stack
seem to have coords which differ by 15 meters (on a 30-m resolution). I found the xy_coords parameter tostackstac.stack
which needs further investigation. Basically you can either load x y coordinates as top left or center of each pixel.