[gdal-dev] TR: Load GDALDataset Into DIB

David Strip gdal at stripfamily.net
Thu Aug 29 14:46:01 PDT 2013


If this is pretty much a one-time thing, just reverse the order in which
you read the dataset.
If this is going to be a regular thing for different kinds of data
sources, you need to read the y-pixel height in the dataset. You do this
using GetGeoTransform. The Y_height is the last element of the array. If
this is negative, the band reads in the reverse order as does a windows
DIB. (ie, the first row is the top row). If the value is positive, it's
the same arrangement as the DIB. In general, the pixels can be
non-square, which creates a problem reading it straight into a DIB.




More information about the gdal-dev mailing list