how to add 500meters to a lat and long in Python

296 Views Asked by At

If this is the initial

Latitude:  13.050249
Longitude:  77.462143

how to increment the lat and long by 500m and get the new pixel/grid's coordinates?

1

There are 1 best solutions below

0
On

Here is a function to it you can pass the x and y to get lat and long.

from math import cos
from math import radians
def meters_2_lat_lon(m, orig_lat):
    lat = m/111111
    lon = m/(111111 * cos(radians(orig_lat)))
    return lat, lon