Skip to content

Commit

Permalink
Add return_back_azimuth: bool to _inv_or_fwd_intermediate
Browse files Browse the repository at this point in the history
  • Loading branch information
idanmiara committed Dec 19, 2022
1 parent b0b0d4f commit 3f1de5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyproj/_geod.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Geod:
out_lons: Any,
out_lats: Any,
out_azis: Any,
return_back_azimuth: bool,
) -> GeodIntermediateReturn: ...
def _line_length(self, lons: Any, lats: Any, radians: bool = False) -> float: ...
def _polygon_area_perimeter(
Expand Down
6 changes: 6 additions & 0 deletions pyproj/_geod.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ cdef class Geod:
object out_lons,
object out_lats,
object out_azis,
bint return_back_azimuth,
) -> GeodIntermediateReturn:
"""
.. versionadded:: 3.1.0
Expand Down Expand Up @@ -335,6 +336,11 @@ cdef class Geod:
lats_buff.data[iii] = plat2
lons_buff.data[iii] = plon2
if store_az:
# by default (return_back_azimuth=True),
# forward azimuth needs to be flipped 180 degrees
# to match the (back azimuth) output of PROJ geod utilities.
if return_back_azimuth:
pazi2 =_reverse_azimuth(pazi2, factor=180)
azis_buff.data[iii] = pazi2

return GeodIntermediateReturn(
Expand Down

0 comments on commit 3f1de5b

Please sign in to comment.