Hello all you GIS experts!
This question has been asked serveral times: How can I convert Lat/Long data to X/Y or Left/Top values?
All answers (all but one) started with "first you need to find out the Lat/Long values corresponding to your 0,0 point of your image". That's my problem: I have the Lat/Long values of three points spread over the map. I DO NOT have the Lat/Long of the top/left or top/right or buttom/left or buttom/right pixel.
Then I found 2 postings of Mr. imarshad, outlining how to calculate the Lat/Long of Pixel 0,0 from 3 different points with known Lat/Long:
> Here is a brief extract of the first question (the short one):
To georeference Images(in BMP , TIFF and JPG) you need to know at least three points......
First step is to note the X,Y of the three points for which you have Lat/Long information. This can easily be done by using
any Image Package(Photoshop, Paint etc.).
Now take the point with the Least Longitude and name it as point 1 having (x1,y1) and (long1,lat1) .
Take the point having the Max. Longitude and name it point 2 (x2,y2) and (long2,lat2)
and the point having Min. Latitude as point3 (x3,y3) and (long3,lat3)
similarly Max. Latitude as (x4,y4) and (long4,Lat4)
Now your delx ( deg./Pixel in X direction) will be
Now the only thing left is to calculate the Lat/Long of any reference point. So we take the Top Left point as the Refernce point........
It will be calculated using
lat0= Lat4+y4 * delY
long0= Long1 -x1 * delX
I did the calcs 3 times now. The values I get, which are supposed to represent the Lat/Long of the 0,0 point on my map-image (lat0 and long0), look weired - or rather completely wrong.
I have a city map of a town in Germany. It is based on a Map & Guide map, so it should be pretty accurate. Its dimensions are 2544 x 4176 pixel.
Here is the geo-/pixel-info of the 3 points that I have:
Lat1=50.983069° (50°58'59.050'' N)
Long1=11.321775° (11°19'18.390'' E)
Lat2=50.971017° (50°58'15.666'' N)
Long2=11.318177° (11°19'5.436'' E)
Lat3=50.973977° (50°58'26.316'' N)
Long3=11.342885° (11°20'34.386'' E)
This was my calc:
delX = (long2 - long1) / (x2 - x1)
delY = (lat4 - lat3) / (y3 - y4)
delX = (11.342885 - 11.318177) / (1813 - 247) = 0.024708 / 1566 = 1.577778 ( <- WRONG?)
delY = (50.983069 - 50.971017) / (1522 - 329) = 0.012052 / 1193 = 1.010226 ( <- WRONG?)
I assume my delta X/Y (delX / delY) is already incorrect.
lat0 = lat4 + y4 * delY
long0 = long1 - x1 * delX
lat0 = 50.983069 - (329 * 1.010226) = -281.381285 ( <- WRONG!)
long0 = 11.318177 - (247 * 1.577778) = -378,392989 ( <- WRONG!)
Someone please help! (imarshad, u there?) :/
Thank you all!