Created
December 14, 2021 09:40
-
-
Save pikhovkin/227e53de348a767cff4a4d8f1a151480 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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