+
    Tj                     x    R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHtHt  ! R R	]4      tR
# )at  
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, an SHP file.

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
)Path)GDALBase)Driver)GDALException)Layer)ds)force_bytes	force_strc                   x   a  ] tR t^2t o Rt]P                  tR
R ltR t	R t
R t]R 4       t]R 4       tRtV tR	# )
DataSourcez Wraps an OGR Data Source object.c                   V'       d   \         P                  M\         P                  V n        W@n        \
        P                  ! 4        \        V\        \        34      '       dE    \         P                  ! \        V4      V P                  \         P                  ,          R R R 4      pMY\        WP                  4      '       d$   \        V\
        P                  4      '       d   TpM\        R\        V4      ,          4      hV'       d/   WPn        \         P"                  ! V4      p\        V4      V n        R # \        RV,          4      h  \         d    \        RT,          4      hi ; i)Nz%Could not open the datasource at "%s"z"Invalid data source input type: %szInvalid data source file "%s")capiGDAL_OF_UPDATEGDAL_OF_READONLY_writeencodingr   ensure_registered
isinstancestrr   open_dsr   GDAL_OF_VECTORr   ptr_typetypeptrget_dataset_driverdriver)selfds_input	ds_driverwriter   r   r   s   &&&&&  W/var/www/idalgo/venv/lib/python3.14/site-packages/django/contrib/gis/gdal/datasource.py__init__DataSource.__init__7   s   -2d))8M8M   "hd,,X\\)KK$"5"55 --00Zv6
 6
 B DtH~ UVVH,,R0F .DK   ?( JKK# ! X $$Kh$VWWXs   &AE
 
E(c                   \        V\        4      '       d-    \        P                  ! V P                  \        V4      4      pM\        V\        4      '       dQ   ^ Tu;8:  d   V P                  8  d&   M M"\        P                  ! V P                  V4      pM-\        RV,          4      h\        R\        V4      ,          4      h\        W 4      #   \         d    \        RT,          4      hi ; i)z@Allows use of the index [] operator to get a layer at the index.z!Invalid OGR layer name given: %s.z=Index out of range when accessing layers in a datasource: %s.zInvalid index type: %s)r   r   r   get_layer_by_namer   r   r   
IndexErrorintlayer_count	get_layer_ptr	TypeErrorr   r   )r   indexlayers   && r    __getitem__DataSource.__getitem__\   s    eS!!N..txxU9KL s##E,D,,,tyy%8 S 
 4tE{BCCU!! ! N !Du!LMMNs   *C C-c                    V P                   # )z3Return the number of layers within the data source.)r'   r   s   &r    __len__DataSource.__len__o   s        c                >    V P                   : RV P                  : R2# )z2Return OGR GetName and Driver for the Data Source.z ())namer   r0   s   &r    __str__DataSource.__str__s   s     IIt{{33r3   c                B    \         P                  ! V P                  4      # )z/Return the number of layers in the data source.)r   get_layer_countr)   r0   s   &r    r'   DataSource.layer_countw   s     ##DII..r3   c                p    \         P                  ! V P                  4      p\        WP                  RR7      # )z#Return the name of the data source.T)strings_only)r   get_ds_namer)   r	   r   )r   r6   s   & r    r6   DataSource.name|   s)     		*}}4@@r3   )r   r   r   r   N)FFzutf-8)__name__
__module____qualname____firstlineno____doc__r   
destroy_ds
destructorr!   r-   r1   r7   propertyr'   r6   __static_attributes____classdictcell__)__classdict__s   @r    r   r   2   sQ     &J#LJ"& 4 / / A Ar3   r   N)rD   pathlibr   django.contrib.gis.gdal.baser   django.contrib.gis.gdal.driverr   django.contrib.gis.gdal.errorr   django.contrib.gis.gdal.layerr   "django.contrib.gis.gdal.prototypesr   r   django.utils.encodingr   r	   r    r3   r    <module>rS      s2   !F  1 1 7 / 9 8NA NAr3   