Open jessjaco opened 6 months ago
That solution (reprojecting to tide data) didn't work because we can get the CRS but there's no way to get the other bounds and we end up with mixed / shifted coordinates. Falling back to option 3 above, specifically:
My only concern with this approach is that I seeing some jagged lines where I know things are being reprojected (PNG). It's either the data itself, or the fact I'm using the nearest transform when reprojection. I'm going to try cubic and see if it makes a difference
Note that this may make tide data in a different crs than mosaics. FOr now I reproject tides_lr when I load, but we should fix this if we ever rerun tides
Aaaand we need to rerun tides, but it's due to the intersecting pathrow fix I think
The approach used in DEA & DE Africa coastlines is to load source landsat data in its "native" projection as much as possible, and when this is not possible (due to different source projections in the same cell) to resample using a smoother (eg cubic convolution).
By default,
odc.stac.load
uses the most common projection in a list of projections (I learned this by asking the authors in a public issue, it's not in the documentation), so it does what we want. The issue is that the most common projection can vary based on what data are available in a given year. So each annual mosaic may have a different projection. Then, when stacking them for coastline generation, things go awry (since xr.concat is not sensitive to projections).Here's are some difficulties in addressing this:
crs="utm"
arg of odc.stac.load doesn't work because the most sensible projection (as determined by odc.stac.load) may not be what landsat uses. This is because landsat always uses utm north projections, never south. This shouldn't cause an issue (the reprojection should work), but it does and I'm not sure why. Basically we end up with empty mosaics. Not worth looking into further at this point sinceodc.stac.load
would need to be changed to fix._current_epsg
, but I don't think even that combated this issue entirely. (It's more complicated now since we changed the grid, among other things). In theory if we went this route, I'd probably save the best crs for each cell as a row in the grid, and then it could be used in the loader. So a minor rewrite, but a rewrite.For now I'm reprojecting in the mosaic processor by using the crs of the tide data (since the tide data is over the whole time series, and should therefore have the overall most common crs set).