擅长:python、mysql、java
<p>为了简单起见,我们假设GPS坐标可以线性缩放到另一个坐标系。您需要图像左上角点和右下角点的GPS坐标:</p>
<p>伪代码:</p>
<pre><code>input: gps_marker
let gps1 = lat/lon of location corresponding to top left of image.
let gps2 = lat/lon of location corresponding to bottom right of image.
let x_offset = (gps_marker.lon - gps1.lon)/(gps2.lon - gps1.lon) * image.width
let y_offset = (gps_marker.lat - gps1.lat)/(gps2.lat - gps1.lat) * image.height
// x_offset and y_offset are the x,y for your marker within the image.
</code></pre>