[gdal-dev] question to <GeoTransform> in Virtual Format file

Frank Warmerdam warmerdam at pobox.com
Mon Mar 15 07:12:36 EDT 2010


Andreas Joisten wrote:
> Hi All,
> 
> In a simple case I use a vrt file to create a GeoTiff file and that works
> fine.
> 
> Now I have the problem, that the input tif file is not quite right.  The
> Image must be fliped horizontal to have the right position.
> 
> How can I use the geoTransform array to execute this operation?

Andreas,

You cannot exactly horizontaly flip an image with the geotransform though
you can use to indicate that the first pixel on a scanline is the
eastmost, and the last is the west most.  This is normally accomplished
by ensuring that the x origin (geotransform[0]) is the easting of the east
edge of the image and having a negative x pixel size (geotransform[1])
indicating that the easting value decrements as you move along the scanline.

A few applications that are determined to show the image in a normal map
orientation will use the geotransform to flip the image.  Some others
won't but will at least show correct georeferenced locations when you
point at the pixels based on the geotransform.  Some apps may just get
confused.

If you get the image properly georeferenced and run it through gdalwarp
you will get an image with a normal orientation.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
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