
    \i                        S r SSKrSSKrSSKrSSKrSSKJr  SSKJrJ	r	  SSK
JrJrJrJrJrJrJrJrJrJrJrJr  SSKJrJrJrJrJrJr  SSKJr  SSK J!r!J"r"J#r#  SS	K$J%r%J&r&  SS
K'J(r(  SSK)J*r*  \RV                  " S\RX                  5      r- " S S\R\                  5      r/S-S\0S\1S\24S jjr3S\2S\24S jr4S\2S\24S jr5S\2S\2\6-  4S jr7S\2\6-  4S jr8S\S\14S jr9 " S S5      r: " S S\:5      r; " S S \;5      r< " S! S"\;5      r= " S# S$\;5      r> " S% S&\;5      r? " S' S(\;5      r@ " S) S*\;5      rA " S+ S,\;5      rBg).zx
This module interfaces with PROJ to produce a pythonic interface
to the coordinate reference system (CRS) information.
    N)Callable)AnyOptional)_CRS	AreaOfUseAuthorityMatchInfoAxisCoordinateOperationCoordinateSystemDatum	EllipsoidPrimeMeridian_load_proj_jsonis_projis_wkt)!_GEOGRAPHIC_GRID_MAPPING_NAME_MAP_GRID_MAPPING_NAME_MAP)_INVERSE_GEOGRAPHIC_GRID_MAPPING_NAME_MAP_INVERSE_GRID_MAPPING_NAME_MAP_horizontal_datum_from_params_try_list_if_string)ToWGS84Transformation)Cartesian2DCSEllipsoidal2DCS
VerticalCS)ProjVersion
WktVersion)CRSError)Geoda9  
    \+              # parameter starts with '+' character
    (?P<param>\w+)    # capture parameter name
    \=?             # match both key only and key-value parameters
    (?P<value>\S+)? # capture all characters up to next space (None if no value)
    \s*?            # consume remaining whitespace, if any
c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )CRSLocal6   zu
Threading local instance for cython CRS class.

For more details, see:
https://github.com/pyproj4/pyproj/issues/782
c                 0   > S U l         [        TU ]	  5         g N)crssuper__init__)self	__class__s    Q/var/www/html/kml_chatgpt/mouzaenv/lib/python3.13/site-packages/pyproj/crs/crs.pyr'   CRSLocal.__init__>   s        r%   )__name__
__module____qualname____firstlineno____doc__r'   __static_attributes____classcell__r)   s   @r*   r!   r!   6   s     r,   r!   
projparams
allow_jsonreturnc           	      4   [        U [        5      (       d  [        S5      eSU ;  a#  SU ;  a  U(       a  [        R                  " U 5      $ / nU R                  5        H  u  p4[        U[        [        45      (       a+  SR                  U Vs/ s H  n[        U5      PM     sn5      nUb  [        U5      S:X  a  UR                  SU 35        Ms  [        U5      S:X  a  M  UR                  SU SU 35        M     [        S	R                  U5      5      $ s  snf )
NzCRS input is not a dictprojinit,True+False= )
isinstancedictr   jsondumpsitemslisttuplejoinstrappend_prepare_from_string)r6   r7   pjargskeyvaluevals         r*   _prepare_from_dictrQ   C   s    j$''011ZF*$<zz*%%F &&(
edE]++HH%8%3c#h%89E=CJ&0MMAcU)$Z7"MMAcU!E7+, )   011 9s   D
in_crs_stringc                 0   [         R                  " SSU R                  5       5      n SnU R                  U5      (       dp  / nSnU R	                  5        HG  nU(       d,  UR                  U5      (       a  UR                  SU5        SnM6  UR                  U5        MI     SR                  U5      n SU ;  a  S	U ;   a  U S
-  n OU S-  n U R                  SS5      R                  5       n U R                  S5      (       a  [        R                  " S[        SS9  U $ )Nz[\s+]?=[\s+]?r@   )+initz+projr;   r:   Fr   TrA   ztype=crsr>   z
 +type=crsz	 type=crsz
+init=EPSGz
+init=epsg)rT   r;   z'+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6   )
stacklevel)resublstrip
startswithsplitinsertrK   rI   replacestripwarningswarnFutureWarning)rR   starting_paramskvpairsfirst_item_insertedkvpairs        r*   _prepare_from_proj_stringrf   Y   s   FF+S-2F2F2HIM8O##O44##))+F&F,=,=o,N,Nq&)&*#v& , ) &-\)M[(M ")),EKKMM 122,
 	
 r,   c                 Z   [        U [        5      (       d  [        S5      eU (       d  [        SU < 35      eSU ;   a5   [        R                  " U SS9nU(       d  [        S5      e[        U5      n U $ [        U 5      (       a  [        U 5      n U $ ! [
         a  n[        S5      UeS nAff = f)NzCRS input is not a stringz CRS string is empty or invalid: {F)strictz'CRS appears to be JSON but is not validzCRS is empty JSON)	rB   rJ   r   rD   loads
ValueErrorrQ   r   rf   )rR   crs_dicterrs      r*   rL   rL      s    mS))2339-9JKLL
m	Ozz->H .//*84  
		1-@  	ODE3N	Os   B 
B*B%%B*	auth_name	auth_codec                     U  SU 3$ )N: )rn   ro   s     r*   _prepare_from_authorityrs      s    [)%%r,   c                     [        SU 5      $ )NEPSG)rs   ro   s    r*   _prepare_from_epsgrw      s    "6955r,   c                     [        U [        5      (       a  g[        U [        5      (       a  U R                  5       (       a  g[	        U S5      (       a  U R
                  S:X  a  gg)NTshaperr   F)rB   intrJ   	isnumerichasattrry   rv   s    r*   _is_epsg_coder}      sN    )S!!)S!!i&9&9&;&;y'""y"'<r,   c                      \ rS rSrSrS\S\S-  SS4S jjr\S 5       r\	S\
S	\
\-  SS 4S
 j5       r\	S	\
\-  SS 4S j5       r\	S\
SS 4S j5       r\	S\
SS 4S j5       r\	S\
SS 4S j5       rS\
4S jr\	S\SS 4S j5       rS\S-  4S jr\	S\SS 4S j5       r\	S\
SS 4S j5       r\	S\SS 4S j5       rS\4S jr\R6                  S4S\\
-  S\S\4S  jjr\   S]S!\S"\S-  S#\S-  S$\S-  SS 4
S% jj5       rS\ \   4S& jr!S'\S\4S( jr"S^S'\S)\S\4S* jjr#\S\$S    4S+ j5       r%\S\$S    4S, j5       r&\S\$S    4S- j5       r'\S\ S    4S. j5       r(\S\
S-  4S/ j5       r)\S\
4S0 j5       r*\S\
4S1 j5       r+\S\ \,   4S2 j5       r-\S\.S-  4S3 j5       r/\S\0S-  4S4 j5       r1\S\2S-  4S5 j5       r3\S\4S-  4S6 j5       r5\S\6S-  4S7 j5       r7\S\8S-  4S8 j5       r9\S\
4S9 j5       r:\S\
4S: j5       r;\R6                  SS4S;\\
-  S<\S=\S-  S\
4S> jjr<S_S<\S?\S\
4S@ jjr=S\4SA jr>\?R                  4S;\?\-  S\
4SB jjrAS`SC\S\S-  4SD jjrBSaS\
S-  SC\4SE jjrC SaS\
S-  SC\S\ \D   4SF jjrES\SG\
S-  SS 4SH jjrFS\SG\
S-  SS 4SI jjrG\S\4SJ j5       rH\S\4SK j5       rI\S\4SL j5       rJ\S\4SM j5       rK\S\4SN j5       rL\S\4SO j5       rM\S\4SP j5       rN\SQ 5       rO\S\4SR j5       rPS\ S    4SS jrQS'\RS\4ST jrSS\\
\
4   4SU jrTSV\\
\4   4SW jrUS\4SX jrVS\
4SY jrWS\
4SZ jrXS[rYg)bCRS   a  
A pythonic Coordinate Reference System manager.

.. versionadded:: 2.0.0

See: :c:func:`proj_create`

The functionality is based on other fantastic projects:

* `rasterio <https://github.com/mapbox/rasterio/blob/c13f0943b95c0eaa36ff3f620bd91107aa67b381/rasterio/_crs.pyx>`_
* `opendatacube <https://github.com/opendatacube/datacube-core/blob/83bae20d2a2469a6417097168fd4ede37fd2abe5/datacube/utils/geometry/_base.py>`_

