
    `jA                        S r SSKJr  SSKJr  SSKrSSKrSSKJr  SSKrSSK	r	\	R                  " 5       S:X  Ga  \R                  R                  \R                  R                  \5      S5      r\R                  R!                  \5      (       a  \R"                  " \5        OS\R$                  ;   a  \R$                  S   R'                  \R(                  5       Hj  r\(       d  M  \R
                  " \R                  R                  \S	5      5      (       d  M?  \R"                  " \R                  R-                  \5      5        Ml     SS
KJr  SSKJr  SSKJr  SSKJr  SSKJ r J!r!J"r"  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/J0r0J1r1J2r2J3r3J4r4J5r5J6r6J7r7J8r8J9r9  SSK:J;r;J<r<  SSK=J>r>J?r?J@r@  SSKAJBrBJCrCJDrDJErE  SSKFJGrG  SSKHJIrIJJrJ  SSKKJLrLJMrM  SSKNrOSSKPrOSSKQrOSSKKrO SSKAJRrR  SrS/ SQrUSrV\ " 5       rWSR                  \"" 5        V s/ s H  n \X" U 5      PM     sn 5      rYSR                  \!" 5        V s/ s H  n \X" U 5      PM     sn 5      rZ\R                  " \\5      r]\]R                  \" 5       5        \;            S&S  j5       r_\" S!/ S"Q5      r`S#\`l         S$ raS'S% jrbg! \T a     " S S5      rRSrS Nf = fs  sn f s  sn f )(Rasterio    )
namedtuple)	ExitStackN)NullHandlerWindowsz.libsPATHz	gdal*.dll)DatasetBase)
Statistics)_opener_registration)show_versions)gdal_versionget_geos_versionget_proj_version)CRS)driver_from_extensionis_blacklisted)bool_ubytesbyteuint8int8uint16int16uint32int32int64uint64float16float32float64complex_check_dtypecomplex_int16)ensure_env_with_credentialsEnv)RasterioIOErrorDriverCapabilityErrorRasterioDeprecationWarning)DatasetReaderget_writer_for_pathget_writer_for_driver
MemoryFile)default_gtiff_profile)Affineguard_transform)_parse_path_UnparsedPath)FilePathTc                       \ rS rSrSrg)r2   P    N)__name__
__module____qualname____firstlineno____static_attributes__r5       T/var/www/html/Sattelite-Image/venv/lib/python3.13/site-packages/rasterio/__init__.pyr2   r2   P   s    r;   r2   F)bandopenpadBandr%   r   z1.5.0.c                   ^ ^ [        T [        5      (       d  [        T S5      (       dL  [        T S5      (       d;  [        T S5      (       d*  [        T [        R                  [
        [        45      (       a  [        T [        5      (       a  [        ST < 35      e[        U[        5      (       d  [        SU< 35      eUS   S;  a  [        SU< 35      eU(       a$  [        U[        5      (       d  [        SU< 35      eU(       a  [        U5      (       d  [        S	U< 35      eU	b  [        U	5      n	U(       a  [        U5      nU(       a*  [        X!5      (       a  [        S
R                  X!5      5      e[        T [        [
        45      (       aK  UR!                  S5      (       a  T R"                  " SX*US.UD6nU$ T R"                  " SUUUUUUUU	U
S.	UD6nU$ US:X  al  [        T S5      (       a[  [        T R%                  5       5      mT R'                  S5        TR"                  " SX*S.UD6nUR(                  R+                  T5        U$ US;   av  [        T S5      (       ae  [        5       mTR"                  " SUUUUUUUU	U
S.	UD6nUR(                  R+                  T5        U U4S jnUR(                  R-                  U5        U$ [/        5       n[        T S5      (       aJ  [        T S5      (       a9  [0        R3                  ST 5        T R4                  nT R6                  R"                  nO[        R8                  " T 5      n U(       a)  [;        UU5      nUR+                  U5      n[=        U5      nO[?        U5      nUS:X  a  [A        U4X*US.UD6nOUS:X  a  [C        UUS9" UU4X*S.UD6nOpUR!                  S5      (       aL  U(       d  [E        U5      n[G        U5      nUb  U" UU4UUUUUUUU	U
S.	UD6nO%[I        S[        U5      -  5      e[I        SU-  5      eUUl        U$ ! [J         a    URM                  5         e f = f)a  Open a dataset for reading or writing.

The dataset may be located in a local file, in a resource located by
a URL, or contained within a stream of bytes. This function accepts
different types of fp parameters. However, it is almost always best
to pass a string that has a dataset name as its value. These are
passed directly to GDAL protocol and format handlers. A path to
a zipfile is more efficiently used by GDAL than a Python ZipFile
object, for example.

In read ('r') or read/write ('r+') mode, no keyword arguments are
required: these attributes are supplied by the opened dataset.

In write ('w' or 'w+') mode, the driver, width, height, count, and
dtype keywords are strictly required.

Parameters
----------
fp : str, os.PathLike, file-like, or rasterio.io.MemoryFile
    A filename or URL, a file object opened in binary ('rb') mode,
    a Path object, or one of the rasterio classes that provides the
    dataset-opening interface (has an open method that returns
    a dataset). Use a string when possible: GDAL can more
    efficiently access a dataset if it opens it natively.
mode : str, optional
    'r' (read, the default), 'r+' (read/write), 'w' (write), or
    'w+' (write/read).
driver : str, optional
    A short format driver name (e.g. "GTiff" or "JPEG") or a list of
    such names (see GDAL docs at
    https://gdal.org/drivers/raster/index.html). In 'w' or 'w+' modes
    a single name is required. In 'r' or 'r+' modes the driver can
    usually be omitted. Registered drivers will be tried
    sequentially until a match is found. When multiple drivers are
    available for a format such as JPEG2000, one of them can be
    selected by using this keyword argument.
width : int, optional
    The number of columns of the raster dataset. Required in 'w' or
    'w+' modes, it is ignored in 'r' or 'r+' modes.
height : int, optional
    The number of rows of the raster dataset. Required in 'w' or
    'w+' modes, it is ignored in 'r' or 'r+' modes.
count : int, optional
    The count of dataset bands. Required in 'w' or 'w+' modes, it is
    ignored in 'r' or 'r+' modes.
crs : str, dict, or CRS, optional
    The coordinate reference system. Required in 'w' or 'w+' modes,
    it is ignored in 'r' or 'r+' modes.
transform : affine.Affine, optional
    Affine transformation mapping the pixel space to geographic
    space. Required in 'w' or 'w+' modes, it is ignored in 'r' or
    'r+' modes.
dtype : str or numpy.dtype, optional
    The data type for bands. For example: 'uint8' or
    `rasterio.uint16`. Required in 'w' or 'w+' modes, it is
    ignored in 'r' or 'r+' modes.
nodata : int, float, or nan, optional
    Defines the pixel value to be interpreted as not valid data.
    Required in 'w' or 'w+' modes, it is ignored in 'r' or 'r+'
    modes.
sharing : bool, optional
    To reduce overhead and prevent programs from running out of file
    descriptors, rasterio maintains a pool of shared low level
    dataset handles. If True this function will use a shared
    handle if one is available. Multithreaded programs must avoid
    sharing and should set *sharing* to False.
thread_safe: bool, optional
    Open GDAL dataset in `thread safe mode <https://gdal.org/en/stable/user/multithreading.html>`__.
    For multithreaded read-only GDAL dataset operations (e.g. ``GDAL_NUM_THREADS``, `LIBERTIFF driver <https://gdal.org/en/stable/drivers/raster/libertiff.html#open-options>`__).
    Requires rasterio 1.5+ & GDAL 3.10+.
opener : callable, optional
    A custom dataset opener which can serve GDAL's virtual
    filesystem machinery via Python file-like objects. The
    underlying file-like object is obtained by calling *opener* with
    (*fp*, *mode*) or (*fp*, *mode* + 'b') depending on the format
    driver's native mode. *opener* must return a Python file-like
    object that provides read, seek, tell, and close methods. Note:
    only one opener at a time per fp, mode pair is allowed.
kwargs : optional
    These are passed to format drivers as directives for creating or
    interpreting datasets. For example: in 'w' or 'w+' modes
    a tiled=True keyword argument will direct the GeoTIFF format
    driver to create a tiled, rather than striped, TIFF.

Returns
-------
:class:`rasterio.io.DatasetReader`
    If mode is 'r'.
:class:`rasterio.io.DatasetWriter`
    If mode is 'r+', 'w', or 'w+'.

Raises
------
:class:`TypeError`
    If arguments are of the wrong Python type.
:class:`rasterio.errors.RasterioIOError`
    If the dataset can not be opened. Such as when there is no
    dataset with the given name.
:class:`rasterio.errors.DriverCapabilityError`
    If the detected format driver does not support the requested
    opening mode.

Notes
-----
If *fp* is a is a file-like object, its entire contents will be
read into a MemoryFile instance. It will almost always be better
to use a path or URL, or the *opener* keyword argument.

Examples
--------
To open a local GeoTIFF dataset for reading using standard driver
discovery and no directives:

>>> import rasterio
>>> with rasterio.open('example.tif') as dataset:
...     print(dataset.profile)

To open a local JPEG2000 dataset using only the JP2OpenJPEG driver:

>>> with rasterio.open(
...         'example.jp2', driver='JP2OpenJPEG') as dataset:
...     print(dataset.profile)

To create a new 8-band, 16-bit unsigned, tiled, and LZW-compressed
GeoTIFF with a global extent and 0.5 degree resolution:

>>> from rasterio.transform import from_origin
>>> with rasterio.open(
...         'example.tif', 'w', driver='GTiff', dtype='uint16',
...         width=720, height=360, count=8, crs='EPSG:4326',
...         transform=from_origin(-180.0, 90.0, 0.5, 0.5),
...         nodata=0, tiled=True, compress='lzw') as dataset:
...     dataset.write(...)
r>   readwritezinvalid path or file: zinvalid mode: r   )rwzinvalid driver: zinvalid dtype: z>Blacklisted: file cannot be opened by driver '{}' in '{}' moderE   )driversharingthread_safe)	rG   widthheightcountcrs	transformdtypenodatarH   )rG   rH   )rF   zw+c                  f   > TR                  S5        TR                  TR                  5       5        g )Nr   )seekrD   rC   )argskwdsfpmemfiles     r<   funcopen.<locals>.funcN  s     LLOHHW\\^$r;   pathfsz!Detected fp is an OpenFile: fp=%rzr+)rG   rF   z$Writer does not exist for driver: %sz-mode must be one of 'r', 'r+', or 'w', not %sr5   )'
isinstancestrhasattrosPathLiker,   r2   r	   	TypeError
ValueErrorr"   floatr/   r   r&   format
startswithr>   rC   rR   _enventer_contextcallbackr   logdebugrY   rZ   fspathr   r1   r0   r)   r*   r   r+   r'   	Exceptionclose)rU   moderG   rJ   rK   rL   rM   rN   rO   rP   rH   rI   openerkwargsdatasetrW   stackraw_dataset_pathvsi_path_ctxregistered_vsi_pathrY   writerrV   s   `                     @r<   r>   r>   d   sF   n b#Br6""r7##"r{{JABBK((4RF;<<dC  .122	a
	">$233j--*6*566[''/%344v#I.	 ...''-vf';
 	
 
B:.	/	/??3gg`V+`Y_`G$  gg # G  
V,,RWWY'

,,HfHH""7+		W!5!5,,, 

 
 	""7+
	% 	d#
 2v72t#4#4II92>!wwUUZZF!yy}/	 34DfM&+&9&9,&G#$%89"#34s{'pVZepiop-d6B$'-BH %%248F.v6%$  &#%#"+#% ' !G 0>VL  ,CdJL L   	KKM	s    AP, P, 3A
P, >%P, ,Qr@   )dsbidxrO   shapea  
Band(s) of a Dataset.

Parameters
----------
ds: dataset object
    An opened rasterio dataset object.
bidx: int or sequence of ints
    Band number(s), index starting at 1.
dtype: str
    rasterio data type of the data.
shape: tuple
    Width, height of band.
c                 r    [        X[        U R                  5      R                  5       U R                  5      $ )zA dataset and one or more of its bands

Parameters
----------
ds: dataset object
    An opened rasterio dataset object.
bidx: int or sequence of ints
    Band number(s), index starting at 1.

Returns
-------
Band
)r@   setdtypespoprx   )rv   rw   s     r<   r=   r=     s(     #bii.,,.99r;   c                     SSK n[        U5      nUR                  " XU40 UD6n[        U5      nUS==   X'S   -  -  ss'   US==   X'S   -  -  ss'   U[	        USS 6 4$ )a  pad array and adjust affine transform matrix.

Parameters
----------
array: numpy.ndarray
    Numpy ndarray, for best results a 2D array
transform: Affine transform
    transform object mapping pixel space to coordinates
pad_width: int
    number of pixels to pad array on all four
mode: str or function
    define the method for determining padded values

Returns
-------
(array, transform): tuple
    Tuple of new array and affine transform

Notes
-----
See :func:`numpy.pad` for details on mode and other kwargs.
r   N            )numpyr/   r?   listr.   )arrayrN   	pad_widthrm   ro   nppadded_arraypadded_transs           r<   r?   r?     sp    . 	*I66%D;F;L	?LOy?22OOy?22Obq!1222r;   )rE   NNNNNNNNFFN)N)c__doc__collectionsr   
contextlibr   globloggingr   r^   platformsystemrY   joindirname__file___whl_direxistsadd_dll_directoryenvironsplitpathseppabspathrasterio._baser	   rasterio._ior
   rasterio._vsiopenerr   rasterio._show_versionsr   rasterio._versionr   r   r   rasterio.crsr   rasterio.driversr   r   rasterio.dtypesr   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   rasterio.envr$   r%   rasterio.errorsr&   r'   r(   rasterio.ior)   r*   r+   r,   rasterio.profilesr-   rasterio.transformr.   r/   rasterio._pathr0   r1   rasterio._errrasteriorasterio.coordsrasterio.enumsr2   have_vsi_pluginImportError__all____version____gdal_version__r\   __proj_version____geos_version__	getLoggerr6   rh   
addHandlerr>   r@   r=   r?   )versions   0r<   <module>r      s[    "      	  ??	!ww||BGGOOH5w?H	ww~~h
X&RZZZZ'--bjj91277<<;#?@@(();< : ' # 4 1 N N  B    & : 
  4 6 5    	$O 8> 889I9KL9KgS\9KLM 889I9KL9KgS\9KLM  ! {}   



n nb	 &:; :"3U    O MLs   $J, K:K	,K K