World Files - Defining Image Rotation

Fawcett, David David.Fawcett at STATE.MN.US
Thu Dec 27 09:50:08 EST 2007


Wow Guillaume, thank you for the great source.  This is exactly what I was looking for.  Thanks to Ed and the others for providing info as well.  

As Ed said, I have square images that I need to rotate to the 'north-up' orientation.  For example, the plane was flying to the south west and the camera orientation is fixed to the airplane.  I have image centers and a scale, so I am calculating an original image upper-left corner.  I am then using coordinate geometry to calculate where the upper-left corner will be when the image is rotated.  That gives me lines 5 & 6.  I plan to then use the info from the source that you provided to calculate the other lines of the world file.  

Most of the users will be viewing the images in a proprietary desktop GIS that supports rotation via world files.  

Thanks, 

David.




-----Original Message-----
From: UMN MapServer Users List on behalf of Guillaume Sueur
Sent: Wed 12/26/2007 9:56 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] World Files - Defining Image Rotation
 
Hi,

After some test, I confirm the right way to write tfw files for rotated
images is the one described here :
http://www.omg.unb.ca/~jonnyb/processing/geotiff_tifw_format.html
which I can sum up with :

first line of tfw file : pixel resolution * cos(rotation angle in radians)
2nd line : -pixel resolution * sin(rotation angle)
3rd line : -pixel resolution * sin(rotation angle)
4th line : -pixel resolution * cos(rotation angle)
5th and 6th lines still x and y of top left corner.

Hope that helps,

Happy holidays to all mapserver-users lists readers



Guillaume Sueur a écrit :
> Hi,
> 
> It doesn't help so much on the precise point of rotation parameters.
> I've had the same problem few days ago, and despite many tests I didn't
> manage to get a proper rotated image. I fixed that with a "solid"
> rotation, set into the image file. But I'm also interested by that approach.
> 
> What are the units of rotation parameters ? I think it's radians, but
> maybe directly cos and sin of angle in radian which would be more
> adequate tu use in the six parameters transformation...
> 
> Is it counter-clockwise (i.e. trigonometric) direction ?
> 
> is the first one x or y rotation term ? The ESRI support page
> (http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=17489)
> is useless.
> 
> the best info I've found are here :
> http://www.omg.unb.ca/~jonnyb/processing/geotiff_tifw_format.html
> 
> but I haven't tried yet.
> 
> Guillaume
> 

-- 
Guillaume SUEUR
Expert SIG et OpenSource
NEOGEO
46 RUE MATABIAU
31000 TOULOUSE
06 65 58 88 82
Site web : http://www.neogeo-online.net



More information about the mapserver-users mailing list