Given a Point (django.contrib.gis.geos.Point) how do I find another point 1 mile east from that Point object?
(A) ---[ 1 mile ]---> (B)
My failed attempts:
I've considered trying to go hardcode the 1 mile east point but due to the curvature of the earth. The miles per degree change.
Copius googling on SO and Geo Info Exchange. I assume I cannot find the terminology?
You can accomplish this using the Geod class of pyproj.
from pyproj import Geod
geoid = Geod(ellps='WGS84')
def add_distance(lat, lng, az, dist):
lng_new, lat_new, return_az = geoid.fwd(lon, lat, az, dist)
return lat_new, lng_new
So for your specific question, you could do the following:
from django.contrib.gis.geos import Point
def move_point_mile_east(point):
dist = 1609.34
lat, lng = add_distance(point.y, point.x, 90, dist)
return Point(lng, lat)