Attributes
----------
srs: str
    The string form of the user input used to create the CRS.

Nr6   r8   c                    SnU(       a  [        U[        5      (       a  UR                  nO[        U5      (       a  [	        U5      nO[        U[
        5      (       a  [        U5      nO[        U[        5      (       a  [        U5      nOd[        U[        [        45      (       a  [        U5      S:X  a	  [        U6 nO1[        US5      (       a  UR                  5       nO[        SU< 35      eU(       a%  [        USS9n[        SR!                  X445      5      nX0l        [#        5       U l        [        U[        5      (       a  XR$                  l        g[        U R                  5      U R$                  l        g)	uU  
Initialize a CRS class instance with:
  - PROJ string
  - Dictionary of PROJ parameters
  - PROJ keyword arguments for parameters
  - JSON string with PROJ parameters
  - CRS WKT string
  - An authority string [i.e. 'epsg:4326']
  - An EPSG integer code [i.e. 4326]
  - A tuple of ("auth_name": "auth_code") [i.e ('epsg', '4326')]
  - An object with a `to_wkt` method.
  - A :class:`pyproj.crs.CRS` class

Example usage:

>>> from pyproj import CRS
>>> crs_utm = CRS.from_user_input(26915)
>>> crs_utm
<Projected CRS: EPSG:26915>
Name: NAD83 / UTM zone 15N
Axis Info [cartesian]:
- E[east]: Easting (metre)
- N[north]: Northing (metre)
Area of Use:
- name: North America - 96°W to 90°W and NAD83 by country
- bounds: (-96.0, 25.61, -90.0, 84.0)
Coordinate Operation:
- name: UTM zone 15N
- method: Transverse Mercator
Datum: North American Datum 1983
- Ellipsoid: GRS 1980
- Prime Meridian: Greenwich
<BLANKLINE>
>>> crs_utm.area_of_use.bounds
(-96.0, 25.61, -90.0, 84.0)
>>> crs_utm.ellipsoid
ELLIPSOID["GRS 1980",6378137,298.257222101,
    LENGTHUNIT["metre",1],
    ID["EPSG",7019]]
>>> crs_utm.ellipsoid.inverse_flattening
298.257222101
>>> crs_utm.ellipsoid.semi_major_metre
6378137.0
>>> crs_utm.ellipsoid.semi_minor_metre
6356752.314140356
>>> crs_utm.prime_meridian
PRIMEM["Greenwich",0,
    ANGLEUNIT["degree",0.0174532925199433],
    ID["EPSG",8901]]
>>> crs_utm.prime_meridian.unit_name
'degree'
>>> crs_utm.prime_meridian.unit_conversion_factor
0.017453292519943295
>>> crs_utm.prime_meridian.longitude
0.0
>>> crs_utm.datum
DATUM["North American Datum 1983",
    ELLIPSOID["GRS 1980",6378137,298.257222101,
        LENGTHUNIT["metre",1]],
    ID["EPSG",6269]]
>>> crs_utm.coordinate_system
CS[Cartesian,2],
    AXIS["(E)",east,
        ORDER[1],
        LENGTHUNIT["metre",1,
            ID["EPSG",9001]]],
    AXIS["(N)",north,
        ORDER[2],
        LENGTHUNIT["metre",1,
            ID["EPSG",9001]]]
>>> print(crs_utm.coordinate_operation.to_wkt(pretty=True))
CONVERSION["UTM zone 15N",
    METHOD["Transverse Mercator",
        ID["EPSG",9807]],
    PARAMETER["Latitude of natural origin",0,
        ANGLEUNIT["degree",0.0174532925199433],
        ID["EPSG",8801]],
    PARAMETER["Longitude of natural origin",-93,
        ANGLEUNIT["degree",0.0174532925199433],
        ID["EPSG",8802]],
    PARAMETER["Scale factor at natural origin",0.9996,
        SCALEUNIT["unity",1],
        ID["EPSG",8805]],
    PARAMETER["False easting",500000,
        LENGTHUNIT["metre",1],
        ID["EPSG",8806]],
    PARAMETER["False northing",0,
        LENGTHUNIT["metre",1],
        ID["EPSG",8807]],
    ID["EPSG",16015]]
>>> crs = CRS(proj='utm', zone=10, ellps='WGS84')
>>> print(crs.to_wkt(pretty=True))
PROJCRS["unknown",
    BASEGEOGCRS["unknown",
        DATUM["Unknown based on WGS84 ellipsoid",
            ELLIPSOID["WGS 84",6378137,298.257223563,
                LENGTHUNIT["metre",1],
                ID["EPSG",7030]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8901]]],
    CONVERSION["UTM zone 10N",
        METHOD["Transverse Mercator",
            ID["EPSG",9807]],
        PARAMETER["Latitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",-123,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["Scale factor at natural origin",0.9996,
            SCALEUNIT["unity",1],
            ID["EPSG",8805]],
        PARAMETER["False easting",500000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]],
        ID["EPSG",16010]],
    CS[Cartesian,2],
        AXIS["(E)",east,
            ORDER[1],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]],
        AXIS["(N)",north,
            ORDER[2],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]]]
>>> geod = crs.get_geod()
>>> f"+a={geod.a:.0f} +f={geod.f:.8f}"
'+a=6378137 +f=0.00335281'
>>> crs.is_projected
True
>>> crs.is_geographic
False
 rU   to_wktzInvalid CRS input: F)r7   rA   N)rB   r   srsr}   rw   rJ   rL   rC   rQ   rG   rH   lenrs   r|   r   r   rI   r!   _localr%   )r(   r6   kwargs
projstring
projkwargss        r*   r'   CRS.__init__   s   T 
*d++'^^
z**/
;
J,,1*=
J--/
;
Ju663z?a;O4jA
X..'..0
!4ZNCDD+FuEJ-chh
7O.PQJjj$''(KKO"488nDKKOr,   c                     U R                   R                  c$  [        U R                  5      U R                   l        U R                   R                  $ )z8
Retrieve the Cython based _CRS object for this thread.
)r   r%   r   r   r(   s    r*   _crsCRS._crs`  s3    
 ;;??""488nDKKO{{r,   rn   codec                 6    U R                  [        X5      5      $ )z
.. versionadded:: 2.2.0

Make a CRS from an authority name and authority code

Parameters
----------
auth_name: str
    The name of the authority.
code : int or str
    The code used by the authority.

Returns
-------
CRS
)from_user_inputrs   )clsrn   r   s      r*   from_authorityCRS.from_authorityi  s    $ ""#:9#KLLr,   c                 6    U R                  [        U5      5      $ )zmMake a CRS from an EPSG code

Parameters
----------
code : int or str
    An EPSG code.

Returns
-------
CRS
)r   rw   )r   r   s     r*   	from_epsgCRS.from_epsg}  s     ""#5d#;<<r,   in_proj_stringc                 r    [        U5      (       d  [        SU 35      eU R                  [        U5      5      $ )z
.. versionadded:: 2.2.0

Make a CRS from a PROJ string

Parameters
----------
in_proj_string : str
    A PROJ string.

Returns
-------
CRS
zInvalid PROJ string: )r   r   r   rf   )r   r   s     r*   
from_proj4CRS.from_proj4  s:      ~&&2>2BCDD""#<^#LMMr,   in_wkt_stringc                 r    [        U5      (       d  [        SU 35      eU R                  [        U5      5      $ )z
.. versionadded:: 2.2.0

Make a CRS from a WKT string

Parameters
----------
in_wkt_string : str
    A WKT string.

Returns
-------
CRS
zInvalid WKT string: )r   r   r   rL   )r   r   s     r*   from_wktCRS.from_wkt  s9      m$$1-ABB""#7#FGGr,   rR   c                 6    U R                  [        U5      5      $ )a
  
Make a CRS from:

Initialize a CRS class instance with:
 - PROJ string
 - JSON string with PROJ parameters
 - CRS WKT string
 - An authority string [i.e. 'epsg:4326']

Parameters
----------
in_crs_string : str
    An EPSG, PROJ, or WKT string.

Returns
-------
CRS
)r   rL   )r   rR   s     r*   from_stringCRS.from_string  s    ( ""#7#FGGr,   c                 h    U R                  SS9nU(       a  SR                  U5      $ U R                  $ )z
.. versionadded:: 2.2.0

Convert the CRS to a string.

It attempts to convert it to the authority string.
Otherwise, it uses the string format of the user
input to create the CRS.

Returns
-------
str
d   min_confidencerq   )to_authorityrI   r   )r(   	auth_infos     r*   	to_stringCRS.to_string  s2     %%S%9	88I&&xxr,   rO   c                 8    [        X5      (       a  U$ U " U40 UD6$ a  
Initialize a CRS class instance with:
  - PROJ string
  - Dictionary of PROJ parameters
  - PROJ keyword arguments for parameters
  - JSON string with PROJ parameters
  - CRS WKT string
  - An authority string [i.e. 'epsg:4326']
  - An EPSG integer code [i.e. 4326]
  - A tuple of ("auth_name": "auth_code") [i.e ('epsg', '4326')]
  - An object with a `to_wkt` method.
  - A :class:`pyproj.crs.CRS` class

Parameters
----------
value : obj
    A Python int, dict, or str.

Returns
-------
CRS
)rB   )r   rO   r   s      r*   r   CRS.from_user_input  s$    0 e!!L5#F##r,   c                     U R                   c  g[        U R                   R                  U R                   R                  U R                   R                  S9$ )zK
Returns
-------
pyproj.geod.Geod:
    Geod object based on the ellipsoid.
N)arfb)	ellipsoidr   semi_major_metreinverse_flatteningsemi_minor_metrer   s    r*   get_geodCRS.get_geod  sE     >>!nn--~~00nn--
 	
r,   	proj_dictc                 6    U R                  [        U5      5      $ )z
.. versionadded:: 2.2.0

Make a CRS from a dictionary of PROJ parameters.

Parameters
----------
proj_dict : str
    PROJ params in dict format.

Returns
-------
CRS
)r   rQ   )r   r   s     r*   	from_dictCRS.from_dict  s      ""#5i#@AAr,   crs_jsonc                 6    U R                  [        U5      5      $ )z
.. versionadded:: 2.4.0

Create CRS from a CRS JSON string.

Parameters
----------
crs_json: str
    CRS JSON string.

Returns
-------
CRS
)r   r   )r   r   s     r*   	from_jsonCRS.from_json  s      ""?8#<==r,   rl   c                 L    U R                  [        R                  " U5      5      $ )z
.. versionadded:: 2.4.0

Create CRS from a JSON dictionary.

Parameters
----------
crs_dict: dict
    CRS dictionary.

Returns
-------
CRS
)r   rD   rE   )r   rl   s     r*   from_json_dictCRS.from_json_dict,  s      ""4::h#788r,   c                     U R                  5       nUc  0 $ S n0 n[        R                  U5       H+  nUR                  5       u  pVUb  U" U5      nUSLd  M'  XcU'   M-     U$ )af  
.. versionadded:: 2.2.0

Converts the CRS to dictionary of PROJ parameters.

.. warning:: You will likely lose important projection
  information when converting to a PROJ string from
  another format. See: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems

Returns
-------
dict:
    PROJ params in dict format.

c                     U R                  5       S:X  a  gU R                  5       S:X  a  g [        U 5      $ ! [         a     Of = f [        U 5      $ ! [         a     Of = f[	        U 5      $ )NtrueTfalseF)lowerrz   rk   floatr   )rP   s    r*   _parseCRS.to_dict.<locals>._parseS  sp    yy{f$yy{g%3x Sz! &s++s!   
7 
AA
A 
A A F)to_proj4_RE_PROJ_PARAMfinditergroups)r(   proj_stringr   r   paramrN   rO   s          r*   to_dictCRS.to_dict>  sn    " mmoI	, 	#,,[9EJC uE!!&# : r,   Fwkt_versionerrcheckc                    SU R                  U5      0nU R                  (       a  U R                  (       a  U R                  R                  (       ah  U R                  (       aW  U R                  R                  UUS9nUR                  S5        UR                  U5        U R                  R                  US'   U$ U R                  (       aF  U R                   H4  nUR                  XS9nUR                  S5        UR                  U5        M6     U$ U R                  (       aM  U R                  5       nSU;   a  US   S   US'   U R                  (       a  U R                  R                  US'   U$ U R                  (       af  UR                  U R                  R                  U R                  R                   U R                  R"                  S9  U R                  R                  US	'   U R$                  (       a2  U R$                  R&                  US
'   U R$                  R                  US'   U R(                  (       aW  U R(                  R                  US'   U R(                  R                  (       a#  U R(                  R                  R                  US'   U R*                  (       a  U R                  (       a  U R                  R,                  R/                  5       [0        ;  a;  U(       a-  [2        R4                  " SU R                  R,                   35        SUS   0$ UR                  [0        U R                  R,                  R/                  5          " U R                  5      5        U$ SUS'   U$ SnU R                  (       d,  U R6                  (       a  U R                  nU R                  US'   U(       d  SO)UR,                  R/                  5       R9                  SS5      nU[:        ;  aO  U(       aA  U(       a$  [2        R4                  " SUR,                   35        O[2        R4                  " S5        SUS   0$ UR                  [:        U   " U5      5        U$ )a  
.. versionadded:: 2.2.0

This converts a :obj:`pyproj.crs.CRS` object
to a Climate and Forecast (CF) Grid Mapping Version 1.8 dict.

:ref:`build_crs_cf`

Parameters
----------
wkt_version: str or pyproj.enums.WktVersion
    Version of WKT supported by CRS.to_wkt.
    Default is :attr:`pyproj.enums.WktVersion.WKT2_2019`.
errcheck: bool, default=False
    If True, will warn when parameters are ignored.

Returns
-------
dict:
    CF-1.8 version of the projection.

crs_wkt)r   r   towgs84geoid_modelname
geoid_namegeopotential_datum_name)semi_major_axissemi_minor_axisr   reference_ellipsoid_namelongitude_of_prime_meridianprime_meridian_namegeographic_crs_namehorizontal_datum_namez"Unsupported coordinate operation: latitude_longitudegrid_mapping_nameNprojected_crs_namerA   _zCoordinate operation not found.)r   is_boundcoordinate_operationr   
source_crsto_cfpopupdateis_compoundsub_crs_listis_verticalto_json_dictdatumr   r   r   r   r   prime_meridian	longitudegeodetic_crsis_geographicmethod_namer   r   r_   r`   is_projectedr]   r   )	r(   r   r   cf_dictsub_cfsub_crs	vert_jsonr   coordinate_operation_names	            r*   r   	CRS.to_cfl  s   8 $-dkk+.F"G MM))))11%)__%:%:'! &; &F JJy!NN6"!%!:!:!B!BGIN ,, ;R

9%v& - N ))+I	)(1-(@(H%zz59ZZ__12N >>NN $ ? ? $ ? ?#'>>#D#D  
 37..2E2EG./595H5H5R5RG12-1-@-@-E-EG)* -1->->-C-CG)*  &&373D3D3J3J3O3O/0((--99??ADE   @#88DDEG &wy'9::=11==CCE//1 N 0D+,N  $}}!2!2#'#<#< ,0IIG() ( %11779AA#sK 	"
 %,JJ'MM</;;<>
 MM"CDwy122*+DE$	

 r,   in_cfellipsoidal_cscartesian_csvertical_csc                    SnSU ;   a  [        U S   5      $ SU ;   a  [        U S   5      $ U R                  S5      nUc  [        S5      e[        U 5      n [        U   nU R                  S5      nU(       a  [        U=(       d    SUUS	9n	OfU(       aV  X;  aQ  [        U5      n	UbB  U	R                  5       n
[        R                  " U5      R                  5       U
S
'   [        U
5      n	O	[        US9n	US:X  a  U	$ Ub  [        U	U" U 5      US9$  [        U   n[        U R                  SS5      U" U 5      U	US9nSnSU ;   a+  [        US[        UR                  /[!        U S   5      Q76 S9nSU ;  a  U=(       d    U$ [#        SU S   U R                  S5      US9n[%        SU=(       d    UU/S9$ ! [
         a    Sn GNaf = f! [
         a    [        SU 35      Sef = f)a  
.. versionadded:: 2.2.0

.. versionadded:: 3.0.0 ellipsoidal_cs, cartesian_cs, vertical_cs

This converts a Climate and Forecast (CF) Grid Mapping Version 1.8
dict to a :obj:`pyproj.crs.CRS` object.

:ref:`build_crs_cf`

Parameters
----------
in_cf: dict
    CF version of the projection.
ellipsoidal_cs: Any, optional
    Input to create an Ellipsoidal Coordinate System.
    Anything accepted by :meth:`pyproj.crs.CoordinateSystem.from_user_input`
    or an Ellipsoidal Coordinate System created from :ref:`coordinate_system`.
cartesian_cs: Any, optional
    Input to create a Cartesian Coordinate System.
    Anything accepted by :meth:`pyproj.crs.CoordinateSystem.from_user_input`
    or :class:`pyproj.crs.coordinate_system.Cartesian2DCS`.
vertical_cs: Any, optional
    Input to create a Vertical Coordinate System accepted by
    :meth:`pyproj.crs.CoordinateSystem.from_user_input`
    or :class:`pyproj.crs.coordinate_system.VerticalCS`

Returns
-------
CRS
)unknown	undefinedr   spatial_refr   Nz4CF projection parameters missing 'grid_mapping_name'r   r  )r   r   r   coordinate_system)r   r   )base_crs
conversionr   zUnsupported grid mapping name: r   )r   r  r   r   r   zWGS 84)r   
target_crstransformationr   r   )r   r   r   r  )r   
components)r   getr   r   r   KeyErrorGeographicCRSr   r   r   DerivedGeographicCRSr   ProjectedCRSBoundCRSr   r   r   VerticalCRSCompoundCRS)r   r   r   r  unknown_namesr   r   geographic_conversion_methodr   geographic_crsgeographic_crs_jsonconversion_methodprojected_crs	bound_crsvertical_crss                  r*   from_cfCRS.from_cf  sX   P 1uY'((E!u]+,,!II&9:$QRR .e4	012CD ) $ii(=>"/(7K-#N
 !%8%M !45N)&4&A&A&C#$44^DQQS $$78 "%%8!9*.IN 44!!'3''7>- 	 67H I
 %/=(/'%	
 	 (#4!.. 1DU9EU1V I %E1-- #12		,/#	
 )*D}l)S
 	
C  	0+/(	0@  	12C1DE	s   	F1 	G 1G GGc                 2   / nS nU R                   S:X  Ga  U R                  (       a  U R                  R                  5       nUR                  SS5      R	                  5       R                  S5      n[        U5      S:X  a  U S3nU R                  S   nS	S	UR                  S
S5      R                  5       R                  SS5      SS.nUR                  R                  5       R                  S
S5      R	                  5       nU(       a
  U SU 3US'   UR                  U5        U R                  (       a0  UR                  U R                  R                  U" U 5      S95        U$ U R                  (       ap  U R                   (       a_  U R                   R                  (       aD  UR                  U R                   R                  R                  U" U R                   5      S95        U$ U R"                   H"  nUR                  UR%                  5       5        M$     U$ )z
.. versionadded:: 3.0.0

This converts all coordinate systems (cs) in the CRS
to a list of Climate and Forecast (CF) Version 1.8 dicts.

:ref:`build_crs_cf`

Returns
-------
list[dict]:
    CF-1.8 version of the coordinate systems.
c                      U R                   =(       a+    U R                   R                  R                  5       [        ;   $ ! [         a     gf = f)NF)r   r   r   r   r  r-   s    r*   rotated_pole"CRS.cs_to_cf.<locals>.rotated_pole~  sP    ,, A00<<BBD@A
  s   =A   
AAzTemporal CRStime_originz
1875-05-20zZ   z-01-01r   timecalendarproleptic_gregorianrA   r   T)standard_name	long_namer&  axisr   z since units)r   )	type_namer   r   r  r^   rstripr   	axis_infor   r]   	unit_namerK   r  extendr   r   r   r   cs_to_cf)	r(   cf_axis_listr   
datum_jsonoriginr+  cf_temporal_axisr0  r   s	            r*   r2  CRS.cs_to_cfn  s    	 >>^+

002J^^M<@FFHOOPTUF6{a"86*>>!$D!'#NN:/DEUWWS#&	  ,,.66z2FLLNI/8k,I ) 01!!&&,,,t:L,M  ]]t4??3T3T1177!-doo!> 8    ,,##G$4$4$67 -r,   otherc                      [         R                  U5      nU R                  R	                  UR                  5      $ ! [         a     gf = f)a
  
Check if the CRS objects are the exact same.

Parameters
----------
other: Any
    Check if the other CRS is the exact same to this object.
    If the other object is not a CRS, it will try to create one.
    On Failure, it will return False.

Returns
-------
bool
F)r   r   r   r   is_exact_samer(   r8  s     r*   r:  CRS.is_exact_same  sF    	''.E yy&&uzz22  		s   < 
A	A	ignore_axis_orderc                      [         R                  U5      nU R                  R	                  UR                  US9$ ! [         a     gf = f)a  

.. versionadded:: 2.5.0

Check if the CRS objects are equivalent.

Parameters
----------
other: Any
    Check if the other object is equivalent to this object.
    If the other object is not a CRS, it will try to create one.
    On Failure, it will return False.
ignore_axis_order: bool, default=False
    If True, it will compare the CRS class and ignore the axis order.

Returns
-------
bool
F)r=  )r   r   r   r   equals)r(   r8  r=  s      r*   r?  
CRS.equals  sL    (	''.E yy

>OPP  		s   ; 
AAc                 ~    U R                   R                  c  S$ U R                  U R                   R                  5      $ zb
.. versionadded:: 2.2.0

Returns
-------
CRS:
    The geodeticCRS / geographicCRS from the CRS.

N)r   r   r)   r   s    r*   r   CRS.geodetic_crs  s;     yy%%- 	
 		 6 67	
r,   c                 ~    U R                   R                  c  S$ U R                  U R                   R                  5      $ z{
The base CRS of a BoundCRS or a DerivedCRS/ProjectedCRS,
or the source CRS of a CoordinateOperation.

Returns
-------
CRS
N)r   r   r)   r   s    r*   r   CRS.source_crs  s;     yy##+ 	
 		 4 45	
r,   c                 ~    U R                   R                  c  S$ U R                  U R                   R                  5      $ zz
.. versionadded:: 2.2.0

Returns
-------
CRS:
    The hub CRS of a BoundCRS or the target CRS of a CoordinateOperation.

N)r   r	  r)   r   s    r*   r	  CRS.target_crs  s;     yy##+ 	
 		 4 45	
r,   c                 v    U R                   R                   Vs/ s H  oR                  U5      PM     sn$ s  snf zd
If the CRS is a compound CRS, it will return a list of sub CRS objects.

Returns
-------
list[CRS]
)r   r   r)   r(   r   s     r*   r   CRS.sub_crs_list  s/     8<yy7M7MN7MGw'7MNNNs   6c                    U R                   (       a'  U R                  (       a  U R                  R                  $ U R                  (       a3  U R                   H"  nUR                  (       d  M  UR                  s  $    gU R                  (       a^  SU R                  R
                  R                  5       ;   a6  U R                  R
                  R                  5       R                  S5      S   $ g)z
.. versionadded:: 2.6.0

Finds the UTM zone in a Projected CRS, Bound CRS, or Compound CRS

Returns
-------
str | None:
    The UTM zone number and letter if applicable.
zUTM ZONEz	UTM ZONE N)r   r   utm_zoner   r   r   upperr[   rL  s     r*   rP  CRS.utm_zone  s     ==T__??+++,,###"+++ - 	 %%d77<<BBDD,,11779??LRPPr,   c                 .    U R                   R                  $ )zP
Returns
-------
str:
    The name of the CRS (from :cpp:func:`proj_get_name`).
)r   r   r   s    r*   r   CRS.name1  s     yy~~r,   c                 .    U R                   R                  $ )zB
Returns
-------
str:
    The name of the type of the CRS object.
)r   r-  r   s    r*   r-  CRS.type_name;  s     yy"""r,   c                 .    U R                   R                  $ )z
Retrieves all relevant axis information in the CRS.
If it is a Bound CRS, it gets the axis list from the Source CRS.
If it is a Compound CRS, it gets the axis list from the Sub CRS list.

Returns
-------
list[Axis]:
    The list of axis information.
)r   r/  r   s    r*   r/  CRS.axis_infoE  s     yy"""r,   c                 .    U R                   R                  $ )zS
Returns
-------
AreaOfUse:
    The area of use object with associated attributes.
)r   area_of_user   s    r*   rZ  CRS.area_of_useS  s     yy$$$r,   c                 .    U R                   R                  $ )zj
.. versionadded:: 2.2.0

Returns
-------
Ellipsoid:
    The ellipsoid object with associated attributes.
)r   r   r   s    r*   r   CRS.ellipsoid]  s     yy"""r,   c                 .    U R                   R                  $ )zs
.. versionadded:: 2.2.0

Returns
-------
PrimeMeridian:
    The prime meridian object with associated attributes.
)r   r   r   s    r*   r   CRS.prime_meridiani       yy'''r,   c                 .    U R                   R                  $ )z0
.. versionadded:: 2.2.0

Returns
-------
Datum
)r   r   r   s    r*   r   	CRS.datumu  s     yyr,   c                 .    U R                   R                  $ )z;
.. versionadded:: 2.2.0

Returns
-------
CoordinateSystem
)r   r  r   s    r*   r  CRS.coordinate_system  s     yy***r,   c                 .    U R                   R                  $ )z>
.. versionadded:: 2.2.0

Returns
-------
CoordinateOperation
)r   r   r   s    r*   r   CRS.coordinate_operation  s     yy---r,   c                 .    U R                   R                  $ )zI
.. versionadded:: 2.4.0

Returns
-------
str:
    Remarks about object.
)r   remarksr   s    r*   rh  CRS.remarks  s     yy   r,   c                 .    U R                   R                  $ )zD
.. versionadded:: 2.4.0

Returns
-------
str:
    Scope of object.
)r   scoper   s    r*   rk  	CRS.scope  s     yyr,   versionprettyoutput_axis_rulec                 ^    U R                   R                  XUS9nUc  [        SU S35      eU$ )a  
Convert the projection to a WKT string.

Version options:
  - WKT2_2015
  - WKT2_2015_SIMPLIFIED
  - WKT2_2019
  - WKT2_2019_SIMPLIFIED
  - WKT1_GDAL
  - WKT1_ESRI

.. versionadded:: 3.6.0 output_axis_rule

Parameters
----------
version: pyproj.enums.WktVersion, optional
    The version of the WKT output.
    Default is :attr:`pyproj.enums.WktVersion.WKT2_2019`.
pretty: bool, default=False
    If True, it will set the output to be a multiline string.
output_axis_rule: bool, optional, default=None
    If True, it will set the axis rule on any case. If false, never.
    None for AUTO, that depends on the CRS and version.

Returns
-------
str
)rm  rn  ro  z.CRS cannot be converted to a WKT string of a 'zG' version. Select a different version of a WKT string or edit your CRS.)r   r   r   )r(   rm  rn  ro  wkts        r*   r   
CRS.to_wkt  sS    D ii=M  
 ;@	 JO O  
r,   indentationc                 T    U R                   R                  XS9nUc  [        S5      eU$ )a"  
.. versionadded:: 2.4.0

Convert the object to a JSON string.

Parameters
----------
pretty: bool, default=False
    If True, it will set the output to be a multiline string.
indentation: int, default=2
    If pretty is True, it will set the width of the indentation.

Returns
-------
str
)rn  rs  z.CRS cannot be converted to a PROJ JSON string.)r   to_jsonr   )r(   rn  rs  	proj_jsons       r*   ru  CRS.to_json  s3    " II%%V%M	KLLr,   c                 6    U R                   R                  5       $ )zY
.. versionadded:: 2.4.0

Convert the object to a JSON dictionary.

Returns
-------
dict
)r   r   r   s    r*   r   CRS.to_json_dict  s     yy%%''r,   c                 T    U R                   R                  US9nUc  [        S5      eU$ )a  
Convert the projection to a PROJ string.

.. warning:: You will likely lose important projection
  information when converting to a PROJ string from
  another format. See:
  https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems

Parameters
----------
version: pyproj.enums.ProjVersion
    The version of the PROJ string output.
    Default is :attr:`pyproj.enums.ProjVersion.PROJ_4`.

Returns
-------
str
)rm  z)CRS cannot be converted to a PROJ string.)r   r   r   )r(   rm  r:   s      r*   r   CRS.to_proj4  s1    & yy!!'!2<FGGr,   r   c                 4    U R                   R                  US9$ )a  
Return the EPSG code best matching the CRS
or None if it a match is not found.

Example:

>>> from pyproj import CRS
>>> ccs = CRS("EPSG:4328")
>>> ccs.to_epsg()
4328

If the CRS is bound, you can attempt to get an epsg code from
the source CRS:

>>> from pyproj import CRS
>>> ccs = CRS("+proj=geocent +datum=WGS84 +towgs84=0,0,0")
>>> ccs.to_epsg()
>>> ccs.source_crs.to_epsg()
4978
>>> ccs == CRS.from_epsg(4978)
False

Parameters
----------
min_confidence: int, default=70
    A value between 0-100 where 100 is the most confident.
    :ref:`min_confidence`


Returns
-------
int | None:
    The best matching EPSG code matching the confidence level.
r   )r   to_epsg)r(   r   s     r*   r}  CRS.to_epsg  s    F yy   ??r,   c                 4    U R                   R                  XS9$ )a9  
.. versionadded:: 2.2.0

Return the authority name and code best matching the CRS
or None if it a match is not found.

Example:

>>> from pyproj import CRS
>>> ccs = CRS("EPSG:4328")
>>> ccs.to_authority()
('EPSG', '4328')

If the CRS is bound, you can get an authority from
the source CRS:

>>> from pyproj import CRS
>>> ccs = CRS("+proj=geocent +datum=WGS84 +towgs84=0,0,0")
>>> ccs.to_authority()
>>> ccs.source_crs.to_authority()
('EPSG', '4978')
>>> ccs == CRS.from_authorty('EPSG', '4978')
False

Parameters
----------
auth_name: str, optional
    The name of the authority to filter by.
min_confidence: int, default=70
    A value between 0-100 where 100 is the most confident.
    :ref:`min_confidence`

Returns
-------
tuple(str, str) or None:
    The best matching (<auth_name>, <code>) for the confidence level.
rn   r   )r   r   r(   rn   r   s      r*   r   CRS.to_authority9  s$    L yy%% & 
 	
r,   c                 4    U R                   R                  XS9$ )al  
.. versionadded:: 3.2.0

Return the authority names and codes best matching the CRS.

Example:

>>> from pyproj import CRS
>>> ccs = CRS("EPSG:4328")
>>> ccs.list_authority()
[AuthorityMatchInfo(auth_name='EPSG', code='4326', confidence=100)]

If the CRS is bound, you can get an authority from
the source CRS:

>>> from pyproj import CRS
>>> ccs = CRS("+proj=geocent +datum=WGS84 +towgs84=0,0,0")
>>> ccs.list_authority()
[]
>>> ccs.source_crs.list_authority()
[AuthorityMatchInfo(auth_name='EPSG', code='4978', confidence=70)]
>>> ccs == CRS.from_authorty('EPSG', '4978')
False

Parameters
----------
auth_name: str, optional
    The name of the authority to filter by.
min_confidence: int, default=70
    A value between 0-100 where 100 is the most confident.
    :ref:`min_confidence`

Returns
-------
list[AuthorityMatchInfo]:
    List of authority matches for the CRS.
r  )r   list_authorityr  s      r*   r  CRS.list_authorityc  s$    P yy'' ( 
 	
r,   r   c                 R    U R                  U R                  R                  US95      $ a.  
.. versionadded:: 3.1.0

Convert the current CRS to the 3D version if it makes sense.

New vertical axis attributes:
  - ellipsoidal height
  - oriented upwards
  - metre units

Parameters
----------
name: str, optional
    CRS name. Defaults to use the name of the original CRS.

Returns
-------
CRS
r   )r)   r   to_3dr(   r   s     r*   r  	CRS.to_3d  s"    ( ~~diioo4o899r,   c                 R    U R                  U R                  R                  US95      $ )z
.. versionadded:: 3.6.0

Convert the current CRS to the 2D version if it makes sense.

Parameters
----------
name: str, optional
    CRS name. Defaults to use the name of the original CRS.

Returns
-------
CRS
r  )r)   r   to_2dr  s     r*   r  	CRS.to_2d  s"     ~~diioo4o899r,   c                 .    U R                   R                  $ )a  
This checks if the CRS is geographic.
It will check if it has a geographic CRS
in the sub CRS if it is a compound CRS and will check if
the source CRS is geographic if it is a bound CRS.

Returns
-------
bool:
    True if the CRS is in geographic (lon/lat) coordinates.
)r   r   r   s    r*   r   CRS.is_geographic  s     yy&&&r,   c                 .    U R                   R                  $ )z
This checks if the CRS is projected.
It will check if it has a projected CRS
in the sub CRS if it is a compound CRS and will check if
the source CRS is projected if it is a bound CRS.

Returns
-------
bool:
    True if CRS is projected.
)r   r   r   s    r*   r   CRS.is_projected  s     yy%%%r,   c                 .    U R                   R                  $ )a  
.. versionadded:: 2.2.0

This checks if the CRS is vertical.
It will check if it has a vertical CRS
in the sub CRS if it is a compound CRS and will check if
the source CRS is vertical if it is a bound CRS.

Returns
-------
bool:
    True if CRS is vertical.
)r   r   r   s    r*   r   CRS.is_vertical  s     yy$$$r,   c                 .    U R                   R                  $ )z1
Returns
-------
bool:
    True if CRS is bound.
)r   r   r   s    r*   r   CRS.is_bound  s     yy!!!r,   c                 .    U R                   R                  $ )zM
.. versionadded:: 3.1.0

Returns
-------
bool:
    True if CRS is compound.
)r   r   r   s    r*   r   CRS.is_compound  s     yy$$$r,   c                 .    U R                   R                  $ )zV
.. versionadded:: 2.2.0

Returns
-------
bool:
    True if CRS is local/engineering.
)r   is_engineeringr   s    r*   r  CRS.is_engineering  r`  r,   c                 .    U R                   R                  $ )z
This checks if the CRS is geocentric and
takes into account if the CRS is bound.

Returns
-------
bool:
    True if CRS is in geocentric (x/y) coordinates.
)r   is_geocentricr   s    r*   r  CRS.is_geocentric       yy&&&r,   c                 .    U R                   R                  $ )zR
.. versionadded:: 3.2.0

Returns
-------
bool:
    True if CRS is a Derived CRS.
)r   
is_derivedr   s    r*   r  CRS.is_derived  s     yy###r,   c                 .    U R                   R                  $ )zO
.. versionadded:: 3.7.0

Check if the CRS is deprecated

Returns
-------
bool
)r   is_deprecatedr   s    r*   r  CRS.is_deprecated   r  r,   c                 6    U R                   R                  5       $ )zn
.. versionadded:: 3.7.0

Return a list of non-deprecated objects related to this.

Returns
-------
list[CRS]
)r   get_non_deprecatedr   s    r*   r  CRS.get_non_deprecated-  s     yy++--r,   c                 $    U R                  U5      $ r$   )r?  r;  s     r*   __eq__
CRS.__eq__9  s    {{5!!r,   c                     SU R                   0$ )Nr   r   r   s    r*   __getstate__CRS.__getstate__<  s    txx  r,   statec                 X    U R                   R                  U5        [        5       U l        g r$   )__dict__r   r!   r   )r(   r  s     r*   __setstate__CRS.__setstate__?  s    U#jr,   c                 4    [        U R                  5       5      $ r$   )hashr   r   s    r*   __hash__CRS.__hash__C  s    DKKM""r,   c                     U R                   $ r$   r  r   s    r*   __str__CRS.__str__F  s    xxr,   c                    / nU R                    H   nUR                  S[        U5      S/5        M"     SR                  U5      nSnSnU R                  (       a1  U R                  R
                  (       a  [        U R                  5      nOU R                  (       aK  U R                  (       a:  [        U R                  R                  5      nSU R                  R                   S3nO|/ nS/nU R                   HE  n	UR                  [        U	R                  5      5        UR                  SU	R                  S/5        MG     SR                  U5      nSR                  U5      nSn
U R                  (       a>  SR                  SS[        U R                  5      S	U R                  R                  S/5      n
U R                  5       n[        U5      S
::  a  UOSR                  US S
 S/5      nU=(       d    SnSU R                   SU SU R                   SU=(       d    S SU SU R                   =(       d    S SU
 SU R"                   SU R$                  =(       d    S SU R&                  =(       d    S SU U 3$ )Nz- 
r   zSource CRS: z	Sub CRS:
|zCoordinate Operation:
z- name: z
- method: 2   rA   z...z- undefined
<z: z>
Name: z
Axis Info [r  z]:
zArea of Use:
z- undefinedzDatum: z
- Ellipsoid: z
- Prime Meridian: )r/  r1  rJ   rI   r  	axis_listr   r   r   r   rK   r   r   r   r   r-  rZ  r   r   r   )r(   axis_info_listr+  axis_info_strsource_crs_reprsub_crs_reprcoordinate_system_namecoordinate_system_namessub_crs_repr_listr   r   srs_reprs               r*   __repr__CRS.__repr__I  sH   $&NND!!4TD"9: #/ !!d&<&<&F&F%()?)?%@"]]t%()J)J%K" ,T__-A-A,B"EO&(#!-,,'..s73L3L/MN!(($d)CD - &)XX.E%F"77#45L  "$$#%77-112"--99	$  >>#"8}28(3B-QVAW8X%8r( ,YYK  0?K@o0=1#$djj\ " NN9k: ;!!%!4!4!C DBn	
r,   )r   r   r$   )NNN)F)FrU   )F   )Nr  )Zr.   r/   r0   r1   r2   r   r'   propertyr   classmethodrJ   rz   r   r   r   r   r   r   r   r   r   rC   r   r   r   r   r   	WKT2_2019boolr   staticmethodr  rG   r2  r:  r?  r   r   r   r	  r   rP  r   r-  r	   r/  r   rZ  r   r   r   r   r   r   r   r  r
   r   rh  rk  r   ru  r   r   PROJ_5r   r}  r   r   r  r  r  r   r   r   r   r   r  r  r  r  r  objectr  r  r  r  r  r  r3   rr   r,   r*   r   r      s   &e-3: e-4 e-N   Ms M#) M M M& =S3Y =5 = = N N N N& HS HU H H& H H H H*3 & $C $e $ $6
$+ 
 B$ B5 B B" > > > >" 9d 9u 9 9", ,` )3(<(<A#%A A 
	AF  &*#'"&	|
|
d
|
 Dj|
 4Z	|

 
|
 |
|<$t* <|33 34 3*QC QD QT Q4 
huo 
 
  
HUO 
 
 
HUO 
 
  Od5k O O #*  0 c   #3 # # #4: # # %Y- % % 	#9t+ 	# 	# 	( 4 	( 	( ut|   +#3d#: + + .&9D&@ . . 	! 	! 	! 	s 	 	 %/$8$8(,	*c!* * +	*
 
*Xd  S ,
(d 
( 5@4F4F c 1 3 0#@c #@3: #@J(
cDj (
 (
V CE*
t*
<?*
	 	!*
X:#* : :,:#* : :" 't ' ' &d & & %T % %  "$ " " 	%T 	% 	% 	( 	( 	( 
't 
' 
' 	$ 	$ 
't 
' 
'
.DK 
."F "t "!d38n !!$sCx. !## # 7
# 7
r,   r   c                      ^  \ rS rSrSr\S\\S4   4S j5       rS r	\
S\SS4U 4S	 jj5       r\S\S   4S
 j5       r\S\S   4S j5       r\S\S   4S j5       r\S\S   4S j5       rSS\S-  SS4S jjrSrU =r$ )CustomConstructorCRSi  z
This class is a base class for CRS classes
that use a different constructor than the main CRS class.

.. versionadded:: 3.2.0

See: https://github.com/pyproj4/pyproj/issues/847
r8   .c                     [         e)z\
These are the type names of the CRS class
that are expected when using the from_* methods.
)NotImplementedErrorr   s    r*   _expected_types$CustomConstructorCRS._expected_types  s
     "!r,   c                     U R                   U R                  ;  a&  [        SU R                    SU R                   S35      eg)zT
This validates that the type of the CRS is expected
when using the from_* methods.
zInvalid type z. Expected .N)r-  r  r   r   s    r*   _check_type CustomConstructorCRS._check_type  sG    
 >>!5!55/{4;O;O:PPQR  6r,   rO   r   c                    > [        X5      (       a  U$ U R                  U 5      n[        [        U]  " U40 UD6  UR                  5         U$ r   )rB   __new__r&   r  r'   r  )r   rO   r   r%   r)   s       r*   r   $CustomConstructorCRS.from_user_input  sG    0 e!!Lkk#"C1%B6B
r,   c                 r    U R                   R                  c  S$ [        U R                   R                  5      $ rB  )r   r   r   r   s    r*   r   !CustomConstructorCRS.geodetic_crs  s-     yy--5tV3tyy?U?U;VVr,   c                 r    U R                   R                  c  S$ [        U R                   R                  5      $ rE  )r   r   r   r   s    r*   r   CustomConstructorCRS.source_crs  s-     yy++3tRTYY=Q=Q9RRr,   c                 r    U R                   R                  c  S$ [        U R                   R                  5      $ rH  )r   r	  r   r   s    r*   r	  CustomConstructorCRS.target_crs  s-     yy++3tRTYY=Q=Q9RRr,   c                 l    U R                   R                   Vs/ s H  n[        U5      PM     sn$ s  snf rK  )r   r   r   rL  s     r*   r   !CustomConstructorCRS.sub_crs_list  s,     -1II,B,BC,BG,BCCCs   1Nr   c                 F    [        U R                  R                  US95      $ r  )r   r   r  r  s     r*   r  CustomConstructorCRS.to_3d  s    ( 499???-..r,   rr   r$   )r.   r/   r0   r1   r2   r  rH   rJ   r  r  r  r   r   r   r   r   r	  rG   r   r  r3   r4   r5   s   @r*   r  r    s     "sCx " " C e  < 
Whuo 
W 
W 	SHUO 	S 	S 
SHUO 
S 
S Dd5k D D/#* / / /r,   r  c            	       T   ^  \ rS rSrSrSr   SS\S\S\S-  SS4U 4S	 jjjrS
r	U =r
$ )r  i  zF
.. versionadded:: 2.5.0

This class is for building a Geographic CRS
)zGeographic CRSzGeographic 2D CRSzGeographic 3D CRSNr   r   r   r8   c                   > [         R                  " U5      R                  5       nSSU[        R                  " U=(       d
    [	        5       5      R                  5       S.nUS   S:X  a  X$S'   OX$S'   [
        TU ]  U5        g)	a  
Parameters
----------
name: str, default="undefined"
    Name of the CRS.
datum: Any, default="urn:ogc:def:ensemble:EPSG::6326"
    Anything accepted by :meth:`pyproj.crs.Datum.from_user_input` or
    a :class:`pyproj.crs.datum.CustomDatum`.
ellipsoidal_cs: Any, optional
    Input to create an Ellipsoidal Coordinate System.
    Anything accepted by :meth:`pyproj.crs.CoordinateSystem.from_user_input`
    or an Ellipsoidal Coordinate System created from :ref:`coordinate_system`.
2https://proj.org/schemas/v0.2/projjson.schema.jsonr  )$schematyper   r  r  DatumEnsembledatum_ensembler   N)r   r   r   r   r   r&   r'   )r(   r   r   r   r  r)   s        r*   r'   GeographicCRS.__init__  s|    & %%e,99;K#!1!A!A3/"3"ln
 =O+49 01+0(,-r,   rr   )r  zurn:ogc:def:ensemble:EPSG::6326Nr.   r/   r0   r1   r2   r  rJ   r   r'   r3   r4   r5   s   @r*   r  r    sO     SO  6%)	 . .  . d
	 .
 
 .  .r,   r  c                   V   ^  \ rS rSrSrSr  SS\S\S\S-  S\S	S4
U 4S
 jjjrSr	U =r
$ )r  i2  zN
.. versionadded:: 2.5.0

This class is for building a Derived Geographic CRS
)zDerived Geographic CRSzDerived Geographic 2D CRSzDerived Geographic 3D CRSNr  r  r   r   r8   c           	      "  > SSU[         R                  U5      R                  5       [        R                  " U5      R                  5       [        R                  " U=(       d
    [        5       5      R                  5       S.n[        TU ]  U5        g)a_  
Parameters
----------
base_crs: Any
    Input to create the Geodetic CRS, a :class:`GeographicCRS` or
    anything accepted by :meth:`pyproj.crs.CRS.from_user_input`.
conversion: Any
    Anything accepted by :meth:`pyproj.crs.CoordinateSystem.from_user_input`
    or a conversion from :ref:`coordinate_operation`.
ellipsoidal_cs: Any, optional
    Input to create an Ellipsoidal Coordinate System.
    Anything accepted by :meth:`pyproj.crs.CoordinateSystem.from_user_input`
    or an Ellipsoidal Coordinate System created from :ref:`coordinate_system`.
name: str, default="undefined"
    Name of the CRS.
r  r  r  r  r   r  r  r  N)r   r   r   r
   r   r   r&   r'   )r(   r  r  r   r   derived_geographic_crs_jsonr)   s         r*   r'   DerivedGeographicCRS.__init__?  sv    0 L*++H5BBD-==ln!1!A!A3/"3"ln'
# 	45r,   rr   )Nr  r.   r/   r0   r1   r2   r  r   rJ   r'   r3   r4   r5   s   @r*   r  r  2  sU    O &*#6#6 #6 d
	#6
 #6 
#6 #6r,   r  c                   H   ^  \ rS rSrSrSr  S
S\S\SS4U 4S jjjrS	r	U =r
$ )GeocentricCRSie  zF
.. versionadded:: 3.2.0

This class is for building a Geocentric CRS
)zGeocentric CRSr   r   r8   Nc                    > SSU[         R                  " U5      R                  5       SSSSSS.S	S
SSS.SSSSS./S.S.n[        TU ]  U5        g)z
Parameters
----------
name: str, default="undefined"
    Name of the CRS.
datum: Any, default="urn:ogc:def:datum:EPSG::6326"
    Anything accepted by :meth:`pyproj.crs.Datum.from_user_input` or
    a :class:`pyproj.crs.datum.CustomDatum`.
r  GeodeticCRS	CartesianzGeocentric XXgeocentricXmetre)r   abbreviation	directionunitzGeocentric YYgeocentricYzGeocentric ZZgeocentricZ)subtyper+  r  r  r   r   r  N)r   r   r   r&   r'   )r(   r   r   geocentric_crs_jsonr)   s       r*   r'   GeocentricCRS.__init__n  s     M!**51>>@& !/(+%2 '	 !/(+%2 '	 !/(+%2 '	"
: 	,-r,   rr   )r  zurn:ogc:def:datum:EPSG::6326r  r5   s   @r*   r  r  e  s=     *O  3+.+. +. 
	+. +.r,   r  c                   ^   ^  \ rS rSrSrSr   SS\S\S\S-  S\S-  S	S4
U 4S
 jjjrSr	U =r
$ )r  i  zF
.. versionadded:: 2.5.0

This class is for building a Projected CRS.
)zProjected CRSzDerived Projected CRSNr  r   r   r   r8   c           	      D  > SSU[         R                  U=(       d
    [        5       5      R                  5       [        R                  " U5      R                  5       [
        R                  " U=(       d
    [        5       5      R                  5       S.n[        TU ]!  U5        g)an  
Parameters
----------
conversion: Any
    Anything accepted by :meth:`pyproj.crs.CoordinateSystem.from_user_input`
    or a conversion from :ref:`coordinate_operation`.
name: str, optional
    The name of the Projected CRS. Default is undefined.
cartesian_cs: Any, optional
    Input to create a Cartesian Coordinate System.
    Anything accepted by :meth:`pyproj.crs.CoordinateSystem.from_user_input`
    or :class:`pyproj.crs.coordinate_system.Cartesian2DCS`.
geodetic_crs: Any, optional
    Input to create the Geodetic CRS, a :class:`GeographicCRS` or
    anything accepted by :meth:`pyproj.crs.CRS.from_user_input`.
r  r  r  N)	r   r   r  r   r
   r   r   r&   r'   )r(   r  r   r   r   proj_crs_jsonr)   s         r*   r'   ProjectedCRS.__init__  s{    0 L"++/ln-==ln!1!A!A/"ln
 	'r,   rr   )r  NNr  r5   s   @r*   r  r    s]     AO
  #'#'%(%( %( Dj	%(
 Dj%( 
%( %(r,   r  c                   \   ^  \ rS rSrSrSr  SS\S\S\S-  S\S-  S	S4
U 4S
 jjjrSr	U =r
$ )r  i  z
.. versionadded:: 2.5.0

This class is for building a Vertical CRS.

.. warning:: geoid_model support only exists in PROJ >= 6.3.0

)zVertical CRSNr   r   r  r   r8   c                    > SSU[         R                  " U5      R                  5       [        R                  " U=(       d
    [	        5       5      R                  5       S.nUb  SU0US'   [
        TU ]  U5        g)a  
Parameters
----------
name: str
    The name of the Vertical CRS (e.g. NAVD88 height).
datum: Any
    Anything accepted by :meth:`pyproj.crs.Datum.from_user_input`
vertical_cs: Any, optional
    Input to create a Vertical Coordinate System accepted by
    :meth:`pyproj.crs.CoordinateSystem.from_user_input`
    or :class:`pyproj.crs.coordinate_system.VerticalCS`
geoid_model: str, optional
    The name of the GEOID Model (e.g. GEOID12B).
r  r  r
  Nr   r   )r   r   r   r   r   r&   r'   )r(   r   r   r  r   vert_crs_jsonr)   s         r*   r'   VerticalCRS.__init__  sp    , L!**51>>@!1!A!A+z|"ln
 ",2K+@M-('r,   rr   )NNr  r5   s   @r*   r  r    sY     (O #'"&!(!( !( 4Z	!(
 4Z!( 
!( !(r,   r  c                   F   ^  \ rS rSrSrSrS\S\\   SS4U 4S jjr	S	r
U =r$ )
r  i  zE
.. versionadded:: 2.5.0

This class is for building a Compound CRS.
)zCompound CRSr   r  r8   Nc           	         > SSUU Vs/ s H&  n[         R                  U5      R                  5       PM(     snS.n[        TU ]  U5        gs  snf )z
Parameters
----------
name: str
    The name of the Compound CRS.
components: list[Any], optional
    List of CRS to create a Compound Coordinate System.
    List of anything accepted by :meth:`pyproj.crs.CRS.from_user_input`
r  r  )r  r  r   r  N)r   r   r   r&   r'   )r(   r   r  	componentcompound_crs_jsonr)   s        r*   r'   CompoundCRS.__init__  s]     L! ",!+I ##I.;;=!+	
 	*+s   -A
rr   )r.   r/   r0   r1   r2   r  rJ   rG   r   r'   r3   r4   r5   s   @r*   r  r    s2     (O,S ,d3i ,D , ,r,   r  c                   D   ^  \ rS rSrSrSrS\S\S\SS4U 4S	 jjrS
rU =r	$ )r  i  zB
.. versionadded:: 2.5.0

This class is for building a Bound CRS.
)z	Bound CRSr   r	  r
  r8   Nc                    > SS[         R                  U5      R                  5       [         R                  U5      R                  5       [        R                  " U5      R                  5       S.n[        TU ]  U5        g)z
Parameters
----------
source_crs: Any
    Input to create a source CRS.
target_crs: Any
    Input to create the target CRS.
transformation: Any
    Input to create the transformation.
r  r  )r  r  r   r	  r
  N)r   r   r   r
   r&   r'   )r(   r   r	  r
  bound_crs_jsonr)   s        r*   r'   BoundCRS.__init__&  sh     L--j9FFH--j9FFH1AAln
 	(r,   rr   )
r.   r/   r0   r1   r2   r  r   r'   r3   r4   r5   s   @r*   r  r    s6     %O)3 )C ) )QU ) )r,   r  )T)Cr2   rD   rW   	threadingr_   collections.abcr   typingr   r   pyproj._crsr   r   r   r	   r
   r   r   r   r   r   r   r   pyproj.crs._cf1x8r   r   r   r   r   r   pyproj.crs.coordinate_operationr   pyproj.crs.coordinate_systemr   r   r   pyproj.enumsr   r   pyproj.exceptionsr   pyproj.geodr   compiler  r   localr!   rC   r  rJ   rQ   rf   rL   rz   rs   rw   r}   r   r  r  r  r  r  r  r  r  rr   r,   r*   <module>r*     su    	   $       B S S 0 &  DD	
y 
24 2T 2S 2,#S #S #L  (&s &sSy &6#) 6S T [
 [
|.@/3 @/F).( ).X06/ 06f4.( 4.n.(' .(b-(& -(`,& ,@)# )r,   