
    !\i"                     F    S SK r \ R                  " SS9 " S S5      5       rg)    NT)slotsc                   P   \ rS rSrSr\R                  " 5       r\R                  " 5       r\R                  " 5       r	\R                  " 5       r
\R                  " 5       r\R                  " 5       r\R                  " 5       r\R                  " 5       r\R                  " 5       r\R                  " 5       r\R                  " 5       r\R                  " 5       r\R                  " 5       r\R                  " 5       r\R                  " SS9r\R                  " SS9rS rS r\S 5       rSrg)	RPC   a9  Rational Polynomial Coefficients used to map (x, y, z) <-> (row, col) coordinates.

This class contains a mapping between various RPC attributes and values. 

Attributes
----------
err_bias, err_rand: float, optional
    The RMS bias and random error in meters per horizontal axis of all points in image.
lat_off, long_off, height_off: float
    Geodetic latitude, longitude, and height offset.
lat_scale, long_scale, height_scale: float
    Geodetic latitude, longitude, and height scaling.
line_off, samp_off: float
    Line (row) and sample (column) offset.
line_scale, samp_scale: float
    Line (row) and sample (column) offset.
line_num_coeff, line_den_coeff, samp_num_coeff, samp_den_coeff: list
    The twenty coefficients describing a numerator or denominator polynomial corresponding to line (row) or sample (col).
N)defaultc                 .    [         R                  " U 5      $ )z)Return a dictionary representation of RPC)attrasdict)selfs    O/var/www/html/kml_chatgpt/mouzaenv/lib/python3.13/site-packages/rasterio/rpc.pyto_dictRPC.to_dict+   s    {{4      c                    [        U R                  5      [        U R                  5      [        U R                  5      [        U R                  5      SR                  [        [         U R                  5      5      SR                  [        [         U R                  5      5      [        U R                  5      [        U R                  5      [        U R                  5      [        U R                  5      SR                  [        [         U R                  5      5      SR                  [        [         U R                  5      5      [        U R                  5      [        U R                   5      S.nU R"                  (       a"  UR%                  [        U R"                  5      S9  U R&                  (       a"  UR%                  [        U R&                  5      S9  U$ )zSerialize RPC attribute name and values in a form expected by GDAL.

Returns
-------
dict

Notes
-----
The `err_bias` and `err_rand` are optional, and are not written to datasets by GDAL.
 )
HEIGHT_OFFHEIGHT_SCALELAT_OFF	LAT_SCALELINE_DEN_COEFFLINE_NUM_COEFFLINE_OFF
LINE_SCALELONG_OFF
LONG_SCALESAMP_DEN_COEFFSAMP_NUM_COEFFSAMP_OFF
SAMP_SCALE)ERR_BIAS)ERR_RAND)str
height_offheight_scalelat_off	lat_scalejoinmapline_den_coeffline_num_coeffline_off
line_scalelong_off
long_scalesamp_den_coeffsamp_num_coeffsamp_off
samp_scaleerr_biasupdateerr_rand)r   outs     r   to_gdalRPC.to_gdal/   s,    doo. 1 124<<(T^^,!hhs30C0C'DE!hhs30C0C'DEDMM*doo.DMM*doo.!hhs30C0C'DE!hhs30C0C'DEDMM*doo.
" ==JJDMM 2J3==JJDMM 2J3
r   c                    0 nUR                  5        HX  u  p4US;   a0  UR                  SS9SS  Vs/ s H  n[        U5      PM     snX#'   M;  [        UR                  SS9S   5      X#'   MZ     U " S'0 SUR                  S5      _S	UR                  S
5      _SUS   _SUS   _SUS   _SUS   _SUS   _SUS   _SUS   _SUS   _SUS   _SUS   _SUS    _S!US"   _S#US$   _S%US&   _6$ s  snf )(z@Deserialize dict values to float or list.


Returns
-------
RPC
>   r   r   r   r      )maxsplitN   r   r3   r    r5   r!   r#   r   r$   r   r%   r   r&   r   r)   r   r*   r   r+   r   r,   r   r-   r   r.   r   r/   r   r0   r   r1   r   r2   r    )itemssplitfloatget)clsrpcsr6   keyvalvs         r   	from_gdalRPC.from_gdalS   sy    

HC^^.1iii.DSb.IJ.IE!H.IJ !A!6q!9: %  
WWZ(
WWZ(
 <(
 ^,	

 	N
 +&
 /0
 /0
 _
 <(
 _
 <(
 /0
 /0
 _
  <(!
 	
 Ks   C-r=   )__name__
__module____qualname____firstlineno____doc__r	   ibr#   r$   r%   r&   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r5   r   r7   classmethodrG   __static_attributes__r=   r   r   r   r      s    ( J779LggiG	IWWYNWWYNwwyHJwwyHJWWYNWWYNwwyHJwwt$Hwwt$H!"H #
 #
r   r   )r	   sr   r=   r   r   <module>rR      s-     dr
 r
 r
r   