转换经度和带有校准点的地图上到 X Y 的纬度 [英] Converting Longitude & Latitude to X Y on a map with Calibration points

查看:27
本文介绍了转换经度和带有校准点的地图上到 X Y 的纬度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个大小为 sizeX, sizeY 的 jpeg 地图

If i have a jpeg map with size sizeX, sizeY

以及地图上的一些校准点(X、Y、Lon、Lat)

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

使用给定的经度/纬度对计算地图中对应的 XY 点的算法是什么?

What would be the algorithm for calculating the corresponding XY point in the map with a given Longitude / Latitude pair?

推荐答案

这对我有用,没有那么多废话.

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));

经纬度坐标是由 Android 设备提供给我的.因此,它们应该采用所有 Google 地球/地图产品使用的相同标准.

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.

这篇关于转换经度和带有校准点的地图上到 X Y 的纬度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