[gdal-dev] Raster image orientation

Frank Warmerdam warmerdam at p...
Tue Sep 24 09:32:09 EDT 2002


Jay Borseth wrote:
> I would assume that the amongst the 30 to 40 file formats handled by 
> GDAL that some store the image data with pixel zero in the bottom-left 
> corner and some store pixel zero at the top-left corner. Do RasterIO() 
> and associated functions which give access to raster image pixels 
> rationalize these differences and always provide top-left pixel zero 
> image to the client? Or do client applications need to flip images 
> vertically for some formats?

Jay,

I can't think of any of the formats with a bottom left pixel origin though
there may be. In any event, GDAL provides a uniform coordinate system for
pixel line coordinates with the top left corner of the image being 0,0.

In some cases, such as GXF, this can result in internally flipping the image
to get the right orientation. In others, like TIFF, the alternate origin flags
are just ignored and your image may appear upside down to what was intended.
This is a difficiency of the driver and should be corrected there if it ever
becomes a significant issues.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at p...
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent






More information about the Gdal-dev mailing list