I've got a non-projected TIF with 440 GCPs (a Sentinel-1 image) that crosses the antimeridian. Normally I just call gdalwarp with -t_srs (in this case 'epsg:3031' Antarctic Polar Stereographic), however for this image it creates a very large file that is mostly zero, apart from a distorted patch of data at the bottom that is split in half. Using --config CENTER_LONG 180 stops the split but not the large, mostly empty image with distorted data patch. I'm guessing that gdalwarp is having trouble with GCPs that exist on both sides of the +/- 180 degree line but not sure how to fix it, has anyone else run into this (and fixed it??).
1 Answer
Figured out a solution, unsure if it's the best approach but it turns out that first transforming the embedded GCPs to Polar Stereographic THEN using gdalwarp to project the image seems to work fine. A python script to do this can be found here: https://github.com/manaakiwhenua/mwlr-geo-utils/blob/main/bin/mw-gcptransform.py
--config CENTER_LONG 180
fixed it for me, thanks for that lead. The gdal docs are without explanation for that config gdal.org/user/configoptions.html