rgdal-dev / gdal_todo

A place to record wishlist items for GDAL facilities
0 stars 0 forks source link

gdal warp and snap #7

Open mdsumner opened 1 year ago

mdsumner commented 1 year ago

extend -tap to work with -ts,-te and not require -tr

I think in the t_srs case it's kind of pointless, because you have an implied resolution from -te/-ts and then you would only align the -te to that (I guess that's ok).

https://github.com/OSGeo/gdal/pull/7073#issuecomment-1386206357

we want this to avoid having to do raster logic outside, so any -te when not changing the crs will do what the RasterIO lib does (snaps to native)

mdsumner commented 1 year ago

Notes

      if (psOptions->bTargetAlignedPixels ||
            (psOptions->bCropToCutline &&
             psOptions->aosWarpOptions.FetchBool("CUTLINE_ALL_TOUCHED", false)))
        {
            psOptions->dfMinX = floor(psOptions->dfMinX / psOptions->dfXRes) *
                                psOptions->dfXRes;
            psOptions->dfMaxX =
                ceil(psOptions->dfMaxX / psOptions->dfXRes) * psOptions->dfXRes;
            psOptions->dfMinY = floor(psOptions->dfMinY / psOptions->dfYRes) *
                                psOptions->dfYRes;
            psOptions->dfMaxY =
                ceil(psOptions->dfMaxY / psOptions->dfYRes) * psOptions->dfYRes;
        }
mdsumner commented 1 year ago

earlier notes

https://gist.github.com/mdsumner/5d7b156611a6fa267dfe368ea6e2a385

mdsumner commented 1 year ago

draft here: https://github.com/mdsumner/gdal/blob/warp-tap-with-ts/apps/gdalwarp_lib.cpp

mdsumner commented 1 year ago

related work on the python side 🤔

https://github.com/rasterio/rasterio/issues/1931