Chris,
ReadAsArray() returns a NumPy array, and the first dimension in NumPy is
the slowest varying one, that is y.
GDAL's geotransform is
Xgeoref = gt[0] + column * gt[1] + line * gt[2]
Ygeoref = gt[3] + column * gt[4] + line * gt[5]
and GDAL's Raster API have their arguments with column f
Hi Chris
I am not an expert in python. But I had similar problems in other
environments.
At https://gdal.org/api/python/osgeo.gdal.html you can see that in many
functions the numpy array returned is always in the form "array[y][x]".
Looks like the shape in stored as "row,cols", not as "x,y".
Chee
Hi
I am using the Python GDAL API and looking at a simple TIFF image with a test
program:
from osgeo import gdal
dataset = gdal.Open('test-gdal.tif')
transform=dataset.GetGeoTransform()
nx=dataset.RasterXSize
ny=dataset.RasterYSize
data=dataset.ReadAsArray()
print(f"Raster xsize, ysize ({nx},{ny