Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Hopefully someone can help.

I'm trying to find out what the formula would be to convert the X, Y of an image to the Easting and Northing coordinates.

I've downloaded some of the raster maps from OS UK web site and I'm looking at adding the miniscale tif file to one of my applications. I've been given a number of coordinates in the easting northing format and I need to convert this to an x y of the image so I can place a label or image on top of the mini scale tif file.

I've been searching online quite a bit but everything seems to point towards applications like ArcGIS and other GIS software. However I'd quite like to make this a simple project, so I'd like to avoid embedding 3rd party sources within the application.

Does any body have any good starter guides or examples on this, or what the forumla would be to work out the x y from the easting and northing I have?

Thanks in advance.

share|improve this question
    
Ordinance Survey data is already in a projected coordinate system. ordnancesurvey.co.uk/oswebsite/freefun/geofacts/geo1192.html Are you wanting to project this data to another coordinate system? –  Rayner Oct 7 '12 at 18:15
1  
Hello, Thanks for getting back to me. Taking the Ordinance Survey Mini Scale tif for example this image is 7000 x 13000. Edinburgh is Easting 324995 (X) and Northing (Y) 674112. Now is I was to move the mouse over the x y of the image Edinburgh would be 3254, 6266. How do I get this x y pixel to compare the the 6 digit easting northing? –  Strikeforce Oct 7 '12 at 21:31
    
What gis system are you using? This will dictate which tools you will use to set the coordinate system. –  Hornbydd Oct 8 '12 at 7:35

1 Answer 1

up vote 3 down vote accepted

GIS file formats contain georeferencing information. This ties image pixel coordinates to grid references in a projection system, in this case British National Grid.

There are lots of ways this information can be stored depending on image format. A basic tool to get you started is gdalinfo which will query the extents of the image in British National Grid.

You can also look for an accompanying world file. The wikipedia page contains details for converting from pixel to projected coordinates.

Based on you example of Edinburgh at pixel coordinates x=3270 and y=6264 gives the following:

A = 100
D = 0
B = 0
E = -100
C = 50
F = 1299950

Northing

    F+(E*y)
    1299950+(-100*6264)=673550

Easting

    C+(A*x)  
    50+(100*3270)=327050
share|improve this answer
    
Thanks for your advice. I'm just using the free data provided by Ordnance Survey OpenData. At the moment i'm looking at the MiniScale tif file, I'm wanting to take the Easting and Northing data I've been given and plot this out on a the tif. I know its not quite as simple as just taking the easting and northing and converting this into the pixels of the image. As to start with the top left of the image would be 0,0 yet the grid would be 7000,13000. So i'm looking for a guide or formula that would convert the easting / northing to the pixel of the image. –  Strikeforce Oct 8 '12 at 8:10
    
Right I've got a bit further but my Northing calculation is wrong: If I take Edinbourgh for example on the MiniScale image the x,y would be 3270, 6264. I'm then using the Worldfile data of: A: 100 B: 0 C: 0 D: -100 E: 50 F: 1299950 X = A * 3270 which is Edinburgh on the miniscale + B * 6264 which is Edinburgh on the miniscale + C This gives me X 327000 which seems correct I then do this calculation for Y: Y = D* 3270 which is Edinburgh on the miniscale + B * 6264 which is Edinburgh on the miniscale + F This givesme Y 1286150 which is not correct. Any ideas? –  Strikeforce Oct 8 '12 at 11:06
    
I have added an example to my answer using Edinburgh. –  Matthew Snape Oct 8 '12 at 17:33
    
That's perfect! thank you. –  Strikeforce Oct 8 '12 at 19:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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