403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/django/contrib/gis/gdal/raster/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/django/contrib/gis/gdal/raster/__pycache__/band.cpython-311.pyc
�

�|�e7 ���ddlmZmZmZmZddlmZddlmZ	ddl
mZddlm
Z
ddlmZddlmZmZmZmZGd	�d
e��ZGd�de��Zd
S)�)�byref�c_double�c_int�c_void_p)�
GDALException)�raster)�GDALRasterBase)�numpy)�	force_str�)�GDAL_COLOR_TYPES�GDAL_INTEGER_TYPES�GDAL_PIXEL_TYPES�GDAL_TO_CTYPESc�(�eZdZdZd�Zd�Zed���Zed���Zed���Z	ed���Z
dZdd	�Zed
���Z
ed���Zed���Zed
���Zed���Zejd���Zdd�Zdd�Zdd�ZdS)�GDALBandzQ
    Wrap a GDAL raster band, needs to be obtained from a GDALRaster object.
    c�R�||_tj|j|��|_dS�N)�source�capi�get_ds_raster_band�_ptr)�selfr�indexs   �E/usr/lib/python3/dist-packages/django/contrib/gis/gdal/raster/band.py�__init__zGDALBand.__init__s#������+�F�K��?�?��	�	�	�c�F�|j���d|_dS)z�
        Call the flush method on the Band's parent raster and force a refresh
        of the statistics attribute when requested the next time.
        TN)r�_flush�_stats_refresh�rs rrzGDALBand._flushs&��
	
�������"����rc�N�ttj|j����S)z<
        Return the description string of the band.
        )rr�get_band_descriptionrr!s r�descriptionzGDALBand.descriptions��
��2�4�9�=�=�>�>�>rc�4�tj|j��S)z7
        Width (X axis) in pixels of the band.
        )r�get_band_xsizerr!s r�widthzGDALBand.width%���
�"�4�9�-�-�-rc�4�tj|j��S)z8
        Height (Y axis) in pixels of the band.
        )r�get_band_ysizerr!s r�heightzGDALBand.height,r(rc� �|j|jzS)zA
        Return the total number of pixels in this band.
        )r'r+r!s r�pixel_countzGDALBand.pixel_count3s��
�z�D�K�'�'rFc	�N�t��t��t��t��f\}}}}|jt|��t|��t|��t|��t|��t	��t	��g}|s|jr
tj}n1d}	|�dt|	����tj	}	||�|j
|j
|j
|j
f}
n#t$rd}
YnwxYwd|_|
S)a�
        Compute statistics on the pixel values of this band.

        The return value is a tuple with the following structure:
        (minimum, maximum, mean, standard deviation).

        If approximate=True, the statistics may be computed based on overviews
        or a subset of image tiles.

        If refresh=True, the statistics will be computed from the data directly,
        and the cache will be updated where applicable.

        For empty bands (where all pixel values are nodata), all statistics
        values are returned as None.

        For raster formats using Persistent Auxiliary Metadata (PAM) services,
        the statistics might be cached in an auxiliary file.
        T�)NNNNF)rrrrrr r�compute_band_statistics�insert�get_band_statistics�valuer)r�refresh�approximate�smin�smax�smean�sstd�
stats_args�func�force�results           r�
statisticszGDALBand.statistics<s��(#+�*�*�h�j�j�(�*�*�h�j�j�"P���d�E�4��I�u�[�)�)�5��;�;��d����%�L�L�%��+�+�x�z�z�8�:�:�
�
�
�	,�d�)�	,��/�D�D��E����a��u���.�.�.��+�D�	.��D�*����Z���U�[�$�*�D�F�F���	.�	.�	.�-�F�F�F�	.����$����
s�,D�D�Dc�6�|���dS)z?
        Return the minimum pixel value for this band.
        r�r>r!s r�minzGDALBand.minj���
��� � ��#�#rc�6�|���dS)z?
        Return the maximum pixel value for this band.
        rr@r!s r�maxzGDALBand.maxqrBrc�6�|���dS)zC
        Return the mean of all pixel values of this band.
        r/r@r!s r�meanz
GDALBand.meanxrBrc�6�|���dS)zQ
        Return the standard deviation of all pixel values of this band.
        �r@r!s r�stdzGDALBand.stdrBrc��t��}tj|j|��}|sd}n*|���t
vrt
|��}|S)zQ
        Return the nodata value for this band, or None if it isn't set.
        N)rr�get_band_nodata_valuer�datatyper�int)r�
nodata_existsr3s   r�nodata_valuezGDALBand.nodata_value�sT�����
��*�4�9�m�D�D���	��E�E�
�]�]�_�_� 2�
2�
2���J�J�E��rc�&�|�5tjstd���tj|j��nEt	|t
tf��std���tj|j|��|���dS)z5
        Set the nodata value for this band.
        Nz-GDAL >= 2.1 required to delete nodata values.z%Nodata value must be numeric or None.)	r�delete_band_nodata_value�
