1

I have a set of lat/long coordinates and need to offset the value to the "left" by < 10 meters. I calculate left by getting the direction my instrument is facing and use basic trigonometry to get the displacement in terms of lat/long. There is another similar answer on this forum but that does not talk about such small offsets. Algorithm for offsetting a latitude/longitude by some amount of meters

d_lat = shift * math.cos(math.radians(90 - theta))
d_long = shift * math.sin(math.radians(90 - theta))

How do I accurately convert this small shift from meters to latitude and longitude values? Since my offset is by less than 10 meters I need it to be fairly accurate.

user
  • 11
  • 1
  • 3

1 Answers1

2

Use GeographicLib:

from geographiclib.geodesic import Geodesic

geod = Geodesic.WGS84

lat1 = 0 lon1 = 0 theta = 0 #direction from North, clockwise azi1 = theta - 90 #(90 degrees to the left) shift = 10 #meters

g = geod.Direct(lat1, lon1, azi1, shift)

lat2 = g['lat2'] lon2 = g['lon2']

print("lat2 = {:.8f}, lon2 = {:.8f}.".format(lat2, lon2))

lat2 = 0.00000000, lon2 = -0.00008983.

Gabriel De Luca
  • 14,289
  • 3
  • 20
  • 51