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/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

�|�eP!���ddlmZmZddlmZddlmZmZddlm	Z	m
Z
ddlmZddl
mZddlmZddlmZdd	lmZmZmZdd
lmZddlmZmZGd�d
e��ZdS)�)�byref�c_double)�GDALBase)�Envelope�OGREnvelope)�
GDALException�SRSException)�Feature)�
OGRFieldTypes)�OGRGeometry)�OGRGeomType)�ds�geom�srs)�SpatialReference)�force_bytes�	force_strc�L�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	e
d���Ze
d	���Ze
dd���Z
e
d���Ze
d
���Ze
d���Ze
d���Ze
d���Ze
d���Ze
d���Zd�Zd�Ze
ee��Zd�Zdd�Zd�ZdS)�LayerzSA class that wraps an OGR Layer, needs to be instantiated from a DataSource object.c��|std���||_||_tj|j��|_|�d��|_dS)a7
        Initialize on an OGR C pointer to the Layer and the `DataSource` object
        that owns this layer.  The `DataSource` object is required so that a
        reference to it is kept with this Layer.  This prevents garbage
        collection of the `DataSource` while this Layer is still active.
        z*Cannot create Layer, invalid pointer givens
RandomReadN)	r�ptr�_ds�capi�get_layer_defn�_ptr�_ldefn�test_capability�_random_read)�self�	layer_ptrrs   �?/usr/lib/python3/dist-packages/django/contrib/gis/gdal/layer.py�__init__zLayer.__init__sZ���	N�� L�M�M�M��������)�$�)�4�4��� �0�0��?�?�����c�@��t|t��r*|dkrtd�����|��St|t��r;|��j��\}}}�fd�t|||��D��Std���)z'Get the Feature at the specified index.rz/Negative indices are not allowed on OGR Layers.c�:��g|]}��|����S�)�
_make_feature)�.0�fidrs  �r!�
<listcomp>z%Layer.__getitem__.<locals>.<listcomp>3s'���R�R�R��D�&�&�s�+�+�R�R�Rr#z>Integers and slices may only be used when indexing OGR Layers.)	�
isinstance�int�
IndexErrorr'�slice�indices�num_feat�range�	TypeError)r�index�start�stop�strides`    r!�__getitem__zLayer.__getitem__'s�����e�S�!�!�	^��q�y�y� �!R�S�S�S��%�%�e�,�,�,�
��u�
%�
%�	^�"'�-�-��
�">�">��E�4��R�R�R�R�u�U�D�&�7Q�7Q�R�R�R�R��\�]�]�]r#c#�K�tj|j��t|j��D]+}ttj|j��|��V��,dS)z'Iterate over each Feature in the Layer.N)r�
reset_readingrr1r0r
�get_next_feature)r�is  r!�__iter__zLayer.__iter__7sh����	
��4�9�%�%�%��t�}�%�%�	B�	B�A��$�/��	�:�:�D�A�A�A�A�A�A�	B�	Br#c��|jS)z%The length is the number of features.)r0�rs r!�__len__z
Layer.__len__>s
���}�r#c��|jS)zThe string name of the layer.)�namer>s r!�__str__z
Layer.__str__Bs
���y�r#c���|jr9	ttj|j|��|��S#t
$rYnwxYw|D]}|j|kr|cS�td|z���)a.
        Helper routine for __getitem__ that constructs a Feature from the given
        Feature ID.  If the OGR Layer does not support random-access reading,
        then each feature of the layer will be incremented through until the
        a Feature is found matching the given feature ID.
        zInvalid feature id: %s.)rr
r�get_featurerrr)r-)r�feat_id�feats   r!r'zLayer._make_featureFs�����	 �
��t�/���'�B�B�D�I�I�I�� �
�
�
���
����
�
 �
 ���8�w�&�&��K�K�K�'��2�W�<�=�=�=s�'1�
