从旧的+ n米计算新的经度,纬度 [英] Calculating new longitude, latitude from old + n meters
问题描述
所以我有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屋!