
    \i                     |   S r / SQrSSKrSSKrSSKJrJr  SSKJr  SSKJ	r	J
r
  SSKJr  SSKJr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Jr  SSK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)  SSK*J+r+  SSK,J-r-J.r.   " S S\5      r/\" SS9 " S S\/5      5       r0\" SS9 " S S\/5      5       r1\" SS9 " S S\/5      5       r2 " S S \!5      r3 " S! S"\Rh                  5      r5 " S# S$5      r6     S3S%\S&\S'\S(\S)\S-  S*\S-  S+\7S,\7S-\74S. jjr8     S4S%\S&\S/\	\	   S0\7S1\7S+\7S,\7S-\74S2 jjr9g)5zH
The transformer module is for performing cartographic transformations.
)AreaOfInterestTransformerTransformerGroup
itransform	transform    N)ABCabstractmethod)array)IterableIterator)	dataclass)chainislice)Path)Anyoverload)CRS)
cstrencode)_clear_proj_error)	AreaOfUseCoordinateOperation)r   _Transformer_TransformerGroup)get_user_data_dir)ProjVersionTransformDirection
WktVersion)	ProjError)_download_resource_file)_convertback_copytobufferc                   0    \ rS rSrSr\S\4S j5       rSrg)TransformerMaker&   z
.. versionadded:: 3.1.0

Base class for generating new instances
of the Cython _Transformer class for
thread safety in the Transformer class.
returnc                     [         e
Returns
-------
_Transformer
)NotImplementedErrorselfs    U/var/www/html/kml_chatgpt/mouzaenv/lib/python3.13/site-packages/pyproj/transformer.py__call__TransformerMaker.__call__/   s
     "!     N)	__name__
__module____qualname____firstlineno____doc__r	   r   r-   __static_attributes__r0   r/   r,   r#   r#   &   s"     ", " "r/   r#   T)frozenc                   2    \ rS rSr% Sr\\S'   S\4S jrSrg)TransformerUnsafe9   z[
.. versionadded:: 3.1.0

Returns the original Cython _Transformer
and is not thread-safe.
transformerr%   c                     U R                   $ r'   r;   r*   s    r,   r-   TransformerUnsafe.__call__D   s     r/   r0   N)	r1   r2   r3   r4   r5   r   __annotations__r-   r6   r0   r/   r,   r9   r9   9   s      ,  r/   r9   c                       \ rS rSr% Sr\\S'   \\S'   \\S'   \S-  \S'   \	S-  \S'   \	S-  \S	'   \S-  \S
'   Sr
\\S'   Sr\S-  \S'   S\4S jrSrg)TransformerFromCRSM   zy
.. versionadded:: 3.1.0

.. versionadded:: 3.4.0 force_over

Generates a Cython _Transformer class from input CRS data.
crs_fromcrs_to	always_xyNarea_of_interest	authorityaccuracyallow_ballparkF
force_over	only_bestr%   c                     [         R                  " U R                  U R                  U R                  U R
                  U R                  U R                  U R                  U R                  U R                  S9	$ )r(   rE   rF   rG   rH   rI   rJ   rK   )r   from_crsrC   rD   rE   rF   rG   rH   rI   rJ   rK   r*   s    r,   r-   TransformerFromCRS.__call__c   sZ     $$MMKKnn!22nn]]..nn

 
	
