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/datasource.pyc
�
r�\c@s�dZddlmZddlmZddlmZddlmZm	Z	ddl
mZddlm
ZddlmZmZdd	lmZdd
lmZdefd��YZd
S(s�
 DataSource is a wrapper for the OGR Data Source object, which provides
 an interface for reading vector geometry data from many different file
 formats (including ESRI shapefiles).

 When instantiating a DataSource object, use the filename of a
 GDAL-supported data source.  For example, a SHP file or a
 TIGER/Line file from the government.

 The ds_driver keyword is used internally when a ctypes pointer
 is passed in directly.

 Example:
  ds = DataSource('/home/foo/bar.shp')
  for layer in ds:
      for feature in layer:
          # Getting the geometry for the feature.
          g = feature.geom

          # Getting the 'description' field for the feature.
          desc = feature['description']

          # We can also increment through all of the fields
          #  attached to this feature.
          for field in feature:
              # Get the name of the field (e.g. 'description')
              nm = field.name

              # Get the type (integer) of the field, e.g. 0 => OFTInteger
              t = field.type

              # Returns the value the field; OFTIntegers return ints,
              #  OFTReal returns floats, all else returns string.
              val = field.value
i����(tbyref(tGDALBase(tDriver(tOGRExceptiont
OGRIndexError(tLayer(tds(tforce_bytest
force_text(tsix(txranget
DataSourcecBskeZdZeedd�Zd�Zd�Zd�Zd�Zd�Z	e
d��Ze
d	��ZRS(
s Wraps an OGR Data Source object.sutf-8cCs(|rd|_n	d|_||_tj�s=tj�nt|tj�r�tj	�}y(tj
t|�|jt|��}Wq�t
k
r�t
d|��q�XnCt||j	�r�t|tj	�r�|}nt
dt|���t|�r||_t|�|_nt
d|��dS(Niis%Could not open the datasource at "%s"s"Invalid data source input type: %ssInvalid data source file "%s"(t_writetencodingtcapitget_driver_counttregister_allt
isinstanceR	tstring_typesRtptr_typetopen_dsRRRttypetbooltptrtdriver(tselftds_inputt	ds_drivertwriteR
R((sD/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/datasource.pyt__init__<s&		
(
$		cCs |jrtj|j�ndS(s#Destroys this DataStructure object.N(t_ptrRt
destroy_ds(R((sD/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/datasource.pyt__del__`s	ccs'x t|j�D]}||VqWdS(s6Allows for iteration over the layers in a data source.N(R
tlayer_count(Rti((sD/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/datasource.pyt__iter__dscCs�t|tj�rItj|jt|��}|s�td|��q�ngt|t�r�|dkss||j	kr�td��ntj
|j|�}ntdt
|���t||�S(s@Allows use of the index [] operator to get a layer at the index.s"invalid OGR Layer name given: "%s"isindex out of rangesInvalid index type: %s(RR	RRtget_layer_by_nameRRRtintR!t	get_layerRt	TypeErrorRR(Rtindextl((sD/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/datasource.pyt__getitem__iscCs|jS(s4Returns the number of layers within the data source.(R!(R((sD/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/datasource.pyt__len__vscCsd|jt|j�fS(s3Returns OGR GetName and Driver for the Data Source.s%s (%s)(tnametstrR(R((sD/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/datasource.pyt__str__zscCstj|j�S(s0Returns the number of layers in the data source.(Rtget_layer_countR(R((sD/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/datasource.pyR!~scCs(tj|j�}t||jdt�S(s$Returns the name of the data source.tstrings_only(Rtget_ds_nameRRR
tTrue(RR,((sD/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/datasource.pyR,�s(
t__name__t
__module__t__doc__tFalseRR R#R*R+R.tpropertyR!R,(((sD/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/datasource.pyR8s$			
		N(R5tctypesRtdjango.contrib.gis.gdal.baseRtdjango.contrib.gis.gdal.driverRtdjango.contrib.gis.gdal.errorRRtdjango.contrib.gis.gdal.layerRt"django.contrib.gis.gdal.prototypesRRtdjango.utils.encodingRRtdjango.utilsR	tdjango.utils.six.movesR
R(((sD/tmp/pip-install-XxeQeY/django/django/contrib/gis/gdal/datasource.pyt<module>#s

https://t.me/AnonymousX5 - 2025