[gdal-dev] TR: Load GDALDataset Into DIB

Ismael BELAAOUAD Ismael.BELAAOUAD at circet.fr
Thu Aug 29 23:00:10 PDT 2013


Hi David,

I've used GetGeoTransform on some files and it seems to be regular thing, Y_height is negative.
Can you tell me how to reverse the order of dataset reading?

Best regards

-----Message d'origine-----
De : David Strip [mailto:gdal at stripfamily.net] 
Envoyé : jeudi 29 août 2013 23:46
À : Ismael BELAAOUAD
Cc : gdal-dev at lists.osgeo.org
Objet : Re: [gdal-dev] TR: Load GDALDataset Into DIB

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