Talk:World file

Latest comment: 1 year ago by 295rpathak in topic East / North units

Could someone post an example of how from the world file values one can find the insertion coordinates, scale and rotation values of an image inserted into AutoCAD? This info is great but I still do not understand how to translate the values. Thanks.

D and B

edit

How do the D and B parameters work. From examination of the equations it seems like they should be defined as a rotation about a third axis (z) that is orthogonal to x and y. These would then rotate the picture away from pointing due north. From the description it sounds like the D and B terms are supposed to compensate for things like the camera not being parallel to the ground when the image is taken (stretching of the pixels size). Is the definition of these terms as given by this site incorrect, or am I misinterpreting something? —Preceding unsigned comment added by 216.36.143.197 (talk) 21:42, 18 May 2009 (UTC)Reply

B and D are used to build a ratio with A and E. If B ≠ D, then the image is skewed. So if you have a square image where A and E are 1000 and 1000, and you want to rotate it 45° CCW, then the rotation terms will both be 1000. I'll try to sketch out the math a bit more and put it on the front page when I have time. +mt 16:12, 19 May 2009 (UTC)Reply
If you look at the affine transformation shown at the page, I'd say that A=scaleX*cos(a), B=sin(a), D=-sin(a) and E=scaleY*cos(a) if a is rotation clockwise. This is based on applying 2D rotation and scaling matrices shown on http://en.wikipedia.org/wiki/Transformation_matrix#Examples_in_2D_graphics. Unit for scaleX and scaleY would be coordinate unit/pixel. So if the mathematical definition is correct (which has be checked), then in my opinion the first definition of A, B, D and E is not accurate. I'd like to separate the UTM case from generic definition more clearly too. Jaakko.tuosa (talk) 11:48, 17 June 2009 (UTC)Reply
The article page indicates how to get the scale factor (pixel width and height) by using the Pythagorean identity. The angle of rotation is similarly easy to determine. One way is to divide D by A and take the arctangent. Note that you will need to observe the sign of the components to get the correct angle (quadrant). The C library offers atan2() to compute the angle correctly. The rotation is always about the coordinate at ( C, F ). Only when one has no means to use the transformation matrix directly, should the scale and angle of rotation be used. The transformation matrix is easier to use correctly.
Note that Jaako's formulas are incorrect, all four components, A, B, D and E are multiplied by the appropriate scale factor (in the x-direction for the first two components, the y-direction for the latter two). El545 (talk) 02:14, 31 December 2010 (UTC)Reply

Is the example provided upside down?

edit

Since the map of the Falkner Islands is not available in the examples, I couldn't know it for sure, but according to the explanation of the parameters, it seems to me that the map is "upside down", i.e. north at the bottom of the picture. Is that so?

Renanmzmendes (talk) 13:25, 30 July 2010 (UTC)renanmzmendesReply

I don't think so. The map image is not upside-down, but the coordinate system of easting and northing is. That's why as you increase your 'y' on the image (i.e. go down), you decrease the Northing, (i.e. go south). RyanCu (talk) 04:04, 14 February 2012 (UTC)Reply

Isn't this a bit over the top?

edit

I went through one interpretation of the file format (based on the ESRI FAQ, it seemed), followed by another one which corrected the first, flawed one, and examples with graphics trying to give a picture of the meaning of the different parameters ... then it turned out it was the usual 2-D affine transformation with the six usual parameters, just listed one by one in the file.

I think the bulk of the maths in the article could be removed, and just the formula and the example be left. (Maybe the special case of no rotation should still be descrubed, and a formula for the inverse could be added.) JöG (talk) 22:18, 16 August 2010 (UTC)Reply

Agreed. Presenting the wrong interpretation first, followed by the right one, is unnecessarily confusing. —Steve Summit (talk) 11:25, 25 June 2015 (UTC)Reply

Nomenclature (A, D, B, E, C, F)

edit

Is there any reason the lines in the file are referred to as A, D, B, E, C, F? Any reason not to call them A, B, C, D, E, F, in that order, instead? (Yes, I realize this would require rearranging every equation and figure in the article, but I'm thinking of doing just that.) —Steve Summit (talk) 11:29, 25 June 2015 (UTC)Reply

There are two conventions used in parallel: line numbers and letters. The line numbers are in order for the world file and the letters are in order for the affine transformation matrix. They happen to be transposed. If the letters were rearranged to the same as the line numbers, the lettering convention would be redundant, and the order of the coefficients in the affine transformation matrix would look out of order. +mt 21:34, 25 June 2015 (UTC)Reply
I was thinking it wouldn't be so bad to show the matrix as
 
But you're right, it would make the rest of the equations pretty goofy-looking, so I withdraw the question. —Steve Summit (talk) 12:55, 26 June 2015 (UTC)Reply

East / North units

edit

It says Units are always meters per pixel. This statement can be misunderstood as the scale (measured in meters per pixel) changes slightly throughout the east/north space and is only approximately 1 meter per pixel. This is particularly evident in Mercator projection, but still the same (to a lesser extent) for UTM. Using this fixed ratio of 1 meter per pixel as basis for a computation will get values that are slightly wrong. --Cebus (talk) 11:56, 15 February 2017 (UTC)Reply

Please provide a title for your discussion topic. If you click "Add topic", your topic will be added without a title. 295rpathak (talk) 12:59, 10 September 2023 (UTC)Reply