[gdal-dev] full projection parameters in geotiff
Kirk Waters - NOAA Federal
kirk.waters at noaa.gov
Fri Dec 20 05:45:25 PST 2024
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20241220/aca186c4/attachment.htm>
More information about the gdal-dev
mailing list