ValueErrorr�
isinstancerM�float�set_band_nodata_valuer)rr3s  rrOzGDALBand.nodata_value�s���
�=��0�
R� �!P�Q�Q�Q��)�$�)�4�4�4�4��E�C��<�0�0�	9��D�E�E�E��&�t�y�%�8�8�8����
�
�
�
�
rc�V�tj|j��}|r
t|}|S)z?
        Return the GDAL Pixel Datatype for this band.
        )r�get_band_datatyperr)r�	as_string�dtypes   rrLzGDALBand.datatype�s-���&�t�y�1�1���	,�$�U�+�E��rc�V�tj|j��}|r
t|}|S)z3Return the GDAL color interpretation for this band.)r�get_band_color_interprr
)rrX�colors   r�color_interpzGDALBand.color_interp�s+���*�4�9�5�5���	,�$�U�+�E��rNc�2�|pd}|p|j|dz
|j|dz
f}|p|}td�|D����rtd���|d|jks|d|jkrtd���t|���|d|dzz}|�
d}|��}nZd}t
|ttf��s!tr0t
|tj
��r|�|��}n||�}tj
|j||d|d|d|dt|��|d|d|���dd��|�||rt|��StrUtj|tj|������t't)|������St+|��S|���dS)	ae
        Read or writes pixel values for this band. Blocks of data can
        be accessed by specifying the width, height and offset of the
        desired block. The same specification can be used to update
        parts of a raster by providing an array of values.

        Allowed input data types are bytes, memoryview, list, tuple, and array.
        )rrrrc3�"K�|]
}|dkV��dS)rN�)�.0�xs  r�	<genexpr>z GDALBand.data.<locals>.<genexpr>�s&����$�$�!�q�A�v�$�$�$�$�$�$rzOffset too big for this raster.zSize is larger than raster.N)rY)r'r+�anyrRrrLrS�bytes�
memoryviewr
�ndarray�from_buffer_copyr�band_iorr�
frombufferrY�reshape�tuple�reversed�listr)	r�data�offset�size�shape�
as_memoryview�ctypes_array�access_flag�
data_arrays	         rroz
GDALBand.data�s���!�6���H��
�V�A�Y�.���f�Q�i�0G�H���
����$�$�t�$�$�$�$�$�	@��>�?�?�?���7�T�Z���4��7�T�[�#8�#8��:�;�;�;�&�d�m�m�o�o�6�%��(�U�1�X�:M�N���<��K�%����J�J��K��$��
� 3�4�4�
1��
1�:�d�TY�Ta�Cb�Cb�
1�)�:�:�4�@�@�
�
�)�\�4�0�
�	
��T�Y��V�A�Y��q�	��!�W�d�1�g�u�Z�'8�'8�%��(��1�X�t�}�}����1�	6�	6�	6�
�<��
(�!�*�-�-�-��
(��'��e�k�*�&=�&=�����'�%�����/�/�0�0�1��J�'�'�'��K�K�M�M�M�M�Mr)FF)F)NNNNF)�__name__�
__module__�__qualname__�__doc__rr�propertyr$r'r+r-r r>rArDrFrIrO�setterrLr]ror`rrrrs���������@�@�@�#�#�#��?�?��X�?��.�.��X�.��.�.��X�.��(�(��X�(��N�,�,�,�,�\�$�$��X�$��$�$��X�$��$�$��X�$��$�$��X�$�����X�����������������5�5�5�5�5�5rrc�0��eZdZ�fd�Zd�Zd�Zd�Z�xZS)�BandListc�V��||_t�����dSr)r�superr)rr�	__class__s  �rrzBandList.__init__�s&������
���������rc#�~K�tdt|��dz��D]}t|j|��V��dS)Nr)�range�lenrr)r�idxs  r�__iter__zBandList.__iter__�sN������C��I�I��M�*�*�	-�	-�C��4�;��,�,�,�,�,�,�	-�	-rc�>�tj|jj��Sr)r�get_ds_raster_countrrr!s r�__len__zBandList.__len__�s���'���(8�9�9�9rc�t�	t|j|dz��S#t$rtd|z���wxYw)NrzUnable to get band index %d)rrr)rrs  r�__getitem__zBandList.__getitem__�sQ��	G��D�K����3�3�3���	G�	G�	G�� =�� E�F�F�F�	G���s��7)rwrxryrr�r�r��
__classcell__)r�s@rr~r~�sl������������-�-�-�:�:�:�G�G�G�G�G�G�Grr~N)�ctypesrrrr�django.contrib.gis.gdal.errorr�"django.contrib.gis.gdal.prototypesrr�#django.contrib.gis.gdal.raster.baser	�django.contrib.gis.shortcutsr
�django.utils.encodingr�constr
rrrrrnr~r`rr�<module>r�s0��3�3�3�3�3�3�3�3�3�3�3�3�7�7�7�7�7�7�=�=�=�=�=�=�>�>�>�>�>�>�.�.�.�.�.�.�+�+�+�+�+�+�������������
[�[�[�[�[�~�[�[�[�|G�G�G�G�G�t�G�G�G�G�Gr

Youez - 2016 - github.com/yon3zu
LinuXploit