[Gdal-dev] Geotransform (Rotate Image 270 degrees)

Lucena, Ivan ivan.lucena at pmldnet.com
Thu Apr 24 09:44:28 EDT 2008


Frank,

I totally agree with you that SetGeoTransform() does not rotate but for 
your a user point of view it gives the impression that it does because 
when they open the changed image on a rotation-sensible viewer it shows 
it as if it was rotated. Same thing think if you translate or warp it, no?

Best regards,

Ivan


Frank Warmerdam wrote:
> simonm1234 wrote:
>> Hi,
>>
>> How do you rotate an image 270 degrees using SetGeoTransform?
>> What values should I use for  adfGeoTransform[2] and adfGeoTransform[4]?
>>
>> Thanks,
>> Simon.
>>
>> // Set Bounds/Pixel size: {}
>> //adfGeoTransform[0] /* top left x */
>> //adfGeoTransform[1] /* w-e pixel resolution */
>> //adfGeoTransform[2] /* rotation, 0 if image is "north up" */
>> //adfGeoTransform[3] /* top left y */
>> //adfGeoTransform[4] /* rotation, 0 if image is "north up" */
>> //adfGeoTransform[5] /* n-s pixel resolution */
>>
>> double[] trans = new double[] {325000.0, 10, 0.0, 1010000.0, 0.0, -10}
>> ds.SetGeoTransform(trans);
> 
> Simon,
> 
> First, lets be clear, SetGeoTransform() does not rotate anything.  It
> just records a transformation between pixel/line and georef space.  You
> can set a geotransform that describes an image that is "west-up" as
> opposed to the normal "north-up".
> 
> An image with the first (top left pixel not accounting for georeferencing)
> actually appearing at the bottom left (west up) might look like:
> 
>  { 325000, 0, -10.0, 1010000, 10.0, 0.0 }
> 
> This basically means that each step along a scanline is a step 10m north,
> and each step down an image column is a 10m step east.
> 
> Best regards,


More information about the gdal-dev mailing list