
    \iZ              	          S r / SQrSSKrSSKrSSKJr  SSKJr  SSKJ	r	J
r
  SSKJr  SSKJr  SS	KJr  SS
KJr  SSKJrJrJr  \" 5       rS\S\\\\\\4   4S jrS\S\\\\\4   4S jr " S S\5      rSS\S\S\4S jjrg)a  
The Geod class can perform forward and inverse geodetic, or
Great Circle, computations.  The forward computation involves
determining latitude, longitude and back azimuth of a terminus
point given the latitude and longitude of an initial point, plus
azimuth and distance. The inverse computation involves
determining the forward and back azimuths and distance given the
latitudes and longitudes of an initial and terminus point.
)GeodGeodIntermediateFlagGeodIntermediateReturngeodesic_version_strpj_ellpsreverse_azimuth    N)Any)r   )r   r   )r   )r   )	GeodError)get_ellps_map)DataType_convertback_copytobufferellpsreturnc                 T    [         U    n[        U5      u  p#pESnUS   S:X  a  SnX#XEU4$ )z
Build Geodesic parameters from PROJ ellips map

Parameter
---------
ellps: str
    The name of the ellipse in the map.

Returns
-------
tuple[float, float, float, float, bool]

FdescriptionzNormal SphereT)r   _params_from_kwargs)r   
ellps_dictsemi_major_axissemi_minor_axis
flatteningeccentricity_squaredspheres          N/var/www/html/kml_chatgpt/mouzaenv/lib/python3.13/site-packages/pyproj/geod.py_params_from_ellps_mapr   #   sE     %JJ' GOj F- O3ZvUU    kwargsc                    U S   nSU ;   a  U S   nSUS-  US-  -  -
  nX-
  U-  nOSU ;   a  SU S   -  nUSU-
  -  nSUS-  US-  -  -
  nOSU ;   a  U S   nUSU-
  -  nSX!-  S-  -
  nOqSU ;   a.  U S   n[         R                  " US-  X1S-  -  -
  5      nX-
  U-  nO=SU ;   a1  U S   S-  n[         R                  " US-  X1S-  -  -
  5      nX-
  U-  nOUnS	nS	nXXC4$ )
aZ  
Build Geodesic parameters from input kwargs:

- a: the semi-major axis (required).

Need least one of these parameters.

- b: the semi-minor axis
- rf: the reciprocal flattening
- f: flattening
- es: eccentricity squared


Parameter
---------
kwargs: dict
    The input kwargs for an ellipse.

Returns
-------
tuple[float, float, float, float]

ab      ?   rffese        )mathsqrt)r   r   r   r   r   s        r   r   r   ;   s\   0 SkO
f} +"_a%7/1:L%LL%7?J
	6$<'
)S:-=>"_a%7/1:L%LL	C[
)S:-=>"o&GA%MM	%d|))Q!58J!JJ
 &7?J
	%c{a/))Q!58J!JJ
 &7?J
)
"ZMMr   c                     ^  \ rS rSrSrS0S\S-  SS4U 4S jjjr   S1S\S	\S
\S\S\S\S\S\	\\\4   4S jjr
   S1S\S\S\S\S\S\S\S\	\\\4   4S jjr   S2S\S\S\S\S\S\S\S\S\4S jjrSSSSS\R"                  SSSS4
S\S\S\S\S\S\S\S\S\S \S!\S-  S"\S-  S#\S-  S\S-  S\4U 4S$ jjjrSSS\R"                  SSSS4S\S\S%\S\S\S\S\S\S \S!\S-  S"\S-  S#\S-  S\S-  S\4U 4S& jjjrS3S\S	\S\S\4S' jjrS3S\S	\S\S\4S( jjr S3S\S	\S\S\	\\4   4S) jjrS3S\S\4S* jjr S3S\S\	\\4   4S+ jjrS\4U 4S, jjrS-\S\4S. jrS/rU =r$ )4r   s   aa  
performs forward and inverse geodetic, or Great Circle,
computations.  The forward computation (using the 'fwd' method)
involves determining latitude, longitude and back azimuth of a
terminus point given the latitude and longitude of an initial
point, plus azimuth and distance. The inverse computation (using
the 'inv' method) involves determining the forward and back
azimuths and distance given the latitudes and longitudes of an
initial and terminus point.

Attributes
----------
initstring: str
    The string form of the user input used to create the Geod.
sphere: bool
    If True, it is a sphere.
a: float
    The ellipsoid equatorial radius, or semi-major axis.
b: float
    The ellipsoid polar radius, or semi-minor axis.
es: float
    The 'eccentricity' of the ellipse, squared (1-b2/a2).
f: float
    The ellipsoid 'flattening' parameter ( (a-b)/a ).

