将我的 WGS 84 坐标转换为屏幕 x 和 y
我在创建一个简单的地图应用程序时遇到了一个小问题。我想要学习的是 WGS 84 GPS 坐标转换背后的数学。
这就是问题:
我有两个 WGS 84 坐标;纬度:53.7506 长:-2.3931 + 纬度:53.7638 长:-2.4212 我想将这些值转换为屏幕上的点 x = 'a' 值在 0 到 200 之间,y = 'a' 值在 0 到 200 之间
我已经说了一个值,因为该值将从纬度和经度数字导出,如下所示上面提到过。
有人可以帮忙吗?
我尝试使用公式 N = V/D 对数字进行标准化(N 是标准化值,V 是坐标值,D 是屏幕区域的最大值,在我的例子中是 200。这并不起作用生成的数字都在 199 - 200 范围内,但我现在已经迷失了这一点,所以我需要一些帮助,
我确信有一个计算正确的公式,但我似乎找不到它,
请帮忙。我需要今晚睡个好觉:)
谢谢
I am stuck on a little problem of creating a simple map app. what i am trying to learn is the mathematics behind the conversion of my WGS 84 GPS co-ordinates.
this is the problem:
I have two WGS 84 co-ordinates; lat:53.7506 Long:-2.3931 + lat:53.7638 Long:-2.4212
I want to convert these values onto points on my screen x = 'a' value between 0 and 200 and y = 'a' value between 0 and 200
i have said a value as this value will be derived from the lat and long figures as mentioned above.
can anyone help please?
i have tried normalising the figures using the formula N = V/D (N being the normailsed value with V being the co-ordinate value and D being the max value of the screen area which in my case is 200. this didnt work as all the figures generated was all in the 199 - 200 range but I have gotten lost with the thought process on this now so I need some help.
I am sure there is a formula for calculating the right but i cannot seem to find it
please help as I need to sleep well tonight :)
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是 x 的简单线性映射,以及带有扭曲的 y 的线性映射:
x) 因为下限是左侧,您可以简单地使用
y),因为只要 0 在中间,您就需要减去/相应添加:
It is a simple linear mapping for x, and one for y with a twist:
x) as the lower limit is the left hand side, you can simply use
y) as long 0 is in the middle, you'll need to substract/add accordingly: