Is there a way to tell GDAL to list the full set of projection parameters
in a GeoTiff? As much as I like the idea that you should just need the EPSG
code, I've run across too many software packages that either don't know the
code or have an incorrect interpretation of the code. I've tried supplying
the WKT (from projinfo) as the -a_srs argument, but that still only puts
the EPSG code in the georeferencing keys.

I did find that if I strip the authority code from the WKT, it will put all
the parameters in and perhaps that's the best solution. It seems a shame to
lose the authority code though.

Here's a few bash commands to illustrate.

wkt=`projinfo -o WKT2:2019 EPSG:6570 --single-line | sed 1d`

gdal_create -of GTiff -ot UInt16 -burn 0 -outsize 50 50 -a_srs "$wkt"
wkt.tif

gdal_create -of GTiff -ot UInt16 -burn 0 -outsize 50 50 -a_srs EPSG:6570
epsg.tif

#strip the authority code
wkt_noauth=`echo $wkt | perl -p -e 's/],ID\["EPSG",6570]/]/;'`

gdal_create -of GTiff -ot UInt16 -burn 0 -outsize 50 50 -a_srs
"$wkt_noauth" wkt_noauth.tif

Thanks for any suggestions.

Kirk Waters, PhD
NOAA Office for Coastal Management
Applied Sciences Program
coast.noaa.gov/digitalcoast
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to