I realise there are similar questions but I could not find the exact same.
Here is what I am trying to do:
gdalwarp -t_srs '+proj=stere +lat_0=YY +lon_0=XX +k=1 +x_0=0 +y_0=0 +a=1737400 +b=1737400 +units=m +no_defs' 1.tif 2.tif
Where YY in the problem case is 25 and XX -178 (Yes I realise now that +a=1737400 +b=1737400 could just be +R=1737400. It makes no difference)
This seems to work fine everywhere except where 1.tif contains the antimeridian.
I have found suggestions about +over and +lon_wrap=180 and --config CENTER_LONG 180 on other threads that I tried. I also tried different projections just to see if that was the issue, among other things.
Finally, I tried simply running gdalwarp 1.tif 2.tif.
In all cases the result was the same, namely a tif with no valid data.
ERROR 1: 2.tif, band 1: Failed to compute statistics, no valid pixels found in sampling.
NoData Value=0
Metadata:
STATISTICS_VALID_PERCENT=0
Gdalinfo for 1.tif gives (among other things):
Driver: GTiff/GeoTIFF
...
Size is 12288, 12288
Coordinate System is:
PROJCRS["SIMPLE_CYLINDRICAL MOON",
BASEGEOGCRS["GCS_MOON",
DATUM["D_MOON",
ELLIPSOID["MOON",1737400,0,
LENGTHUNIT["metre",1,
ID["EPSG",9001]]]],
PRIMEM["Reference_Meridian",0,
ANGLEUNIT["degree",0.0174532925199433,
ID["EPSG",9122]]]],
CONVERSION["Equidistant Cylindrical",
METHOD["Equidistant Cylindrical",
ID["EPSG",1028]],
PARAMETER["Latitude of 1st standard parallel",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8823]],
PARAMETER["Longitude of natural origin",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["False easting",0,
LENGTHUNIT["metre",1],
ID["EPSG",8806]],
PARAMETER["False northing",0,
LENGTHUNIT["metre",1],
ID["EPSG",8807]]],
CS[Cartesian,2],
AXIS["easting",east,
ORDER[1],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]],
AXIS["northing",north,
ORDER[2],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]]]
Data axis to CRS axis mapping: 1,2
PROJ.4 string is:
'+proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +R=1737400 +units=m +no_defs'
Origin = (5458199.374783761799335,2092314.880853968206793)
Pixel Size = (7.403161724669900,-7.403161724669900)
...
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 5458199.375, 2092314.881) (179d59'59.56"E, 69d 0' 0.44"N)
Lower Left ( 5458199.375, 2001344.830) (179d59'59.56"E, 66d 0' 0.44"N)
Upper Right ( 5549169.426, 2092314.881) (177d 0' 0.44"W, 69d 0' 0.44"N)
Lower Right ( 5549169.426, 2001344.830) (177d 0' 0.44"W, 66d 0' 0.44"N)
Center ( 5503684.400, 2046829.855) (178d30' 0.44"W, 67d30' 0.44"N)
Band 1 Block=12288x1 Type=Byte, ColorInterp=Gray
Minimum=1.000, Maximum=205.000, Mean=29.882, StdDev=17.628
NoData Value=0
Metadata:
STATISTICS_MAXIMUM=205
STATISTICS_MEAN=29.882287511606
STATISTICS_MINIMUM=1
STATISTICS_STDDEV=17.628075699679
STATISTICS_VALID_PERCENT=40.5
My conclusion is that gdalwarp cannot even read the file correctly. Can you help?
gdal_infosay about your input tiff – Ian Turton Feb 16 '22 at 08:32