[gdal-dev] GetGeoTransform returning different values
Even Rouault
even.rouault at spatialys.com
Fri Sep 5 10:51:57 PDT 2025
> Sorry for the bother again - I noticed that when I use gdalinfo to query a document (in this case, a GeoPDF) the geotransform coordinates are slightly different than when I can GetGeoTransform using the API on the same document with GDALOpen + GDALGetGeoTransform.
Presumably due to a difference in number of significant digits displayed
in both cases.
> But I also noticed the WKS seems to be different in the two as well. Is there a configuration or something else I might be missing that would cause these to be off?
gdalinfo uses WKT_2:2019, and GetProjectionRef() uses WKT1. You can use
GetSpatialRef()->exportToWKT(apszOptions) with apsOptions = {
"FORMAT=WKT2_2019", nulptr } to get the same result
--
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20250905/0bc4f50a/attachment.htm>
More information about the gdal-dev
mailing list