1

I am trying to reverse the georeferencing formula for a TIFF using the world file information. Formula found at http://webhelp.esri.com/arcims/9.3/General/topics/author_world_files.htm

The raster is a UK Ordnance Survey OS Terrain 50 extract (50m resolution)

Conversion on the X coord is fine, but the y coord goes wrong putting me in a raster one cell to the north of the one it should be.

The referencing formula for y coord is:

y1 = Dx + Ey + F

Where: y1 = calculated y-coordinate of the pixel on the map x = column number of a pixel in the image y = row number of a pixel in the image D = rotation terms on the Y Axis F = translation terms; x,y map coordinates of the center of the upper-left pixel E = negative of y-scale; dimension of a pixel in map units in y direction

The D value is 0 (no rotation) in these files so I am left with:

y1 = Ey + F

To reverse this to find y form a known y1 coord I get

y = (y1-F)/E

I can't see what is wrong the above, and similar version works fine for the X coords.

Does anyone know if there is something missing from the original formula / georeferencing process or see what is going wrong?

2
  • did you remember to count from 0? in the top left corner?
    – Ian Turton
    Nov 3, 2021 at 14:13
  • Thanks Ian. The top left coord comes from the world file, but yes it does count downwards. In the world file the y resolution is always a negative value to facilitate this. I can do a shift to fudge it down, as if it isn't counting one row. Doesn't explain why the transformation does work for y coord yet it works fine for the x coord.
    – user31054
    Nov 4, 2021 at 16:49

2 Answers 2

0

I do not see what is wrong with a simple example with your formulas

y1 = Ey + F
y = (y1-F)/E

E=-2
y=100 
F=1000 

y1 = -2*100 + 1000 = 800

Reverse with y1 gives the original y

y = (800-1000)/-2 = 100
1
  • Thanks user31084. I agree it should work, and is fine on the X coord. May be as Ian suggest it fails to count one row, but not obvious why. Will have to test some more for the reason.
    – user31054
    Nov 4, 2021 at 16:52
0

I think I have it. There was the same error on the X axis as well, but was not apparent in the data I was using. This is what I think is the issue. The reversed transformation assumes that the origin coords are the top left corner. They aren't, it is the centre of the top left cell. As I was using a 50m resolution raster, this led to a 25m error shift in the x and y axis. This may still get you the correct result if the transformed coord is in the same cell, but it might not be and certainly the position was wrong.

The answer was to adjust the equation to allow for this. So:

y = (y1-F)/E becomes y = (y1-(F-(E/2)))/E

The same had to be done for the X coord transformation. A test of points along a diagonal line got all the values correct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.