On a map that I know the coordinates (lat/lng) of three corners (or any three non aligned points) I have coordinates (lat/lng) of a few points that are located on the map.
What I want is the relative coordinates (x/y relative to top left corner) of the points to the map.
I'm also interested in the other conversion (x/y to lat/lng).
My maps are pretty small (less than 10 km x 10 km) do I need to use a projection system or can I just assume that my surface is perfectly flat and use a linear conversion ?
EDIT : I don't know (and I have no way to know) which projection my background map uses. I just know 3 georeferenced points.
A solution is to use a linear conversion :
If my three points are A (xA,yA), B (xB, yB) , C (xC,yC) and the point I want to position X (x, y).
I can compute a
and b
as AX = aAB + bAC
in the lat/lng referential then
x = xA + a * (xB-xA) + b * (xC - xA)
y = yA + a * (yB-yA) + b * (yC - yA)
But it looks like I'm missing something?
Related question : How to map a latitude/longitude to a distorted map?