I have a specific task and after doing some research, I feel a little stuck and confused. Here is my point:
- I have a raster image with known dimensions (800 x 800 px)
- I know two point inside this image with her pixel AND geographical coordinates eg: (200,200 in pixel represent 20.5,14.57 in geo and 300,300 represent 21.4,16.01) – measured on place with GPS
I need an idea how to calculate X,Y in pixel on other point with geo-coordinates 21.71,15.01
Java Script is my environment.
Before taking care of the programming part, you have to care about transforming the WGS84 coordinate system (used by GPS) into plane grid system coordinates.
That’s trigonometry, and depending on the size of the system you will be using, the precision you need, and your location (the earth is not a perfect sphere), you will have to choose a projection, or use an approximation. In France, we generally use the Lambert projection.
Then, using this new local plane grid, you can just scale it to pixels and fill your image.
edit : I found this question on stackoverflow very similar, and the accepted answer is well explained