>�>c��t��}tj|jt	|��d��t|��S)z.Return the extent (an Envelope) of this layer.�)rr�
get_extentrrr)r�envs  r!�extentzLayer.extent]s5���m�m������%��*�*�a�0�0�0���}�}�r#c�l�tj|j��}t||jjd���S)z1Return the name of this layer in the Data Source.T��strings_only)r�get_fd_namerrr�encoding)rrAs  r!rAz
Layer.nameds0������,�,����t�x�0�t�D�D�D�Dr#rHc�6�tj|j|��S)z+Return the number of features in the Layer.)r�get_feature_countr)r�forces  r!r0zLayer.num_featjs���%�d�h��6�6�6r#c�4�tj|j��S)z)Return the number of fields in the Layer.)r�get_field_countrr>s r!�
num_fieldszLayer.num_fieldsos���#�D�K�0�0�0r#c�N�ttj|j����S)z4Return the geometry type (OGRGeomType) of the Layer.)r
r�get_fd_geom_typerr>s r!�	geom_typezLayer.geom_typets���4�0���=�=�>�>�>r#c��	tj|j��}tt	j|����S#t$rYdSwxYw)z0Return the Spatial Reference used in this Layer.N)r�
get_layer_srsrr�srs_api�	clone_srsr	)rrs  r!rz	Layer.srsysT��	��$�T�X�.�.�C�#�G�$5�c�$:�$:�;�;�;���	�	�	��4�4�	���s�9<�
A
�	A
c�D���fd�t�j��D��S)zt
        Return a list of string names corresponding to each of the Fields
        available in this Layer.
        c
���g|]H}ttjtj�j|�����jjd�����IS)TrM)rr�get_field_name�get_field_defnrrrP�r(r;rs  �r!r*z Layer.fields.<locals>.<listcomp>�sa���+�+�+������ 3�D�K�� C� C�D�D��H��D�
�
�
�+�+�+r#�r1rVr>s`r!�fieldszLayer.fields�s:���+�+�+�+����)�)�+�+�+�	+r#c�D���fd�t�j��D��S)z�
        Return a list of the types of fields in this Layer.  For example,
        return the list [OFTInteger, OFTReal, OFTString] for an OGR layer that
        has an integer, a floating-point, and string fields.
        c	�~��g|]9}ttjtj�j|������:Sr&)rr�get_field_typerarrbs  �r!r*z%Layer.field_types.<locals>.<listcomp>�sI���1�1�1���d�1�$�2E�d�k�ST�2U�2U�V�V�W�1�1�1r#rcr>s`r!�field_typeszLayer.field_types�s8���1�1�1�1��t��/�/�1�1�1�	1r#c�D���fd�t�j��D��S)z;Return a list of the maximum field widths for the features.c�h��g|].}tjtj�j|������/Sr&)r�get_field_widthrarrbs  �r!r*z&Layer.field_widths.<locals>.<listcomp>�sC���1�1�1���$�T�%8���a�%H�%H�I�I�1�1�1r#rcr>s`r!�field_widthszLayer.field_widths��8���1�1�1�1��t��/�/�1�1�1�	1r#c�D���fd�t�j��D��S)z-Return the field precisions for the features.c�h��g|].}tjtj�j|������/Sr&)r�get_field_precisionrarrbs  �r!r*z*Layer.field_precisions.<locals>.<listcomp>�sC���1�1�1���(��)<�T�[�!�)L�)L�M�M�1�1�1r#rcr>s`r!�field_precisionszLayer.field_precisions�rmr#c��	ttjtj|j������S#t$rYdSwxYw)N)r�geom_api�
clone_geomr�get_spatial_filterrrr>s r!�_get_spatial_filterzLayer._get_spatial_filter�sO��	��x�2�4�3J�4�8�3T�3T�U�U�V�V�V���	�	�	��4�4�	���s�7:�
A�Ac��t|t��r!tj|j|j��dSt|t
tf��r[t|��dkstd���tt|��\}}}}tj|j||||��dS|�tj|jd��dStd���)N�z/Spatial filter list/tuple must have 4 elements.zJSpatial filter must be either an OGRGeometry instance, a 4-tuple, or None.)
r+rr�set_spatial_filterr�tuple�list�len�
ValueError�mapr�set_spatial_filter_rectr2)r�filter�xmin�ymin�xmax�ymaxs      r!�_set_spatial_filterzLayer._set_spatial_filter�s����f�k�*�*�	j��#�D�H�f�j�9�9�9�9�9�
����
�
.�
.�
	j��v�;�;�!�#�#� �!R�S�S�S�&)��6�%:�%:�"�D�$��d��(���4��t�T�J�J�J�J�J�
