[gdal-dev] Corner Coordinates for GeoTIFF/GeoPDF
Barry DeZonia
bdezonia at gmail.com
Thu Sep 4 11:54:02 PDT 2025
Maybe out of left field but is one implementation working in double
and the other one working in float?
On Thu, Sep 4, 2025 at 1:50 PM Cory Foy via gdal-dev
<gdal-dev at lists.osgeo.org> wrote:
>
> > I apologize. I'm not familiar with the GetExtent() function. So this is just a guess and feel free to ignore it. Given that GetExtent() reports 2 coordinates, it seems to describe an axis aligned bounding. GeoTransform() provides information to describe an oriented bounding box. Could this perhaps be the source of disagreement between the two routines?
>
> Thanks David. I realize now what’s going on is GetExtent and GetGeoTransform are returning different values than the command line gdalinfo is.
>
> For example, running gdalinfo on my PDF shows:
>
> GeoTransform =
> -8800981.741226587, 1.534954250051887, 0.7153177546590841
> 4288851.899958452, 0.7158702972076904, -1.534439284842128
>
> Corner Coordinates:
> Upper Left (-8800981.741, 4288851.900) ( 79d 3'38.03"W, 35d54'51.91"N)
> Lower Left (-8800543.967, 4287912.823) ( 79d 3'23.87"W, 35d54'27.31"N)
> Upper Right (-8799766.057, 4289418.869) ( 79d 2'58.72"W, 35d55' 6.76"N)
> Lower Right (-8799328.283, 4288479.792) ( 79d 2'44.56"W, 35d54'42.16"N)
> Center (-8800155.012, 4288665.846) ( 79d 3'11.30"W, 35d54'47.03”N)
>
> But calling it from my compiled version in the app on the same file gives me:
>
> GeoTransform =
> -8800981.488120455, 1.5351602235290571, 0.7144694099544626,
> 4288852.103036083, 0.7156171000026056, -1.5347947295515767
>
> And an extent of [-8800981.488120455, -8799328.385944527, 4287912.808661598, 4289418.871779285]
>
> All of which is _close_ but obviously not the same. Gdalinfo is the correct representation, so I’m not sure why I’m getting the data I’m getting from my compiled version. They’re both from 3.11. But that explains why I was so confused.
>
> Thanks for at least giving it a look and guess - going to have to figure out why these are getting different values.
>
> Cory_______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
More information about the gdal-dev
mailing list