从旧的+ n米计算新的经度,纬度 [英] Calculating new longitude, latitude from old + n meters

查看:94
本文介绍了从旧的+ n米计算新的经度,纬度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建2个新的经度和2个新的纬度,基于一个坐标和一个以米为单位的距离,我想围绕某个点创建一个漂亮的边界框。其小规模,最大1500米+和1500米 - 。因此,这是一个城市的一部分,我不认为地球的曲线必须考虑。

所以我有50.0452345(x)和4.3242234(y)我想知道x + 500meter,x-500meter,y-500meter,y + 500meter

我发现了很多算法,但几乎所有算法似乎都处理点之间的距离。

解决方案

每度经度的公里数大约是

 (2 * pi / 360)* r_earth * cos(theta)

其中 theta 是以度数表示的纬度,而 r_earth 约为6378 km。



所有地点的每度纬度公里数大致相同,约

 (2 * pi / 360)* r_earth = 111 km / degree 

所以你可以做:

  new_latitude =纬度+(dy / r_earth)*(180 / pi); 
new_longitude =经度+(dx / r_earth)*(180 / pi)/ cos(纬度* pi / 180);

只要 dx dy 与地球半径相比较小,并且不会太接近极点。


I want to create 2 new longitude and 2 new latitudes based on a coordinate and a distance in meters, I want to create a nice bounding box around a certain point. Its small scale and max 1500meters + and 1500meter -. So it is for a part of a city, I don't think the curve of the earth has to be taken into account.

So I have 50.0452345(x) and 4.3242234(y) and I want to know x+500meter, x-500meter, y-500meter, y+500meter

I found many algorithms but almost all seem to deal with the distance between points.

解决方案

The number of kilometers per degree of longitude is approximately

(2*pi/360) * r_earth * cos(theta)

where theta is the latitude in degrees and r_earth is approximately 6378 km.

The number of kilometers per degree of latitude is approximately the same at all locations, approx

(2*pi/360) * r_earth = 111 km / degree 

So you can do:

new_latitude  = latitude  + (dy / r_earth) * (180 / pi);
new_longitude = longitude + (dx / r_earth) * (180 / pi) / cos(latitude * pi/180);

As long as dx and dy are small compared to the radius of the earth and you don't get too close to the poles.

这篇关于从旧的+ n米计算新的经度,纬度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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