Calculation of new longitude, latitude from old + n meters

I want to create 2 new longitudes and 2 new latitudes based on coordinates and distance in meters, I want to create a nice bounding box around a specific point. Its small scale and max 1500 meters + and 1500 meters. So for the part of the city, I do not think that the land curve should 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 a lot of algorithms, but almost everyone seems to be dealing with the distance between the points.

+42
algorithm geolocation
Sep 19 '11 at 20:35
source share
3 answers

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 in all places, approximately

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

So far, dx and dy are small compared to the radius of the earth, and you are not getting too close to the poles.

+74
Sep 20 '11 at 0:25
source share

The accepted answer is absolutely right and works. I did some tricks and turned into this:

 double meters = 50; double coef = meters * 0.0000089; double new_lat = my_lat + coef; double new_long = my_long + coef / Math.cos(my_lat * 0.018); 

Hope this helps too.

+15
Nov 07 '16 at 18:07
source share

You checked: How to find the lat / long length, which is x km north of the given lat / long value ?

These calculations are annoying at best; I have done many of them. The haversine formula will be your friend.

Some link: http://www.movable-type.co.uk/scripts/latlong.html

+6
Sep 19 '11 at 20:39
source share



All Articles