�^��#�D�H�d�3�3�3�3�3��h�i�i�ir#c�V���|jvrtd�z����fd�|D��S)zg
        Return a list containing the given field name for every Feature
        in the Layer.
        zinvalid field name: %sc�:��g|]}|������Sr&)�get)r(rF�
field_names  �r!r*z$Layer.get_fields.<locals>.<listcomp>�s%���6�6�6������$�$�6�6�6r#)rdr)rr�s `r!�
get_fieldszLayer.get_fields�s@���
�T�[�(�(�� 8�:� E�F�F�F�6�6�6�6��6�6�6�6r#Fc�H��|rddlm��fd�|D��Sd�|D��S)zb
        Return a list containing the OGRGeometry for every Feature in
        the Layer.
        r)�GEOSGeometryc�:��g|]}�|jj����Sr&)r�wkb)r(rFr�s  �r!r*z#Layer.get_geoms.<locals>.<listcomp>�s'���A�A�A�D�L�L����/�/�A�A�Ar#c��g|]	}|j��
Sr&)r)r(rFs  r!r*z#Layer.get_geoms.<locals>.<listcomp>�s��/�/�/�$�D�I�/�/�/r#)�django.contrib.gis.geosr�)r�geosr�s  @r!�	get_geomszLayer.get_geoms�sM���
�	0�<�<�<�<�<�<�A�A�A�A�D�A�A�A�A�/�/�$�/�/�/�/r#c�j�ttj|jt	|������S)ah
        Return a bool indicating whether the this Layer supports the given
        capability (a string).  Valid capability strings include:
          'RandomRead', 'SequentialWrite', 'RandomWrite', 'FastSpatialFilter',
          'FastFeatureCount', 'FastGetExtent', 'CreateField', 'Transactions',
          'DeleteFeature', and 'FastSetNextByIndex'.
        )�boolrrrr)r�
capabilitys  r!rzLayer.test_capability�s)���D�(���;�z�3J�3J�K�K�L�L�Lr#N)rH)F)�__name__�
__module__�__qualname__�__doc__r"r7r<r?rBr'�propertyrKrAr0rVrYrrdrhrlrqrvr��spatial_filterr�r�rr&r#r!rrs������Y�Y�
@�
@�
@�^�^�^� B�B�B�������>�>�>�.����X���E�E��X�E�
�7�7�7��X�7��1�1��X�1��?�?��X�?�����X���+�+��X�+��1�1��X�1��1�1��X�1�
�1�1��X�1�
���
j�
j�
j��X�1�3F�G�G�N�7�7�7�	0�	0�	0�	0�M�M�M�M�Mr#rN) �ctypesrr�django.contrib.gis.gdal.baser� django.contrib.gis.gdal.enveloperr�django.contrib.gis.gdal.errorrr	�django.contrib.gis.gdal.featurer
�django.contrib.gis.gdal.fieldr�"django.contrib.gis.gdal.geometriesr� django.contrib.gis.gdal.geomtyper
�"django.contrib.gis.gdal.prototypesrrrrsrr\�django.contrib.gis.gdal.srsr�django.utils.encodingrrrr&r#r!�<module>r�sM��"�"�"�"�"�"�"�"�1�1�1�1�1�1�B�B�B�B�B�B�B�B�E�E�E�E�E�E�E�E�3�3�3�3�3�3�7�7�7�7�7�7�:�:�:�:�:�:�8�8�8�8�8�8�����������9�8�8�8�8�8�8�8�8�8�8�8�8�8�BM�BM�BM�BM�BM�H�BM�BM�BM�BM�BMr#

Youez - 2016 - github.com/yon3zu
LinuXploit