https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/django/contrib/gis/gdal/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/django/contrib/gis/gdal/layer.pyc
�
r�\c@sddlmZmZddlmZddlmZmZddlm	Z	m
Z
mZddlm
Z
ddlmZddlmZddlmZdd	lmZdd
lmZmZmZddlmZmZddl m!Z!dd
l"m#Z#defd��YZ$dS(i����(tc_doubletbyref(tGDALBase(tEnvelopetOGREnvelope(tOGRExceptiont
OGRIndexErrortSRSException(tFeature(t
OGRFieldTypes(tOGRGeomType(tOGRGeometry(tSpatialReference(tdstgeomtsrs(tforce_bytest
force_text(tsix(txrangetLayercBseZdZd�Zd�Zd�Zd�Zd�Zd�Ze	d��Z
e	d��Ze	d	d
��Ze	d��Z
e	d��Ze	d
��Ze	d��Ze	d��Ze	d��Ze	d��Zd�Zd�Ze	ee�Zd�Zed�Zd�ZRS(sSA class that wraps an OGR Layer, needs to be instantiated from a DataSource object.cCsR|std��n||_||_tj|j�|_|jd�|_dS(s8
        Initializes 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.
        s*Cannot create Layer, invalid pointer givent
RandomReadN(	Rtptrt_dstcapitget_layer_defnt_ptrt_ldefnttest_capabilityt_random_read(tselft	layer_ptrR
((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pyt__init__s		cCs�t|tj�r:|dkr-td��n|j|�St|t�r�|j|j�\}}}gt|||�D]}|j|�^qwSt	d��dS(s(Gets the Feature at the specified index.is/Negative indices are not allowed on OGR Layers.s>Integers and slices may only be used when indexing OGR Layers.N(
t
isinstanceRt
integer_typesRt
_make_featuretslicetindicestnum_featRt	TypeError(Rtindextstarttstoptstridetfid((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pyt__getitem__,s
,ccsHtj|j�x1t|j�D] }ttj|j�|�Vq WdS(s(Iterates over each Feature in the Layer.N(Rt
reset_readingRRR&Rtget_next_feature(Rti((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pyt__iter__;scCs|jS(s%The length is the number of features.(R&(R((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pyt__len__BscCs|jS(sThe string name of the layer.(tname(R((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pyt__str__FscCsx|jr@y ttj|j|�|�SWqdtk
r<qdXn$x!|D]}|j|krG|SqGWtd|��dS(s.
        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.
        sInvalid feature id: %s.N(RRRtget_featureRRR,R(Rtfeat_idtfeat((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pyR#Js	 

cCs/t�}tj|jt|�d�t|�S(s/Returns the extent (an Envelope) of this layer.i(RRt
get_extentRRR(Rtenv((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pytextent`s	cCs+tj|j�}t||jjdt�S(s2Returns the name of this layer in the Data Source.tstrings_only(Rtget_fd_nameRRRtencodingtTrue(RR3((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pyR3gsicCstj|j|�S(s,Returns the number of features in the Layer.(Rtget_feature_countR(Rtforce((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pyR&mscCstj|j�S(s*Returns the number of fields in the Layer.(Rtget_field_countR(R((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pyt
num_fieldsrscCsttj|j��S(s5Returns the geometry type (OGRGeomType) of the Layer.(R
Rtget_fd_geom_typeR(R((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pyt	geom_typewscCsBy)tj|j�}ttj|��SWntk
r=dSXdS(s1Returns the Spatial Reference used in this Layer.N(Rt
get_layer_srsRRtsrs_apit	clone_srsRtNone(RR((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pyR|s

cCsMgt|j�D]9}ttjtj|j|��|jjdt	�^qS(su
        Returns a list of string names corresponding to each of the Fields
        available in this Layer.
        R;(
RRBRRtget_field_nametget_field_defnRRR=R>(RR0((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pytfields�scCs<gt|j�D](}ttjtj|j|��^qS(s�
        Returns a list of the types of fields in this Layer.  For example,
        the list [OFTInteger, OFTReal, OFTString] would be returned for
        an OGR layer that had an integer, a floating-point, and string
        fields.
        (RRBR	Rtget_field_typeRJR(RR0((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pytfield_types�scCs8gt|j�D]$}tjtj|j|��^qS(s<Returns a list of the maximum field widths for the features.(RRBRtget_field_widthRJR(RR0((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pytfield_widths�scCs8gt|j�D]$}tjtj|j|��^qS(s.Returns the field precisions for the features.(RRBRtget_field_precisionRJR(RR0((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pytfield_precisions�scCs<y#ttjtj|j���SWntk
r7dSXdS(N(Rtgeom_apit
clone_geomRtget_spatial_filterRRRH(R((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pyt_get_spatial_filter�s#
cCs�t|t�r(tj|j|j�n�t|ttf�r�t|�dks^td��nt	t
|�\}}}}tj|j||||�n.|dkr�tj|jd�nt
d��dS(Nis/Spatial filter list/tuple must have 4 elements.sJSpatial filter must be either an OGRGeometry instance, a 4-tuple, or None.(R!RRtset_spatial_filterRttupletlisttlent
ValueErrortmapRtset_spatial_filter_rectRHR'(Rtfiltertxmintymintxmaxtymax((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pyt_set_spatial_filter�scCsB||jkr"td|��ng|D]}|j|�^q)S(sh
        Returns a list containing the given field name for every Feature
        in the Layer.
        sinvalid field name: %s(RKRtget(Rt
field_nameR7((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pyt
get_fields�scCsW|r9ddlm}g|D]}||jj�^qSg|D]}|j^q@SdS(sc
        Returns a list containing the OGRGeometry for every Feature in
        the Layer.
        i����(tGEOSGeometryN(tdjango.contrib.gis.geosRfRtwkb(RtgeosRfR7((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pyt	get_geoms�s#cCsttj|jt|���S(si
        Returns 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'.
        (tboolRRRR(Rt
capability((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pyR�s(t__name__t
__module__t__doc__R R-R1R2R4R#tpropertyR:R3R&RBRDRRKRMRORQRURbtspatial_filterRetFalseRjR(((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pyRs0							
				N(%tctypesRRtdjango.contrib.gis.gdal.baseRt django.contrib.gis.gdal.envelopeRRtdjango.contrib.gis.gdal.errorRRRtdjango.contrib.gis.gdal.featureRtdjango.contrib.gis.gdal.fieldR	t django.contrib.gis.gdal.geomtypeR
t"django.contrib.gis.gdal.geometriesRtdjango.contrib.gis.gdal.srsRt"django.contrib.gis.gdal.prototypesR
RRRRRRFtdjango.utils.encodingRRtdjango.utilsRtdjango.utils.six.movesRR(((s?/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/layer.pyt<module>s

https://t.me/AnonymousX5 - 2025