r/   r0   )r1   r2   r3   r4   r5   bytesr?   boolr   strrJ   rK   r   r-   r6   r0   r/   r,   rA   rA   M   se     OMO$t++TzDj4KJ!Itd{!
, 
r/   rA   c                   2    \ rS rSr% Sr\\S'   S\4S jrSr	g)TransformerFromPipelinev   zZ
.. versionadded:: 3.1.0

Generates a Cython _Transformer class from input pipeline data.
proj_pipeliner%   c                 B    [         R                  " U R                  5      $ r'   )r   from_pipelinerV   r*   s    r,   r-    TransformerFromPipeline.__call__   s     ))$*<*<==r/   r0   N)
r1   r2   r3   r4   r5   rP   r?   r   r-   r6   r0   r/   r,   rT   rT   v   s     >, >r/   rT   c                     ^  \ rS rSrSr      SS\S\S\S\S-  S\S-  S	\	S-  S
\S\SS4U 4S jjjr
\S\S   4S j5       r\S\\   4S j5       r\S\4S j5       r   SS\\-  S-  S\S\SS4S jjrS\4S jrSrU =r$ )r      a6  
The TransformerGroup is a set of possible transformers from one CRS to another.

.. versionadded:: 2.3.0

.. warning:: CoordinateOperation and Transformer objects
             returned are not thread-safe.

From PROJ docs::

    The operations are sorted with the most relevant ones first: by
    descending area (intersection of the transformation area with the
    area of interest, or intersection of the transformation with the
    area of use of the CRS), and by increasing accuracy. Operations
    with unknown accuracy are sorted last, whatever their area.

NrC   rD   rE   rF   rG   rH   rI   allow_supersededr%   c	                 .  > [         TU ]  [        R                  " U5      R                  [        R                  " U5      R                  UUUUc  SOUUUS9  [        U R                  5       H&  u  p[        [        U
5      5      U R                  U	'   M(     g)u  Get all possible transformations from a :obj:`pyproj.crs.CRS`
or input used to create one.

.. versionadded:: 3.4.0 authority, accuracy, allow_ballpark
.. versionadded:: 3.6.0 allow_superseded

Parameters
----------
crs_from: pyproj.crs.CRS or input used to create one
    Projection of input data.
crs_to: pyproj.crs.CRS or input used to create one
    Projection of output data.
always_xy: bool, default=False
    If true, the transform method will accept as input and return as output
    coordinates using the traditional GIS order, that is longitude, latitude
    for geographic CRS and easting, northing for most projected CRS.
area_of_interest: :class:`.AreaOfInterest`, optional
    The area of interest to help order the transformations based on the
    best operation for the area.
authority: str, optional
    When not specified, coordinate operations from any authority will be
    searched, with the restrictions set in the
    authority_to_authority_preference database table related to the
    authority of the source/target CRS themselves. If authority is set
    to “any”, then coordinate operations from any authority will be
    searched. If authority is a non-empty string different from "any",
    then coordinate operations will be searched only in that authority
    namespace (e.g. EPSG).
accuracy: float, optional
    The minimum desired accuracy (in metres) of the candidate
    coordinate operations.
allow_ballpark: bool, default=True
    Set to False to disallow the use of Ballpark transformation
    in the candidate coordinate operations. Default is to allow.
allow_superseded: bool, default=False
    Set to True to allow the use of superseded (but not deprecated)
    transformations in the candidate coordinate operations. Default is
    to disallow.

N)rE   rF   rG   rH   rI   r\   )	super__init__r   from_user_input_crs	enumerate_transformersr   r9   )r+   rC   rD   rE   rF   rG   rH   rI   r\   iiir;   	__class__s              r,   r`   TransformerGroup.__init__   s    f 	)..',,-#+R)- 	 		
 !*$*<*< =C&12CK2P&QDs# !>r/   r   c                     U R                   $ )zl
list[:obj:`Transformer`]:
    List of available :obj:`Transformer`
    associated with the transformation.
)rd   r*   s    r,   transformersTransformerGroup.transformers   s     !!!r/   c                     U R                   $ )z
list[:obj:`pyproj.crs.CoordinateOperation`]:
    List of :obj:`pyproj.crs.CoordinateOperation` that are not
    available due to missing grids.
)_unavailable_operationsr*   s    r,   unavailable_operations'TransformerGroup.unavailable_operations   s     +++r/   c                     U R                   $ )z<
bool: If True, the best possible transformer is available.
)_best_availabler*   s    r,   best_availableTransformerGroup.best_available   s    
 ###r/   	directoryopen_licenseverbosec           	         Uc  [        S5      nU R                   H  nUR                   H  nUR                  (       du  UR                  R                  UR                  5      (       aK  UR                  (       a:  UR                  (       d  U(       d"  [        UR                  UR                  UUS9  M  UR                  (       a  M  U(       d  M  [        R                  " SU 35        M     M     g)a  
.. versionadded:: 3.0.0

Download missing grids that can be downloaded automatically.

.. warning:: There are cases where the URL to download the grid is missing.
             In those cases, you can enable enable
             :ref:`debugging-internal-proj` and perform a
             transformation. The logs will show the grids PROJ searches for.

Parameters
----------
directory: str or Path, optional
    The directory to download the grids to.
    Defaults to :func:`pyproj.datadir.get_user_data_dir`
open_license: bool, default=True
    If True, will only download grids with an open license.
verbose: bool, default=False
    If True, will print information about grids downloaded.
NT)file_url
short_namers   ru   z	Skipped: )r   rm   grids	availableurlendswithrx   direct_downloadrt   r   warningswarn)r+   rs   rt   ru   unavailable_operationgrids         r,   download_gridsTransformerGroup.download_grids   s    4 )$/I%)%@%@!-33))$//::,,**,+!%#'??"+ '	 GGMMIdV"45 4 &Ar/   c                 x    SU R                    S[        U R                  5       S[        U R                  5       3$ )Nz"<TransformerGroup: best_available=z>
- transformers: z
- unavailable_operations: )rq   lenri   rm   r*   s    r,   __repr__TransformerGroup.__repr__$  sH    01D1D0E F"4#4#456 7)),T-H-H)I(JL	
r/   r0   )FNNNTF)NTF)r1   r2   r3   r4   r5   r   rQ   r   rR   floatr`   propertylistri   r   rm   rq   r   r   r   r6   __classcell__rf   s   @r,   r   r      sD   ,  26 $!%#!&?R?R ?R 	?R
 )4/?R :?R $,?R ?R ?R 
?R ?RB "d=1 " " ,-@(A , , $ $ $ (,!	,6:$,6 ,6 	,6
 
,6\
# 
 
r/   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )TransformerLocali,  z~
Threading local instance for cython _Transformer class.

For more details, see:
https://github.com/pyproj4/pyproj/issues/782
c                 0   > S U l         [        TU ]	  5         g N)r;   r_   r`   )r+   rf   s    r,   r`   TransformerLocal.__init__4  s    r/   r=   )r1   r2   r3   r4   r5   r`   r6   r   r   s   @r,   r   r   ,  s     r/   r   c                   `   \ rS rSrSr SLS\S-  SS4S jjrS\\\	4   4S jr
S\\\	4   4S	 jr\S
 5       r\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\\   S-  4S j5       rSMS jr\S\4S j5       r\S\S-  4S j5       r\S\S-  4S j5       r \!  SNS\	S\	S\S\"S-  SS 4
S jj5       r#\!       SOS\	S\	S\S\"S-  S \S-  S!\S-  S"\S-  S#\S$\S-  SS 4S% jj5       r$\!S&\SS 4S' j5       r%\&SS\'RP                  S4S(\	S)\	S*\S+\S,\'\-  S-\S\\	\	4   4S. jj5       r)\&SS\'RP                  S4S(\	S)\	S/\	S*\S+\S,\'\-  S-\S\\	\	\	4   4S0 jj5       r)\&SS\'RP                  S4S(\	S)\	S/\	S1\	S*\S+\S,\'\-  S-\S\\	\	\	\	4   4S2 jj5       r)SSSS\'RP                  S4S3 jr)SSSS\'RP                  4S4\	S5\S6\S*\S+\S,\'\-  S\*\+   4S7 jjr,S8SS\'RP                  4S9\S:\S;\S<\S=\-S*\S+\S,\'\-  S\\\\\4   4S> jjr.\/R`                  S4S?\/\-  S@\S\4SA jjr1\2Rf                  S4S?\2\-  S@\S\4SB jjr4SPS@\SC\-S\4SD jjr5S\4SE jr6S\4SF jr7S\4SG jr8SH\9S\4SI jr:SH\	S\4SJ jr;SKr<g)Qr   i9  z
The Transformer class is for facilitating re-using
transforms without needing to re-create them. The goal
is to make repeated transforms faster.

Additionally, it provides multiple methods for initialization.

.. versionadded:: 2.1.0

Ntransformer_makerr%   c                     [        U[        5      (       d  [        5         [        S5      e[	        5       U l        U" 5       U R
                  l        Xl        g )NzETransformer must be initialized using: 'from_crs' or 'from_pipeline'.)
isinstancer#   r   r   r   _localr;   _transformer_maker)r+   r   s     r,   r`   Transformer.__init__E  sJ     +-=>>W  '("3"5"3r/   c                     SU R                   0$ )Nr   )r   r*   s    r,   __getstate__Transformer.__getstate__S  s    $d&=&=>>r/   statec                     U R                   R                  U5        [        5       U l        U R	                  5       U R                  l        g r   )__dict__updater   r   r   r;   )r+   r   s     r,   __setstate__Transformer.__setstate__V  s3    U#&("&"9"9";r/   c                     U R                   R                  c  U R                  5       U R                   l        U R                   R                  $ )zO
The Cython _Transformer object for this thread.

Returns
-------
_Transformer
)r   r;   r   r*   s    r,   _transformerTransformer._transformer[  s9     ;;""*&*&=&=&?DKK#{{&&&r/   c                 .    U R                   R                  $ )z
str: Name of the projection.
)r   idr*   s    r,   nameTransformer.nameh  s    
   ###r/   c                 .    U R                   R                  $ )z%
str: Description of the projection.
)r   descriptionr*   s    r,   r   Transformer.descriptiono      
   ,,,r/   c                 .    U R                   R                  $ )z$
str: Definition of the projection.
)r   
definitionr*   s    r,   r   Transformer.definitionv  s    
   +++r/   c                 .    U R                   R                  $ )z*
bool: True if an inverse mapping exists.
)r   has_inverser*   s    r,   r   Transformer.has_inverse}  r   r/   c                 .    U R                   R                  $ )z@
float: Expected accuracy of the transformation. -1 if unknown.
)r   rH   r*   s    r,   rH   Transformer.accuracy  s    
   )))r/   c                 .    U R                   R                  $ )zl
.. versionadded:: 2.3.0

Returns
-------
AreaOfUse:
    The area of use object with associated attributes.
)r   area_of_user*   s    r,   r   Transformer.area_of_use  s       ,,,r/   c                 .    U R                   R                  $ )zI
.. versionadded:: 2.4.0

Returns
-------
str:
    Remarks about object.
)r   remarksr*   s    r,   r   Transformer.remarks  s       (((r/   c                 .    U R                   R                  $ )zD
.. versionadded:: 2.4.0

Returns
-------
str:
    Scope of object.
)r   scoper*   s    r,   r   Transformer.scope  s       &&&r/   c                 .    U R                   R                  $ )zv
.. versionadded:: 2.4.0

Returns
-------
tuple[CoordinateOperation]:
    The operations in a concatenated operation.
)r   
operationsr*   s    r,   r   Transformer.operations  s       +++r/   c                 Z    [        [        U R                  R                  5       5      5      $ )z
.. versionadded:: 3.4.0

.. note:: Requires PROJ 9.1+

See: :c:func:`proj_trans_get_last_used_operation`

Returns
-------
Transformer:
    The operation used in the transform call.
)r   r9   r   get_last_used_operationr*   s    r,   r   #Transformer.get_last_used_operation  s(     d//GGIJ
 	
r/   c                 .    U R                   R                  $ )zO
.. versionadded:: 3.0.0

Returns
-------
bool:
    If the network is enabled.
)r   is_network_enabledr*   s    r,   r   Transformer.is_network_enabled  s       333r/   c                 r    U R                   R                  c  S$ [        U R                   R                  5      $ )zc
.. versionadded:: 3.3.0

