
    \iz              	           S r SSKrSSKJr  SSKJrJr  SSKJr  S\S\4S jr	S\S\4S	 jr
 " S
 S\R                  5      r " S S\5      rS\S\\\4   4S jrSS\S\S\\\4   4S jjrS\S\S\4S jrg)z&
Utility functions used within pyproj
    N)array)Enumauto)Anyvaluereturnc                      X :g  =(       d    U SL $ )z
Check if value is NaN or None
N r   s    O/var/www/html/kml_chatgpt/mouzaenv/lib/python3.13/site-packages/pyproj/utils.pyis_nullr      s    
 >*Ud]*    c                 n    [        U 5      R                  5       n U S;   a  gU S;   a  g[        SU  S35      e)z
https://docs.python.org/3.9/distutils/apiref.html#distutils.util.strtobool

Here since distutils is deprecated.

Convert a string representation of truth to True or False.
)yyesttrueon1T)nnoffalseoff0Fzinvalid truth value: '')strlower
ValueErrorr   s    r   	strtoboolr       sC     JE4455
-eWA6
77r   c                       \ rS rSrSrS rSrg)NumpyEncoder#   z)
Handle numpy types when dumping to JSON
c                 :    UR                  5       $ ! [         a     Of = f UR                  R                  S:X  a  [	        U5      $ UR                  R                  S:X  a  [        U5      $ O! [         a     Of = f[        R                  R                  X5      $ )Nr   i)	tolistAttributeErrordtypekindfloatintjsonJSONEncoderdefault)selfobjs     r   r.   NumpyEncoder.default(   s    	::< 			yy~~$Sz!yy~~$3x % 		''22s#    
$A. $A. .
A;:A;r
   N)__name__
__module____qualname____firstlineno____doc__r.   __static_attributes__r
   r   r   r"   r"   #   s    3r   r"   c                   P    \ rS rSrSr\" 5       r\" 5       r\" 5       r\" 5       r	Sr
g)DataType8   z9
Data type for copy to buffer and convertback operations
r
   N)r2   r3   r4   r5   r6   r   FLOATLISTTUPLEARRAYr7   r
   r   r   r9   r9   8   s%     FE6DFEFEr   r9   xxxc                      [        S[        U 5      45      [        R                  4$ ! [         a    [        S5      Sef = f)ab  
Prepares scalar for PROJ C-API:
- Makes a copy because PROJ modifies buffer in place
- Make sure dtype is double as that is what PROJ expects
- Makes sure object supports Python Buffer API

Parameters
-----------
xxx: float or 0-d numpy array

Returns
-------
tuple[Any, DataType]
    The copy of the data prepared for the PROJ API & Python Buffer API.
dzinput must be a scalarN)r   r*   r9   r;   	Exception	TypeError)r?   s    r   _copytobuffer_return_scalarrD   C   s@     <S5:-((..88 <01t;<s   %( ?inplacec                    [        U S5      (       d;  [        U S5      (       a*  [        U R                  5      (       a  U R                  5       n [        U S5      (       aA  U R                  S:X  a  [	        U 5      $ U R                  SSU(       + S9[        R                  4$ [        R                  n[        U [        5      (       a&  U(       a  U R                  S:w  a  [        SU 5      n X4$ [        U [        5      (       a  [        SU 5      n [        R                  nX4$ [        U [        5      (       a  [        SU 5      n [        R                  nX4$ [	        U 5      $ )a  
Prepares data for PROJ C-API:
- Makes a copy because PROJ modifies buffer in place
- Make sure dtype is double as that is what PROJ expects
- Makes sure object supports Python Buffer API

If the data is a numpy array, it ensures the data is in C order.

Parameters
----------
xxx: Any
    A scalar, list, tuple, numpy.array,
    pandas.Series, xaray.DataArray, or dask.array.Array.
inplace: bool, default=False
    If True, will return the array without a copy if it
    meets the requirements of the Python Buffer API & PROJ C-API.

Returns
-------
tuple[Any, DataType]
    The copy of the data prepared for the PROJ API & Python Buffer API.
hardmask	__array__shaper
   rA   C)ordercopy)hasattrcallablerH   rI   rD   astyper9   r>   
isinstancer   typecodelistr<   tupler=   )r?   rE   	data_types      r   _copytobufferrU   Y   s   8 C$$C%%S]]##mmo sG99? /s33zz#S7{z;X^^KKI#u#,,#-S/C > 
C		CoMM	 > 
C		CoNN	 > +3//r   rT   inxc                     U [         R                  :X  a  US   $ U [         R                  :X  a  UR                  5       $ U [         R                  :X  a  [        U5      $ U$ )Nr   )r9   r;   r<   r&   r=   rS   )rT   rV   s     r   _convertbackrX      sJ    HNN"1vHMM!zz|HNN"SzJr   )F)r6   r,   r   enumr   r   typingr   boolr   r    r-   r"   r9   rS   rD   rU   rX   r
   r   r   <module>r\      s       +3 +4 +8S 8T 8 34## 3*t <S <U5(?-C <,6s 6T 6eCM6J 6rH 3 3 r   