N
initstringr   c                   > 0 nUbk  UR                  5        HW  nUR                  S5      S:X  a  M  UR                  S5      u  pVUR                  S5      nUS;   a  [        U5      X5'   MS  XcU'   MY     [	        [        UR                  5       5      [        UR                  5       5      -   5      nSnSU;   a  [        US   5      u  nn	n
nnO[        U5      u  nn	n
n[        R                  " U
5      S:  a  S	n[        TU ]1  XXyU5        g)
a
	  
initialize a Geod class instance.

Geodetic parameters for specifying the ellipsoid
can be given in a dictionary 'initparams', as keyword arguments,
or as as proj geod initialization string.

You can get a dictionary of ellipsoids using :func:`pyproj.get_ellps_map`
or with the variable `pyproj.pj_ellps`.

The parameters of the ellipsoid may also be set directly using
the 'a' (semi-major or equatorial axis radius) keyword, and
any one of the following keywords: 'b' (semi-minor,
or polar axis radius), 'e' (eccentricity), 'es' (eccentricity
squared), 'f' (flattening), or 'rf' (reciprocal flattening).

See the proj documentation (https://proj.org) for more
information about specifying ellipsoid parameters.

Example usage:

>>> from pyproj import Geod
>>> g = Geod(ellps='clrk66') # Use Clarke 1866 ellipsoid.
>>> # specify the lat/lons of some cities.
>>> boston_lat = 42.+(15./60.); boston_lon = -71.-(7./60.)
>>> portland_lat = 45.+(31./60.); portland_lon = -123.-(41./60.)
>>> newyork_lat = 40.+(47./60.); newyork_lon = -73.-(58./60.)
>>> london_lat = 51.+(32./60.); london_lon = -(5./60.)
>>> # compute forward and back azimuths, plus distance
>>> # between Boston and Portland.
>>> az12,az21,dist = g.inv(boston_lon,boston_lat,portland_lon,portland_lat)
>>> f"{az12:.3f} {az21:.3f} {dist:.3f}"
'-66.531 75.654 4164192.708'
>>> # compute latitude, longitude and back azimuth of Portland,
>>> # given Boston lat/lon, forward azimuth and distance to Portland.
>>> endlon, endlat, backaz = g.fwd(boston_lon, boston_lat, az12, dist)
>>> f"{endlat:.3f} {endlon:.3f} {backaz:.3f}"
'45.517 -123.683 75.654'
>>> # compute the azimuths, distances from New York to several
>>> # cities (pass a list)
>>> lons1 = 3*[newyork_lon]; lats1 = 3*[newyork_lat]
>>> lons2 = [boston_lon, portland_lon, london_lon]
>>> lats2 = [boston_lat, portland_lat, london_lat]
>>> az12,az21,dist = g.inv(lons1,lats1,lons2,lats2)
>>> for faz, baz, d in list(zip(az12,az21,dist)):
...     f"{faz:7.3f} {baz:8.3f} {d:12.3f}"
' 54.663 -123.448   288303.720'
'-65.463   79.342  4013037.318'
' 51.254  -71.576  5579916.651'
>>> g2 = Geod('+ellps=clrk66') # use proj4 style initialization string
>>> az12,az21,dist = g2.inv(boston_lon,boston_lat,portland_lon,portland_lat)
>>> f"{az12:.3f} {az21:.3f} {dist:.3f}"
'-66.531 75.654 4164192.708'
N=+)r   r    r#   r$   r%   r&   Fr   g:0yE>T)splitfindlstripfloatdictlistitemsr   r   r(   fabssuper__init__)selfr,   r   ellpsdkvpairkeyvalr   r   r   r   r   	__class__s               r   r:   Geod.__init__   s   r *,!$**, ;;s#r)!<<,jjo::"'*FK"%3K - d6<<>*T&,,.-AABf 'vg7$ $F+$ 99Z 6)FBV	
r   Flonslatsazdistradiansinplacereturn_back_azimuthc           	          U R                  UUUUUUS9$ ! [         a     Of = f[        XS9u  p[        X&S9u  p[        X6S9u  p[        XFS9S   nU R                  XXXWS9  [	        X5      n[	        X5      n[	        X5      nUUU4$ )a  
Forward transformation

Determine longitudes, latitudes and back azimuths of terminus
points given longitudes and latitudes of initial points,
plus forward azimuths and distances.

.. versionadded:: 3.5.0 inplace
.. versionadded:: 3.5.0 return_back_azimuth

Accepted numeric scalar or array:

- :class:`int`
- :class:`float`
- :class:`numpy.floating`
- :class:`numpy.integer`
- :class:`list`
- :class:`tuple`
- :class:`array.array`
- :class:`numpy.ndarray`
- :class:`xarray.DataArray`
- :class:`pandas.Series`

Parameters
----------
lons: scalar or array
    Longitude(s) of initial point(s)
lats: scalar or array
    Latitude(s) of initial point(s)
az: scalar or array
    Forward azimuth(s)
dist: scalar or array
    Distance(s) between initial and terminus point(s)
    in meters
radians: bool, default=False
    If True, the input data is assumed to be in radians.
    Otherwise, the data is assumed to be in degrees.
inplace: bool, default=False
    If True, will attempt to write the results to the input array
    instead of returning a new array. This will fail if the input
    is not an array in C order with the double data type.
return_back_azimuth: bool, default=True
    If True, the third return value will be the back azimuth,
    Otherwise, it will be the forward azimuth.

Returns
-------
scalar or array:
    Longitude(s) of terminus point(s)
scalar or array:
    Latitude(s) of terminus point(s)
scalar or array:
    Back azimuth(s) or Forward azimuth(s)
rF   rH   rG   r   )
_fwd_point	TypeErrorr   _fwdr   )r;   rB   rC   rD   rE   rF   rG   rH   inxx_data_typeinyy_data_typeinzz_data_typeindoutxoutyoutzs                     r   fwdGeod.fwd   s    @	 ??$7 #    		 )?(?(=D215		c 	 	
 K-K-K-T4    
##lons1lats1lons2lats2c           	          U R                  UUUUUUS9$ ! [         a     Of = f[        XS9u  p[        X&S9u  p[        X6S9u  p[        XFS9S   nU R                  XXXWS9  [	        X5      n[	        X5      n[	        X5      nUUU4$ )a  

Inverse transformation

Determine forward and back azimuths, plus distances
between initial points and terminus points.

.. versionadded:: 3.5.0 inplace
.. versionadded:: 3.5.0 return_back_azimuth

Accepted numeric scalar or array:

- :class:`int`
- :class:`float`
- :class:`numpy.floating`
- :class:`numpy.integer`
- :class:`list`
- :class:`tuple`
- :class:`array.array`
- :class:`numpy.ndarray`
- :class:`xarray.DataArray`
- :class:`pandas.Series`

Parameters
----------
lons1: scalar or array
    Longitude(s) of initial point(s)
lats1: scalar or array
    Latitude(s) of initial point(s)
lons2: scalar or array
    Longitude(s) of terminus point(s)
lats2: scalar or array
    Latitude(s) of terminus point(s)
radians: bool, default=False
    If True, the input data is assumed to be in radians.
    Otherwise, the data is assumed to be in degrees.
inplace: bool, default=False
    If True, will attempt to write the results to the input array
    instead of returning a new array. This will fail if the input
    is not an array in C order with the double data type.
return_back_azimuth: bool, default=True
    If True, the second return value (azi21) will be the back azimuth
    (flipped 180 degrees), Otherwise, it will also be a forward azimuth.

Returns
-------
scalar or array:
    Forward azimuth(s) (azi12)
scalar or array:
    Back azimuth(s) or Forward azimuth(s) (azi21)
scalar or array:
    Distance(s) between initial and terminus point(s)
    in meters
rJ   rK   r   )
_inv_pointrM   r   _invr   )r;   r\   r]   r^   r_   rF   rG   rH   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   s                     r   invGeod.invK  s    @	 ??$7 #    		 )@(@(@E3A6		c 	 	
 K-K-K-T4r[      lon1lat1lon2lat2nptsinitial_idxterminus_idxc	                     U R                  UUUUUSUUU[        R                  SSSSSS9n	[        [	        U	R
                  U	R                  5      5      $ )a,	  
.. versionadded:: 3.1.0 initial_idx, terminus_idx

Given a single initial point and terminus point, returns
a list of longitude/latitude pairs describing npts equally
spaced intermediate points along the geodesic between the
initial and terminus points.

Similar to inv_intermediate(), but with less options.

Example usage:

>>> from pyproj import Geod
>>> g = Geod(ellps='clrk66') # Use Clarke 1866 ellipsoid.
>>> # specify the lat/lons of Boston and Portland.
>>> boston_lat = 42.+(15./60.); boston_lon = -71.-(7./60.)
>>> portland_lat = 45.+(31./60.); portland_lon = -123.-(41./60.)
>>> # find ten equally spaced points between Boston and Portland.
>>> lonlats = g.npts(boston_lon,boston_lat,portland_lon,portland_lat,10)
>>> for lon,lat in lonlats: f'{lat:.3f} {lon:.3f}'
'43.528 -75.414'
'44.637 -79.883'
'45.565 -84.512'
'46.299 -89.279'
'46.830 -94.156'
'47.149 -99.112'
'47.251 -104.106'
'47.136 -109.100'
'46.805 -114.051'
'46.262 -118.924'
>>> # test with radians=True (inputs/outputs in radians, not degrees)
>>> import math
>>> dg2rad = math.radians(1.)
>>> rad2dg = math.degrees(1.)
>>> lonlats = g.npts(
...    dg2rad*boston_lon,
...    dg2rad*boston_lat,
...    dg2rad*portland_lon,
...    dg2rad*portland_lat,
...    10,
...    radians=True
... )
>>> for lon,lat in lonlats: f'{rad2dg*lat:.3f} {rad2dg*lon:.3f}'
'43.528 -75.414'
'44.637 -79.883'
'45.565 -84.512'
'46.299 -89.279'
'46.830 -94.156'
'47.149 -99.112'
'47.251 -104.106'
'47.136 -109.100'
'46.805 -114.051'
'46.262 -118.924'

Parameters
----------
lon1: float
    Longitude of the initial point
lat1: float
    Latitude of the initial point
lon2: float
    Longitude of the terminus point
lat2: float
    Latitude of the terminus point
npts: int
    Number of points to be returned
    (including initial and/or terminus points, if required)
radians: bool, default=False
    If True, the input data is assumed to be in radians.
    Otherwise, the data is assumed to be in degrees.
initial_idx: int, default=1
    if initial_idx==0 then the initial point would be included in the output
    (as the first point)
terminus_idx: int, default=1
    if terminus_idx==0 then the terminus point would be included in the output
    (as the last point)
Returns
-------
list of tuples:
    list of (lon, lat) points along the geodesic
    between the initial and terminus points.
r   NFrf   rg   lon2_or_azi1ri   rj   del_srF   rk   rl   flagsout_lonsout_latsout_azisrH   is_fwd)_inv_or_fwd_intermediater   AZIS_DISCARDr6   ziprB   rC   )
r;   rf   rg   rh   ri   rj   rF   rk   rl   ress
             r   rj   	Geod.npts  si    | ++#%&33 % , 
" C#((+,,r   r   rp   rq   rr   rs   rt   c                    > Uc  Sn[         R                  " S5        [        TU ]  UUUUUUU	UU[	        U
5      UUUUSS9$ )a  
.. versionadded:: 3.1.0
.. versionadded:: 3.5.0 return_back_azimuth

Given a single initial point and terminus point,
and the number of points, returns
a list of longitude/latitude pairs describing npts equally
spaced intermediate points along the geodesic between the
initial and terminus points.

npts and del_s parameters are mutually exclusive:

if npts != 0:
    it calculates the distance between the points by
    the distance between the initial point and the
    terminus point divided by npts
    (the number of intermediate points)
else:
    it calculates the number of intermediate points by
    dividing the distance between the initial and
    terminus points by del_s
    (delimiter distance between two successive points)

Similar to npts(), but with more options.

Example usage:

>>> from pyproj import Geod
>>> g = Geod(ellps='clrk66') # Use Clarke 1866 ellipsoid.
>>> # specify the lat/lons of Boston and Portland.
>>> boston_lat = 42.+(15./60.); boston_lon = -71.-(7./60.)
>>> portland_lat = 45.+(31./60.); portland_lon = -123.-(41./60.)
>>> # find ten equally spaced points between Boston and Portland.
>>> r = g.inv_intermediate(boston_lon,boston_lat,portland_lon,portland_lat,10)
>>> for lon,lat in zip(r.lons, r.lats): f'{lat:.3f} {lon:.3f}'
'43.528 -75.414'
'44.637 -79.883'
'45.565 -84.512'
'46.299 -89.279'
'46.830 -94.156'
'47.149 -99.112'
'47.251 -104.106'
'47.136 -109.100'
'46.805 -114.051'
'46.262 -118.924'
>>> # test with radians=True (inputs/outputs in radians, not degrees)
>>> import math
>>> dg2rad = math.radians(1.)
>>> rad2dg = math.degrees(1.)
>>> r = g.inv_intermediate(
...    dg2rad*boston_lon,
...    dg2rad*boston_lat,
...    dg2rad*portland_lon,
...    dg2rad*portland_lat,
...    10,
...    radians=True
... )
>>> for lon,lat in zip(r.lons, r.lats): f'{rad2dg*lat:.3f} {rad2dg*lon:.3f}'
'43.528 -75.414'
'44.637 -79.883'
'45.565 -84.512'
'46.299 -89.279'
'46.830 -94.156'
'47.149 -99.112'
'47.251 -104.106'
'47.136 -109.100'
'46.805 -114.051'
'46.262 -118.924'

Parameters
----------
lon1: float
    Longitude of the initial point
lat1: float
    Latitude of the initial point
lon2: float
    Longitude of the terminus point
lat2: float
    Latitude of the terminus point
npts: int, default=0
    Number of points to be returned
    npts == 0 if del_s != 0
del_s: float, default=0
    delimiter distance between two successive points
    del_s == 0 if npts != 0
radians: bool, default=False
    If True, the input data is assumed to be in radians.
    Otherwise, the data is assumed to be in degrees.
initial_idx: int, default=1
    if initial_idx==0 then the initial point would be included in the output
    (as the first point)
terminus_idx: int, default=1
    if terminus_idx==0 then the terminus point would be included in the output
    (as the last point)
flags: GeodIntermediateFlag, default=GeodIntermediateFlag.DEFAULT
    * 1st - round/ceil/trunc (see ``GeodIntermediateFlag.NPTS_*``)
    * 2nd - update del_s to the new npts or not
            (see ``GeodIntermediateFlag.DEL_S_*``)
    * 3rd - if out_azis=None, indicates if to save or discard the azimuths
            (see ``GeodIntermediateFlag.AZIS_*``)
    * default - round npts, update del_s accordingly, discard azis
out_lons: array, :class:`numpy.ndarray`, optional
    Longitude(s) of the intermediate point(s)
    If None then buffers would be allocated internnaly
out_lats: array, :class:`numpy.ndarray`, optional
    Latitudes(s) of the intermediate point(s)
    If None then buffers would be allocated internnaly
out_azis: array, :class:`numpy.ndarray`, optional
    az12(s) of the intermediate point(s)
    If None then buffers would be allocated internnaly
    unless requested otherwise by the flags
return_back_azimuth: bool, default=True
    if True, out_azis will store the back azimuth,
    Otherwise, out_azis will store the forward azimuth.

Returns
-------
GeodIntermediateReturn:
    number of points, distance and output arrays (GeodIntermediateReturn docs)
Ta  Back azimuth is being returned by default to be compatible with fwd()This is a breaking change for pyproj 3.5+.To avoid this warning, set return_back_azimuth=True.Otherwise, to restore old behaviour, set return_back_azimuth=False.This warning will be removed in future version.Frn   )warningswarnr9   rv   int)r;   rf   rg   rh   ri   rj   rp   rk   rl   rF   rq   rr   rs   rt   rH   r@   s                  r   inv_intermediateGeod.inv_intermediate  sn    R &"&MMB w/#%e* 3 0 
 	
r   azi1c                    > Uc  Sn[         R                  " S5        [        TU ]  UUU[        R
                  UUUUU[        U	5      U
UUUSS9$ )a1  
.. versionadded:: 3.1.0
.. versionadded:: 3.5.0 return_back_azimuth

Given a single initial point and azimuth, number of points (npts)
and delimiter distance between two successive points (del_s), returns
a list of longitude/latitude pairs describing npts equally
spaced intermediate points along the geodesic between the
initial and terminus points.

Example usage:

>>> from pyproj import Geod
>>> g = Geod(ellps='clrk66') # Use Clarke 1866 ellipsoid.
>>> # specify the lat/lons of Boston and Portland.
>>> boston_lat = 42.+(15./60.); boston_lon = -71.-(7./60.)
>>> portland_lat = 45.+(31./60.); portland_lon = -123.-(41./60.)
>>> az12,az21,dist = g.inv(boston_lon,boston_lat,portland_lon,portland_lat)
>>> # find ten equally spaced points between Boston and Portland.
>>> npts = 10
>>> del_s = dist/(npts+1)
>>> r = g.fwd_intermediate(boston_lon,boston_lat,az12,npts=npts,del_s=del_s)
>>> for lon,lat in zip(r.lons, r.lats): f'{lat:.3f} {lon:.3f}'
'43.528 -75.414'
'44.637 -79.883'
'45.565 -84.512'
'46.299 -89.279'
'46.830 -94.156'
'47.149 -99.112'
'47.251 -104.106'
'47.136 -109.100'
'46.805 -114.051'
'46.262 -118.924'
>>> # test with radians=True (inputs/outputs in radians, not degrees)
>>> import math
>>> dg2rad = math.radians(1.)
>>> rad2dg = math.degrees(1.)
>>> r = g.fwd_intermediate(
...    dg2rad*boston_lon,
...    dg2rad*boston_lat,
...    dg2rad*az12,
...    npts=npts,
...    del_s=del_s,
...    radians=True
... )
>>> for lon,lat in zip(r.lons, r.lats): f'{rad2dg*lat:.3f} {rad2dg*lon:.3f}'
'43.528 -75.414'
'44.637 -79.883'
'45.565 -84.512'
'46.299 -89.279'
'46.830 -94.156'
'47.149 -99.112'
'47.251 -104.106'
'47.136 -109.100'
'46.805 -114.051'
'46.262 -118.924'

Parameters
----------
lon1: float
    Longitude of the initial point
lat1: float
    Latitude of the initial point
azi1: float
    Azimuth from the initial point towards the terminus point
npts: int
    Number of points to be returned
    (including initial and/or terminus points, if required)
del_s: float
    delimiter distance between two successive points
radians: bool, default=False
    If True, the input data is assumed to be in radians.
    Otherwise, the data is assumed to be in degrees.
initial_idx: int, default=1
    if initial_idx==0 then the initial point would be included in the output
    (as the first point)
terminus_idx: int, default=1
    if terminus_idx==0 then the terminus point would be included in the output
    (as the last point)
flags: GeodIntermediateFlag, default=GeodIntermediateFlag.DEFAULT
    * 1st - round/ceil/trunc (see ``GeodIntermediateFlag.NPTS_*``)
    * 2nd - update del_s to the new npts or not
            (see ``GeodIntermediateFlag.DEL_S_*``)
    * 3rd - if out_azis=None, indicates if to save or discard the azimuths
            (see ``GeodIntermediateFlag.AZIS_*``)
    * default - round npts, update del_s accordingly, discard azis
out_lons: array, :class:`numpy.ndarray`, optional
    Longitude(s) of the intermediate point(s)
    If None then buffers would be allocated internnaly
out_lats: array, :class:`numpy.ndarray`, optional
    Latitudes(s) of the intermediate point(s)
    If None then buffers would be allocated internnaly
out_azis: array, :class:`numpy.ndarray`, optional
    az12(s) of the intermediate point(s)
    If None then buffers would be allocated internnaly
    unless requested otherwise by the flags
return_back_azimuth: bool, default=True
    if True, out_azis will store the back azimuth,
    Otherwise, out_azis will store the forward azimuth.

Returns
-------
GeodIntermediateReturn:
    number of points, distance and output arrays (GeodIntermediateReturn docs)
Ta  Back azimuth is being returned by default to be compatible with inv()This is a breaking change for pyproj 3.5+.To avoid this warning, set return_back_azimuth=True.Otherwise, to restore old behaviour, set return_back_azimuth=False.This warning will be removed in future version.rn   )r|   r}   r9   rv   r(   nanr~   )r;   rf   rg   r   rj   rp   rk   rl   rF   rq   rr   rs   rt   rH   r@   s                 r   fwd_intermediateGeod.fwd_intermediate  sr    r &"&MMB w/#%e* 3 0 
 	
r   c                 Z    [        U5      S   n[        U5      S   nU R                  XEUS9$ )a  
.. versionadded:: 2.3.0

Calculate the total distance between points along a line (meters).

>>> from pyproj import Geod
>>> geod = Geod('+a=6378137 +f=0.0033528106647475126')
>>> lats = [-72.9, -71.9, -74.9, -74.3, -77.5, -77.4, -71.7, -65.9, -65.7,
...         -66.6, -66.9, -69.8, -70.0, -71.0, -77.3, -77.9, -74.7]
>>> lons = [-74, -102, -102, -131, -163, 163, 172, 140, 113,
...         88, 59, 25, -4, -14, -33, -46, -61]
>>> total_length = geod.line_length(lons, lats)
>>> f"{total_length:.3f}"
'14259605.611'


Parameters
----------
lons: array, :class:`numpy.ndarray`, list, tuple, or scalar
    The longitude points along a line.
lats: array, :class:`numpy.ndarray`, list, tuple, or scalar
    The latitude points along a line.
radians: bool, default=False
    If True, the input data is assumed to be in radians.
    Otherwise, the data is assumed to be in degrees.

Returns
-------
float:
    The total length of the line (meters).
r   rF   )r   _line_length)r;   rB   rC   rF   rO   rQ   s         r   line_lengthGeod.line_lengthP  s9    B D!!$D!!$  7 ;;r   c                     [        U5      u  pE[        U5      S   nU R                  XFUS9  [        XT5      nU[        R                  :X  a  U$ USS $ )a  
.. versionadded:: 2.3.0

Calculate the distances between points along a line (meters).

>>> from pyproj import Geod
>>> geod = Geod(ellps="WGS84")
>>> lats = [-72.9, -71.9, -74.9]
>>> lons = [-74, -102, -102]
>>> for line_length in geod.line_lengths(lons, lats):
...     f"{line_length:.3f}"
'943065.744'
'334805.010'

Parameters
----------
lons: array, :class:`numpy.ndarray`, list, tuple, or scalar
    The longitude points along a line.
lats: array, :class:`numpy.ndarray`, list, tuple, or scalar
    The latitude points along a line.
radians: bool, default=False
    If True, the input data is assumed to be in radians.
    Otherwise, the data is assumed to be in degrees.

Returns
-------
array, :class:`numpy.ndarray`, list, tuple, or scalar:
    The total length of the line (meters).
r   r   Nr/   )r   r   r   r   FLOAT)r;   rB   rC   rF   rO   rP   rQ   line_lengthss           r   r   Geod.line_lengthsu  s[    > ).D!!$#G4#K5*hnn<|S,sPRBSSr   c                 T    U R                  [        U5      S   [        U5      S   US9$ )a  
.. versionadded:: 2.3.0

A simple interface for computing the area (meters^2) and perimeter (meters)
of a geodesic polygon.

Arbitrarily complex polygons are allowed. In the case self-intersecting
of polygons the area is accumulated "algebraically", e.g., the areas of
the 2 loops in a figure-8 polygon will partially cancel. There's no need
to "close" the polygon by repeating the first vertex. The area returned
is signed with counter-clockwise traversal being treated as positive.

.. note:: lats should be in the range [-90 deg, 90 deg].


Example usage:

>>> from pyproj import Geod
>>> geod = Geod('+a=6378137 +f=0.0033528106647475126')
>>> lats = [-72.9, -71.9, -74.9, -74.3, -77.5, -77.4, -71.7, -65.9, -65.7,
...         -66.6, -66.9, -69.8, -70.0, -71.0, -77.3, -77.9, -74.7]
>>> lons = [-74, -102, -102, -131, -163, 163, 172, 140, 113,
...         88, 59, 25, -4, -14, -33, -46, -61]
>>> poly_area, poly_perimeter = geod.polygon_area_perimeter(lons, lats)
>>> f"{poly_area:.1f} {poly_perimeter:.1f}"
'13376856682207.4 14710425.4'


Parameters
----------
lons: array, :class:`numpy.ndarray`, list, tuple, or scalar
    An array of longitude values.
lats: array, :class:`numpy.ndarray`, list, tuple, or scalar
    An array of latitude values.
radians: bool, default=False
    If True, the input data is assumed to be in radians.
    Otherwise, the data is assumed to be in degrees.

Returns
-------
(float, float):
    The geodesic area (meters^2) and perimeter (meters) of the polygon.
r   r   )_polygon_area_perimeterr   )r;   rB   rC   rF   s       r   polygon_area_perimeterGeod.polygon_area_perimeter  s8    \ ++$"M$$7$:G , 
 	
r   c                 F    U R                   " UR                  SU06$ ! [        [        4 a     Of = f[	        US5      (       a  U R                  UR                  US9$ [	        US5      (       a(  SnUR                   H  nX0R                  XBS9-  nM     U$ [        S5      e)a;  
.. versionadded:: 2.3.0

Returns the geodesic length (meters) of the shapely geometry.

If it is a Polygon, it will return the sum of the
lengths along the perimeter.
If it is a MultiPolygon or MultiLine, it will return
the sum of the lengths.

Example usage:

>>> from pyproj import Geod
>>> from shapely.geometry import Point, LineString
>>> line_string = LineString([Point(1, 2), Point(3, 4)])
>>> geod = Geod(ellps="WGS84")
>>> f"{geod.geometry_length(line_string):.3f}"
'313588.397'

Parameters
----------
geometry: :class:`shapely.geometry.BaseGeometry`
    The geometry to calculate the length from.
radians: bool, default=False
    If True, the input data is assumed to be in radians.
    Otherwise, the data is assumed to be in degrees.

Returns
-------
float:
    The total geodesic length of the geometry (meters).
rF   exteriorr   geomsr'   Invalid geometry provided.)	r   xyAttributeErrorNotImplementedErrorhasattrgeometry_lengthr   r   r
   )r;   geometryrF   total_lengthgeoms        r   r   Geod.geometry_length  s    B	##X[[B'BB 34 		8Z((''(9(97'KK8W%%L  4 4T 4 KK '455    11c                     U R                   " UR                  SU06$ ! [        [        4 a     Of = f[	        US5      (       aG  U R                  UR                  US9u  p4UR                   H  nU R                  XRS9u  pgX6-  nM     X44$ [	        US5      (       a3  SnSnUR                   H  nU R                  XS9u  piX6-  nXI-  nM     X44$ [        S5      e)a.  
.. versionadded:: 2.3.0

A simple interface for computing the area (meters^2) and perimeter (meters)
of a geodesic polygon as a shapely geometry.

Arbitrarily complex polygons are allowed.  In the case self-intersecting
of polygons the area is accumulated "algebraically", e.g., the areas of
the 2 loops in a figure-8 polygon will partially cancel.  There's no need
to "close" the polygon by repeating the first vertex.

.. note:: lats should be in the range [-90 deg, 90 deg].

.. note:: | There are a few limitations :
          | - only works with areas up to half the size of the globe ;
          | - certain large polygons may return negative values.

.. warning:: The area returned is signed with counter-clockwise (CCW) traversal
             being treated as positive. For polygons, holes should use the
             opposite traversal to the exterior (if the exterior is CCW, the
             holes/interiors should be CW). You can use `shapely.ops.orient` to
             modify the orientation.

If it is a Polygon, it will return the area and exterior perimeter.
It will subtract the area of the interior holes.
If it is a MultiPolygon or MultiLine, it will return
the sum of the areas and perimeters of all geometries.


Example usage:

>>> from pyproj import Geod
>>> from shapely.geometry import LineString, Point, Polygon
>>> geod = Geod(ellps="WGS84")
>>> poly_area, poly_perimeter = geod.geometry_area_perimeter(
...     Polygon(
...         LineString([
...             Point(1, 1), Point(10, 1), Point(10, 10), Point(1, 10)
...         ]),
...         holes=[LineString([Point(1, 2), Point(3, 4), Point(5, 2)])],
...     )
... )
>>> f"{poly_area:.0f} {poly_perimeter:.0f}"
'944373881400 3979008'


Parameters
----------
geometry: :class:`shapely.geometry.BaseGeometry`
    The geometry to calculate the area and perimeter from.
radians: bool, default=False
    If True, the input data is assumed to be in radians.
    Otherwise, the data is assumed to be in degrees.

Returns
-------
(float, float):
    The geodesic area (meters^2) and perimeter (meters) of the polygon.
rF   r   r   r   r'   r   )
r   r   r   r   r   geometry_area_perimeterr   	interiorsr   r
   )
r;   r   rF   
total_areatotal_perimeterholearea_r   	perimeters
             r   r   Geod.geometry_area_perimeter  s   |	..&-   34 		 8Z((*.*F*F!!7 +G +'J !**66t6M"
 + ..8W%%J!O "&">">t">"U"
, ' ..455r   c                 j  > [         R                  5        H  u  pU R                  US   :X  d  M  U R                  UR	                  S5      :X  d7  U R
                  (       a  ML  SU R                  -  UR	                  S5      :X  d  Mp  U R                  R                   SU< S3s  $    [        TU ])  5       $ )Nr   r    r!   r#   z(ellps=))r   r7   r   r    getr   r$   r@   __name__r9   __repr__)r;   r   valsr@   s      r   r   Geod.__repr__S  s    #>>+KEvvc" 66TXXc]*tvv$((4.(H"nn556geYaHH , w!!r   otherc                 p    [        U[        5      (       d  gU R                  5       UR                  5       :H  $ )a  
equality operator == for Geod objects

Example usage:

>>> from pyproj import Geod
>>> # Use Clarke 1866 ellipsoid.
>>> gclrk1 = Geod(ellps='clrk66')
>>> # Define Clarke 1866 using parameters
>>> gclrk2 = Geod(a=6378206.4, b=6356583.8)
>>> gclrk1 == gclrk2
True
>>> # WGS 66 ellipsoid, PROJ style
>>> gwgs66 = Geod('+ellps=WGS66')
>>> # Naval Weapons Lab., 1965 ellipsoid
>>> gnwl9d = Geod('+ellps=NWL9D')
>>> # these ellipsoids are the same
>>> gnwl9d == gwgs66
True
>>> gclrk1 != gnwl9d  # Clarke 1866 is unlike NWL9D
True
F)
isinstance_Geodr   )r;   r   s     r   __eq__Geod.__eq__a  s,    . %''}}%.."222r    )N)FFT)Fre   re   F)r   
__module____qualname____firstlineno____doc__strr:   r	   booltuplerY   rc   r4   r~   r6   rj   r   DEFAULTr   r   r   r   r   r   r   r   r   objectr   __static_attributes____classcell__)r@   s   @r   r   r   s   s   6^
3: ^
4 ^
 ^