Returns
-------
CRS | None:
    The source CRS of a CoordinateOperation.
N)r   
source_crsr   r*   s    r,   r   Transformer.source_crs  ;       ++3 	
 T&&112	
r/   c                 r    U R                   R                  c  S$ [        U R                   R                  5      $ )zc
.. versionadded:: 3.3.0

Returns
-------
CRS | None:
    The target CRS of a CoordinateOperation.
N)r   
target_crsr   r*   s    r,   r   Transformer.target_crs  r   r/   F	proj_fromproj_torE   rF   c                     SSK Jn  [        X5      (       d  U" U 5      n [        X5      (       d  U" U5      n[        R	                  U R
                  UR
                  UUS9$ )a+  Make a Transformer from a :obj:`pyproj.Proj` or input used to create one.

.. deprecated:: 3.4.1 :meth:`~Transformer.from_crs` is preferred.

.. versionadded:: 2.2.0 always_xy
.. versionadded:: 2.3.0 area_of_interest

Parameters
----------
proj_from: :obj:`pyproj.Proj` or input used to create one
    Projection of input data.
proj_to: :obj:`pyproj.Proj` or input used to create one
    Projection of output data.
always_xy: bool, default=False
    If true, the transform method will accept as input and return as output
    coordinates using the traditional GIS order, that is longitude, latitude
    for geographic CRS and easting, northing for most projected CRS.
area_of_interest: :class:`.AreaOfInterest`, optional
    The area of interest to help select the transformation.

Returns
-------
Transformer

r   )Proj)rE   rF   )pyprojr   r   r   rN   crs)r   r   rE   rF   r   s        r,   	from_projTransformer.from_proj  s\    B 	 )**YI'((7mG##MMKK-	 $ 
 	
