Skip to content

Instantly share code, notes, and snippets.

@pikhovkin
Created December 14, 2021 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pikhovkin/227e53de348a767cff4a4d8f1a151480 to your computer and use it in GitHub Desktop.
Save pikhovkin/227e53de348a767cff4a4d8f1a151480 to your computer and use it in GitHub Desktop.
from pyproj import Geod
GEOD_WGS84 = Geod(ellps='WGS84')
def forward(point: tuple[float, float], az: float, dist: float) -> tuple[float, float]:
x, y = point[0], point[1]
lon, lat, _ = GEOD_WGS84.fwd(x, y, az, dist, radians=False)
return lon, lat
def coords(start_point: tuple[float, float], *directions_distances) -> list:
points = [start_point]
end_point = start_point
for direction, distance in directions_distances:
end_point = forward(end_point, direction, distance)
points.append(end_point)
return points
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment