Tiff output coordinate system problem
When I run gdalinfo
over a tiff that comes out of the shakemaps_from_quakeml
workflow the coordinate system as a little problem:
Driver: GTiff/GeoTIFF
Files: PGA.tiff
Size is 2107, 1740
Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Origin = (89.594909899532766,27.287898476052039)
Pixel Size = (0.008333333333333,0.008333333333333)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=DEFLATE
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 89.5949099, 27.2878985) ( 89d35'41.68"E, 27d17'16.43"N)
Lower Left ( 89.5949099, 41.7878985) ( 89d35'41.68"E, 41d47'16.43"N)
Upper Right ( 107.1532432, 27.2878985) (107d 9'11.68"E, 27d17'16.43"N)
Lower Right ( 107.1532432, 41.7878985) (107d 9'11.68"E, 41d47'16.43"N)
Center ( 98.3740766, 34.5378985) ( 98d22'26.68"E, 34d32'16.43"N)
Band 1 Block=2107x1 Type=Float64, ColorInterp=Gray
The corner coordinates upper and lower values are reversed.
It is possible to fix those with
gdalwarp PGA.tiff PGA_fixed.tiff -of GTiff -s_srs '+proj=latlong' -t_srs 'epsg:4326' -overwrite
but it would be way better if we could give back a tiff with the right corner coordinates.
The actual spatial projection of the single pixels to points on the globe is not effected by this issue - it seems that just the ordering of the values is different then expected by gdal.
One of the reasons to fix it, is to allow the usage of the tiffs in gmt grdimage. Non fixed versions can result in an error when allocating memory.