Converting Longitude & Latitude to X Y on a map with Calibration points

后端 未结 7 1153
既然无缘
既然无缘 2020-11-29 01:25

If i have a jpeg map with size sizeX, sizeY

and some calibration points on the map (X, Y, Lon, Lat)

What would be the algorithm for calculating the correspon

7条回答
  •  醉酒成梦
    2020-11-29 01:38

    Here's what worked for me, without so much bs.

    int x =  (int) ((MAP_WIDTH/360.0) * (180 + lon));
    int y =  (int) ((MAP_HEIGHT/180.0) * (90 - lat));
    

    The lat,lon coordinates were given to me by Android devices. So they should be in the same standard used by all Google Earth/Map products.

提交回复
热议问题