L $(Z Z  Z  	Z 
 Z  Z  Z  "Z  
sC}	Z D $(Z Z  Z  	Z 
 Z  Z  Z  "Z  
sC}	Z F o-o- o- 	o-
 o- o- o- o- o- 
o-n &:&B&B###+/b
b
 b
 	b

 b
 b
 b
 b
 b
 b
 $b
 *b
 *b
 *b
 "D[b
  
 !b
 b
V &:&B&B###+/R
R
 R
 	R

 R
 R
 R
 R
 R
 $R
 *R
 *R
 *R
 "D[R
 
 R
 R
h#< #<3 #< #<% #<J#T #TC #T$ #T3 #TL 5:0
0
"0
-10
	ue|	0
d,6 ,6% ,6^ ).W6!%W6	ue|	W6r"# "3F 3t 3 3r   r   azirF   c                 D    [        U 5      u  p#[        X!S9  [        X25      $ )ae  
Reverses the given azimuth (forward <-> backwards)

.. versionadded:: 3.5.0

Accepted numeric scalar or array:

- :class:`int`
- :class:`float`
- :class:`numpy.floating`
- :class:`numpy.integer`
- :class:`list`
- :class:`tuple`
- :class:`array.array`
- :class:`numpy.ndarray`
- :class:`xarray.DataArray`
- :class:`pandas.Series`

Parameters
----------
azi: scalar or array
    The azimuth.
radians: bool, default=False
    If True, the input data is assumed to be in radians.
    Otherwise, the data is assumed to be in degrees.

Returns
-------
scalar or array:
    The reversed azimuth (forward <-> backwards)
r   )r   _reverse_azimuthr   )r   rF   inaziazi_data_types       r   r   r   ~  s%    @ )-EU,--r   r   )r   __all__r(   r|   typingr	   pyproj._geodr   r   r   r   r   r   pyproj.enumsr   pyproj.exceptionsr
   pyproj.listr   pyproj.utilsr   r   r   r   r   r   r4   r   r   r5   r   r   r   r   <module>r      s       & E < - ' % > >?V# V%ueUD0P*Q V05N 5NueUE/I)J 5NpH35 H3V ". ".t ". ".r   