r/   rC   rD   rG   rH   rI   rJ   rK   c	                     [        [        [        [        R                  " U 5      R
                  5      [        [        R                  " U5      R
                  5      UUUUc  UO
[        U5      UUUS9	5      $ )u
  Make a Transformer from a :obj:`pyproj.crs.CRS` or input used to create one.

See:

- :c:func:`proj_create_crs_to_crs`
- :c:func:`proj_create_crs_to_crs_from_pj`

.. versionadded:: 2.2.0 always_xy
.. versionadded:: 2.3.0 area_of_interest
.. versionadded:: 3.1.0 authority, accuracy, allow_ballpark
.. versionadded:: 3.4.0 force_over
.. versionadded:: 3.5.0 only_best

Parameters
----------
crs_from: pyproj.crs.CRS or input used to create one
    Projection of input data.
crs_to: pyproj.crs.CRS or input used to create one
    Projection of output data.
always_xy: bool, default=False
    If true, the transform method will accept as input and return as output
    coordinates using the traditional GIS order, that is longitude, latitude
    for geographic CRS and easting, northing for most projected CRS.
area_of_interest: :class:`.AreaOfInterest`, optional
    The area of interest to help select the transformation.
authority: str, optional
    When not specified, coordinate operations from any authority will be
    searched, with the restrictions set in the
    authority_to_authority_preference database table related to the
    authority of the source/target CRS themselves. If authority is set
    to “any”, then coordinate operations from any authority will be
    searched. If authority is a non-empty string different from "any",
    then coordinate operations will be searched only in that authority
    namespace (e.g. EPSG).
accuracy: float, optional
    The minimum desired accuracy (in metres) of the candidate
    coordinate operations.
allow_ballpark: bool, optional
    Set to False to disallow the use of Ballpark transformation
    in the candidate coordinate operations. Default is to allow.
force_over: bool, default=False
    If True, it will to force the +over flag on the transformation.
    Requires PROJ 9+.
only_best: bool, optional
    Can be set to True to cause PROJ to error out if the best
    transformation known to PROJ and usable by PROJ if all grids known and
    usable by PROJ were accessible, cannot be used. Best transformation should
    be understood as the transformation returned by
    :c:func:`proj_get_suggested_operation` if all known grids were
    accessible (either locally or through network).
    Note that the default value for this option can be also set with the
    :envvar:`PROJ_ONLY_BEST_DEFAULT` environment variable, or with the
    ``only_best_default`` setting of :ref:`proj-ini`.
    The only_best kwarg overrides the default value if set.
    Requires PROJ 9.2+.

Returns
-------
Transformer

rM   )r   rA   r   r   ra   srsrR   )	rC   rD   rE   rF   rG   rH   rI   rJ   rK   s	            r,   rN   Transformer.from_crs'  sl    R 3..x8<<=3..v6::;#!1#%-%53x=-%#

 	
r/   rV   c                 <    [        [        [        U 5      5      5      $ )a*  Make a Transformer from a PROJ pipeline string.

:ref:`pipeline`

See:

- :c:func:`proj_create`
- :c:func:`proj_create_from_database`

.. versionadded:: 3.1.0 AUTH:CODE string support (e.g. EPSG:1671)

Allowed input:
  - a PROJ string
  - a WKT string
  - a PROJJSON string
  - an object code (e.g. "EPSG:1671"
    "urn:ogc:def:coordinateOperation:EPSG::1671")
  - an object name. e.g "ITRF2014 to ETRF2014 (1)".
    In that case as uniqueness is not guaranteed,
    heuristics are applied to determine the appropriate best match.
  - a OGC URN combining references for concatenated operations
    (e.g. "urn:ogc:def:coordinateOperation,coordinateOperation:EPSG::3895,
    coordinateOperation:EPSG::1618")

Parameters
----------
proj_pipeline: str
    Projection pipeline string.

Returns
-------
Transformer

)r   rT   r   )rV   s    r,   rX   Transformer.from_pipeline~  s    H 2:m3LMNNr/   xxyyradianserrcheck	directioninplacec                     g r   r0   )r+   r   r   r   r   r   r   s          r,   r   Transformer.transform  s     r/   zzc                     g r   r0   )r+   r   r   r   r   r   r   r   s           r,   r   r     s      #r/   ttc	                     g r   r0   )	r+   r   r   r   r   r   r   r   r   s	            r,   r   r     s     %(r/   c	           
          U R                   R                  UUUUUUUS9$ ! [         a     Of = f[        XS9u  p[        X(S9u  pUb  [        X8S9u  pOSnUb  [        XHS9u  nnOSnU R                   R	                  U	UUUUUUS9  [        X5      n[        X5      nUU4nUb  U[        WU5      4-  nUb  U[        WU5      4-  nU$ )a
  
Transform points between two coordinate systems.

See: :c:func:`proj_trans_generic`

.. versionadded:: 2.1.1 errcheck
.. versionadded:: 2.2.0 direction
.. versionadded:: 3.2.0 inplace

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
----------
xx: scalar or array
    Input x coordinate(s).
yy: scalar or array
    Input y coordinate(s).
zz: scalar or array, optional
    Input z coordinate(s).
tt: scalar or array, optional
    Input time coordinate(s).
radians: bool, default=False
    If True, will expect input data to be in radians and will return radians
    if the projection is geographic. Otherwise, it uses degrees.
    Ignored for pipeline transformations with pyproj 2,
    but will work in pyproj 3.
errcheck: bool, default=False
    If True, an exception is raised if the errors are found in the process.
    If False, ``inf`` is returned for errors.
direction: pyproj.enums.TransformDirection, optional
    The direction of the transform.
    Default is :attr:`pyproj.enums.TransformDirection.FORWARD`.
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.

Example
--------

>>> from pyproj import Transformer
>>> transformer = Transformer.from_crs("EPSG:4326", "EPSG:3857")
>>> x3, y3 = transformer.transform(33, 98)
>>> f"{x3:.3f}  {y3:.3f}"
'10909310.098  3895303.963'
>>> pipeline_str = (
...     "+proj=pipeline +step +proj=longlat +ellps=WGS84 "
...     "+step +proj=unitconvert +xy_in=rad +xy_out=deg"
... )
>>> pipe_trans = Transformer.from_pipeline(pipeline_str)
>>> xt, yt = pipe_trans.transform(2.1, 0.001)
>>> f"{xt:.3f}  {yt:.3f}"
'2.100  0.001'
>>> transproj = Transformer.from_crs(
...     {"proj":'geocent', "ellps":'WGS84', "datum":'WGS84'},
...     "EPSG:4326",
...     always_xy=True,
... )
>>> xpj, ypj, zpj = transproj.transform(
...     -2704026.010,
...     -4253051.810,
...     3895878.820,
...     radians=True,
... )
>>> f"{xpj:.3f} {ypj:.3f} {zpj:.3f}"
'-2.137 0.661 -20.531'
>>> transprojr = Transformer.from_crs(
...     "EPSG:4326",
...     {"proj":'geocent', "ellps":'WGS84', "datum":'WGS84'},
...     always_xy=True,
... )
>>> xpjr, ypjr, zpjr = transprojr.transform(xpj, ypj, zpj, radians=True)
>>> f"{xpjr:.3f} {ypjr:.3f} {zpjr:.3f}"
'-2704026.010 -4253051.810 3895878.820'
>>> transformer = Transformer.from_crs("EPSG:4326", 4326)
>>> xeq, yeq = transformer.transform(33, 98)
>>> f"{xeq:.0f}  {yeq:.0f}"
'33  98'

)inxinyinzintimer   r   r   )r   N)r   _transform_point	TypeErrorr!   
_transformr    )r+   r   r   r   r   r   r   r   r   r   x_data_typer   y_data_typer   z_data_typer   t_data_typeoutxoutyreturn_datas                       r,   r   r     s"   L	$$55#! 6    		 )=(=>,RACC>"/"DFKF$$ 	% 	
 K-K-(,d|>Lc:<<K>Lf=??Ks   ! 
..pointsswitchtime_3rdc           
   #     ^#    [        U5      n [        U5      n[	        U5      mTS;  a  [        S5      eU(       a  TS:w  a  [        S5      e[        UU4S jU 5       5      n	 [        S[        U	S	S
T-  5      5      n
[	        U
5      S	:X  a  gU R                  R                  TU
UUUUUS9  [        [        U
5      /T-  6  Sh  vN   Mh  ! [         a    [        S5      Sef = f N 7f)a%
  
Iterator/generator version of the function pyproj.Transformer.transform.

See: :c:func:`proj_trans_generic`

.. versionadded:: 2.1.1 errcheck
.. versionadded:: 2.2.0 direction

Parameters
----------
points: list
    List of point tuples.
switch: bool, default=False
    If True x, y or lon,lat coordinates of points are switched to y, x
    or lat, lon. Default is False.
time_3rd: bool, default=False
    If the input coordinates are 3 dimensional and the 3rd dimension is time.
radians: bool, default=False
    If True, will expect input data to be in radians and will return radians
    if the projection is geographic. Otherwise, it uses degrees.
    Ignored for pipeline transformations with pyproj 2,
    but will work in pyproj 3.
errcheck: bool, default=False
    If True, an exception is raised if the errors are found in the process.
    If False, ``inf`` is returned for errors.
direction: pyproj.enums.TransformDirection, optional
    The direction of the transform.
    Default is :attr:`pyproj.enums.TransformDirection.FORWARD`.


Example
--------

>>> from pyproj import Transformer
>>> transformer = Transformer.from_crs(4326, 2100)
>>> points = [(22.95, 40.63), (22.81, 40.53), (23.51, 40.86)]
>>> for pt in transformer.itransform(points): '{:.3f} {:.3f}'.format(*pt)
'2221638.801 2637034.372'
'2212924.125 2619851.898'
'2238294.779 2703763.736'
>>> pipeline_str = (
...     "+proj=pipeline +step +proj=longlat +ellps=WGS84 "
...     "+step +proj=unitconvert +xy_in=rad +xy_out=deg"
... )
>>> pipe_trans = Transformer.from_pipeline(pipeline_str)
>>> for pt in pipe_trans.itransform([(2.1, 0.001)]):
...     '{:.3f} {:.3f}'.format(*pt)
'2.100 0.001'
>>> transproj = Transformer.from_crs(
...     {"proj":'geocent', "ellps":'WGS84', "datum":'WGS84'},
...     "EPSG:4326",
...     always_xy=True,
... )
>>> for pt in transproj.itransform(
...     [(-2704026.010, -4253051.810, 3895878.820)],
...     radians=True,
... ):
...     '{:.3f} {:.3f} {:.3f}'.format(*pt)
'-2.137 0.661 -20.531'
>>> transprojr = Transformer.from_crs(
...     "EPSG:4326",
...     {"proj":'geocent', "ellps":'WGS84', "datum":'WGS84'},
...     always_xy=True,
... )
>>> for pt in transprojr.itransform(
...     [(-2.137, 0.661, -20.531)],
...     radians=True
... ):
...     '{:.3f} {:.3f} {:.3f}'.format(*pt)
'-2704214.394 -4254414.478 3894270.731'
>>> transproj_eq = Transformer.from_crs(
...     'EPSG:4326',
...     '+proj=longlat +datum=WGS84 +no_defs +type=crs',
...     always_xy=True,
... )
>>> for pt in transproj_eq.itransform([(-2.137, 0.661)]):
...     '{:.3f} {:.3f}'.format(*pt)
'-2.137 0.661'

z(iterable must contain at least one pointN)         z&points can contain up to 4 coordinatesr   z+'time_3rd' is only valid for 3 coordinates.c              3   R   >#    U  H  n[        T5        H	  o!U   v   M     M     g 7fr   )range).0coordscstrides      r,   	<genexpr>)Transformer.itransform.<locals>.<genexpr>  s     MX6uV}!AY}YXs   $'dr   @   )r   r   r   r   r   )iternextStopIteration
ValueErrorr   r   r
   r   r   _transform_sequencezip)r+   r   r   r   r   r   r   point_itfst_pt	coord_genbuffr  s              @r,   r   Transformer.itransformZ  s    r <	S(^F V"EFF!JKK MXM
	  fY2;?@D4yA~11#!! 2  d4j\F2444# !  	SGHdR	SB 5s(   C*C B,C*C(C*C%%C*   leftbottomrighttopdensify_ptsc	                 B    U R                   R                  UUUUUUUUS9$ )a  
.. versionadded:: 3.1.0

See: :c:func:`proj_trans_bounds`

Transform boundary densifying the edges to account for nonlinear
transformations along these edges and extracting the outermost bounds.

If the destination CRS is geographic and right < left then the bounds
crossed the antimeridian. In this scenario there are two polygons,
one on each side of the antimeridian. The first polygon should be
constructed with (left, bottom, 180, top) and the second with
(-180, bottom, top, right).

To construct the bounding polygons with shapely::

    def bounding_polygon(left, bottom, right, top):
        if right < left:
            return shapely.geometry.MultiPolygon(
                [
                    shapely.geometry.box(left, bottom, 180, top),
                    shapely.geometry.box(-180, bottom, right, top),
                ]
            )
        return shapely.geometry.box(left, bottom, right, top)


Parameters
----------
left: float
    Minimum bounding coordinate of the first axis in source CRS
    (or the target CRS if using the reverse direction).
bottom: float
    Minimum bounding coordinate of the second axis in source CRS.
    (or the target CRS if using the reverse direction).
right: float
    Maximum bounding coordinate of the first axis in source CRS.
    (or the target CRS if using the reverse direction).
top: float
    Maximum bounding coordinate of the second axis in source CRS.
    (or the target CRS if using the reverse direction).
densify_points: uint, default=21
    Number of points to add to each edge to account for nonlinear edges
    produced by the transform process. Large numbers will produce worse
    performance.
radians: bool, default=False
    If True, will expect input data to be in radians and will return radians
    if the projection is geographic. Otherwise, it uses degrees.
errcheck: bool, default=False
    If True, an exception is raised if the errors are found in the process.
    If False, ``inf`` is returned for errors.
direction: pyproj.enums.TransformDirection, optional
    The direction of the transform.
    Default is :attr:`pyproj.enums.TransformDirection.FORWARD`.

Returns
-------
left, bottom, right, top: float
    Outermost coordinates in target coordinate reference system.
)r  r  r  r  r  r   r   r   )r   _transform_bounds)	r+   r  r  r  r  r  r   r   r   s	            r,   transform_boundsTransformer.transform_bounds  s;    N   22# 3 	
 		
r/   versionprettyc                 4    U R                   R                  XS9$ )ae  
Convert the projection to a PROJ string.

.. versionadded:: 3.1.0

Parameters
----------
version: pyproj.enums.ProjVersion
    The version of the PROJ string output.
    Default is :attr:`pyproj.enums.ProjVersion.PROJ_5`.
pretty: bool, default=False
    If True, it will set the output to be a multiline string.

Returns
-------
str:
    The PROJ string.

r  r  )r   to_proj4r+   r  r  s      r,   r   Transformer.to_proj4,  s    0   ))')IIr/   c                 4    U R                   R                  XS9$ )a  
Convert the projection to a WKT string.

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


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.

Returns
-------
str:
    The WKT string.
r  )r   to_wktr!  s      r,   r$  Transformer.to_wktF  s    <   '''GGr/   indentationc                 4    U R                   R                  XS9$ )a<  
Convert the projection to a JSON string.

.. versionadded:: 2.4.0

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:
    The JSON string.
)r  r&  )r   to_json)r+   r  r&  s      r,   r(  Transformer.to_jsonf  s    $   (((PPr/   c                 6    U R                   R                  5       $ )zw
Convert the projection to a JSON dictionary.

.. versionadded:: 2.4.0

Returns
-------
dict:
    The JSON dictionary.
)r   to_json_dictr*   s    r,   r+  Transformer.to_json_dictz  s       --//r/   c                     U R                   $ r   )r   r*   s    r,   __str__Transformer.__str__  s    r/   c           	          SU R                   R                   SU R                   SU R                   SU R                  =(       d    S 3$ )N<z: z>
Description: z
Area of Use:
z- undefined)r   	type_namer   r   r   r*   s    r,   r   Transformer.__repr__  sR    !!++,Btyyk : ,,- .!-->?A	
r/   otherc                 x    [        U[        5      (       d  gU R                  R                  UR                  5      $ )NF)r   r   r   __eq__r+   r4  s     r,   r6  Transformer.__eq__  s/    %--  ''(:(:;;r/   c                 x    [        U[        5      (       d  gU R                  R                  UR                  5      $ )z
Check if the Transformer objects are the exact same.
If it is not a Transformer, then it returns False.

Parameters
----------
other: Any

Returns
-------
bool
F)r   r   r   is_exact_samer7  s     r,   r:  Transformer.is_exact_same  s1     %--  ..u/A/ABBr/   )r   r   r   )r%   r   )FN)FNNNNFN)Fr   )=r1   r2   r3   r4   r5   r#   r`   dictrR   r   r   r   r   r   r   r   r   rQ   r   r   rH   r   r   r   r   tupler   r   r   r   r   r   r   staticmethodr   r   rN   rX   r   r   FORWARDr   r   r   r   intr  r   PROJ_5r   r   	WKT2_2019r$  r(  r+  r.  r   objectr6  r:  r6   r0   r/   r,   r   r   9  su   	 6:4+d24 
4?d38n ?<$sCx. <
 
' 
' $c $ $ -S - - ,C , , -T - - *% * * 	-Y 	- 	- 	) 	) 	) 	's 	' 	' 	,E"56= 	, 	,
" 	4D 	4 	4 
C$J 
 
 
C$J 
 
   26	,
,
,
 ,
 )4/	,

 
,
 ,
\   26 $!%&* !%T
T
T
 T
 )4/	T

 :T
 $,T
 tT
 T
 $;T
 
T
 T
l #OS #O] #O #OJ 
 .@.H.H  	
  &+  
sCx   .@.H.H	#	# 	# 		#
 	# 	# &+	# 	# 
sC}		# 	#  .@.H.H
(
( 
( 	
(
 
( 
( 
( &+
( 
( 
sCc!	"
( 
(  $,,Pj .@.H.H~5~5 ~5 	~5
 ~5 ~5 &+~5 
(	~5L .@.H.HP
P
 P
 	P

 P
 P
 P
 P
 &+P
 
ueUE)	*P
h &1%7%7Js"J J 
	J8 %/$8$8Hc!H H 
	H@Qd Q QS Q(0d 0 
# 
<F <t <
C3 C4 Cr/   r   p1p2xyzr   r   r   rE   c	           	      |    [         R                  " S[        SS9  [        R	                  XUS9R                  X#XEXgS9$ )aM  
.. versionadded:: 2.2.0 always_xy

.. deprecated:: 2.6.1
    This function is deprecated. See: :ref:`upgrade_transformer`

x2, y2, z2 = transform(p1, p2, x1, y1, z1)

Transform points between two coordinate systems defined by the
Proj instances p1 and p2.

The points x1,y1,z1 in the coordinate system defined by p1 are
transformed to x2,y2,z2 in the coordinate system defined by p2.

z1 is optional, if it is not set it is assumed to be zero (and
only x2 and y2 are returned). If the optional keyword
'radians' is True (default is False), then all input and
output coordinates will be in radians instead of the default
of degrees for geographic input/output projections.
If the optional keyword 'errcheck' is set to True an
exception is raised if the transformation is
invalid. By default errcheck=False and ``inf`` is returned for an
invalid transformation (and no exception is raised).
If `always_xy` is toggled, the transform method will accept as
input and return as output coordinates using the traditional GIS order,
that is longitude, latitude for geographic CRS and easting,
northing for most projected CRS.

In addition to converting between cartographic and geographic
projection coordinates, this function can take care of datum
shifts (which cannot be done using the __call__ method of the
Proj instances). It also allows for one of the coordinate
systems to be geographic (proj = 'latlong').

x,y and z can be numpy or regular python arrays, python
lists/tuples or scalars. Arrays are fastest.  For projections in
geocentric coordinates, values of x and y are given in meters.
z is always meters.

zThis function is deprecated. See: https://pyproj4.github.io/pyproj/stable/gotchas.html#upgrading-to-pyproj-2-from-pyproj-1r   
stacklevelrE   )r   r   r   r   r   r   )r~   r   FutureWarningr   r   r   )	rD  rE  rF  rG  rH  r   r   r   rE   s	            r,   r   r     sP    f MM? 	   9 =GGq H  r/   r   r   r   c                 |    [         R                  " S[        SS9  [        R	                  XUS9R                  X#XEUS9$ )a	  
.. versionadded:: 2.2.0 always_xy

.. deprecated:: 2.6.1
    This function is deprecated. See: :ref:`upgrade_transformer`

points2 = itransform(p1, p2, points1)
Iterator/generator version of the function pyproj.transform.
Transform points between two coordinate systems defined by the
Proj instances p1 and p2. This function can be used as an alternative
to pyproj.transform when there is a need to transform a big number of
coordinates lazily, for example when reading and processing from a file.
Points1 is an iterable/generator of coordinates x1,y1(,z1) or lon1,lat1(,z1)
in the coordinate system defined by p1. Points2 is an iterator that returns tuples
of x2,y2(,z2) or lon2,lat2(,z2) coordinates in the coordinate system defined by p2.
z are provided optionally.

Points1 can be:
    - a tuple/list of tuples/lists i.e. for 2d points: [(xi,yi),(xj,yj),....(xn,yn)]
    - a Nx3 or Nx2 2d numpy array where N is the point number
    - a generator of coordinates (xi,yi) for 2d points or (xi,yi,zi) for 3d

If optional keyword 'switch' is True (default is False) then x, y or lon,lat
coordinates of points are switched to y, x or lat, lon.
If the optional keyword 'radians' is True (default is False),
then all input and output coordinates will be in radians instead
of the default of degrees for geographic input/output projections.
If the optional keyword 'errcheck' is set to True an
exception is raised if the transformation is
invalid. By default errcheck=False and ``inf`` is returned for an
invalid transformation (and no exception is raised).
If `always_xy` is toggled, the transform method will accept as
input and return as output coordinates using the traditional GIS order,
that is longitude, latitude for geographic CRS and easting, northing
for most projected CRS.


Example usage:

>>> from pyproj import Proj, itransform
>>> # projection 1: WGS84
>>> # (defined by epsg code 4326)
>>> p1 = Proj('epsg:4326', preserve_units=False)
>>> # projection 2: GGRS87 / Greek Grid
>>> p2 = Proj('epsg:2100', preserve_units=False)
>>> # Three points with coordinates lon, lat in p1
>>> points = [(22.95, 40.63), (22.81, 40.53), (23.51, 40.86)]
>>> # transform this point to projection 2 coordinates.
>>> for pt in itransform(p1,p2,points, always_xy=True): '%6.3f %7.3f' % pt
'411050.470 4497928.574'
'399060.236 4486978.710'
'458553.243 4523045.485'
>>> for pt in itransform(4326, 4326, [(30, 60)]):
...     '{:.0f} {:.0f}'.format(*pt)
'30 60'

rJ  r   rK  rM  )r   r   r   r   )r~   r   rN  r   r   r   )rD  rE  r   r   r   r   r   rE   s           r,   r   r     sP    F MM? 	   9 =HHH I  r/   )NNFFF)FFFFF):r5   __all__	threadingr~   abcr   r	   r
   collections.abcr   r   dataclassesr   	itertoolsr   r   pathlibr   typingr   r   r   r   pyproj._compatr   pyproj._contextr   pyproj._crsr   r   pyproj._transformerr   r   r   pyproj.datadirr   pyproj.enumsr   r   r   pyproj.exceptionsr   pyproj.syncr   pyproj.utilsr    r!   r#   r9   rA   rT   r   localr   r   rQ   r   r   r0   r/   r,   <module>rb     s     #  . ! #     % - 6 
 - D D ' / 4"s "& $ (    & $%
%
 %
P $>. > >$`
( `
F
y 
lC lCh >>> > 	>
 Tz> 	d
> > > >J NNN XN 	N
 N N N Nr/   