+
    Tjt"                         ^ RI HtHt ^ RIHt ^ RIHtHt ^ RIH	t	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 ^ RIHt ^ RIHt ^ RIHtHt  ! R R]4      tR# )    )byrefc_double)GDALBase)EnvelopeOGREnvelope)GDALExceptionSRSException)Feature)OGRFieldTypes)OGRGeometry)OGRGeomType)ds)geom)srs)SpatialReference)force_bytes	force_strc                      a  ] tR t^t o RtR tR tR tR tR t	R t
]R 4       t]R	 4       t]RR
 l4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       tR tR t]! ]]4      tR tRR ltR tRtV tR# )LayerzU
A class that wraps an OGR Layer, needs to be instantiated from a DataSource
object.
c                    V'       g   \        R4      hWn        W n        \        P                  ! V P
                  4      V n        V P                  R4      V n        R# )a  
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_ptrr   s   &&&R/var/www/idalgo/venv/lib/python3.14/site-packages/django/contrib/gis/gdal/layer.py__init__Layer.__init__   sF      LMM))$))4 00?    c                P   \        V\        4      '       d$   V^ 8  d   \        R4      hV P                  V4      # \        V\        4      '       dI   VP                  V P                  4      w  r#p\        W#V4       Uu. uF  qPP                  V4      NK  	  up# \        R4      hu upi )z'Get the Feature at the specified index.z/Negative indices are not allowed on OGR Layers.z>Integers and slices may only be used when indexing OGR Layers.)	
isinstanceint
IndexError_make_featuresliceindicesnum_featrange	TypeError)r   indexstartstopstridefids   &&    r!   __getitem__Layer.__getitem__*   s    eS!! qy !RSS%%e,,u%%"'--">E7<U&7QR7Q&&s+7QRRP  Ss   <B#c              #     "   \         P                  ! V P                  4       \        V P                  4       F/  p\        \         P                  ! V P                  4      V 4      x  K1  	  R# 5i)z'Iterate over each Feature in the Layer.N)r   reset_readingr   r-   r,   r
   get_next_featurer   is   & r!   __iter__Layer.__iter__<   sH      	499%t}}%A$//		:DAA &s   A+A-c                    V P                   # )z%The length is the number of features.)r,   r   s   &r!   __len__Layer.__len__C   s    }}r$   c                    V P                   # )zThe string name of the layer.)namer>   s   &r!   __str__Layer.__str__G   s    yyr$   c                    V P                   '       d-    \        \        P                  ! V P                  V4      V 4      # V  F  pVP                  V8X  g   K  Vu # 	  \        RV,          4      h  \
         d     Li ; i)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.
zInvalid feature id: %s.)r   r
   r   get_featurer   r   r3   r(   )r   feat_idfeats   && r!   r)   Layer._make_featureK   sw     t//'BDII 88w&K  2W<== ! s   *A/ /A=<A=c                    \        4       p\        P                  ! V P                  \	        V4      ^4       \        V4      # )z.Return the extent (an Envelope) of this layer.)r   r   
get_extentr   r   r   )r   envs   & r!   extentLayer.extentb   s-     m%*a0}r$   c                    \         P                  ! V P                  4      p\        WP                  P
                  RR7      # )z1Return the name of this layer in the Data Source.Tstrings_only)r   get_fd_namer   r   r   encoding)r   rB   s   & r!   rB   
Layer.namei   s/     ,xx00tDDr$   c                D    \         P                  ! V P                  V4      # )z+Return the number of features in the Layer.)r   get_feature_countr   )r   forces   &&r!   r,   Layer.num_feato   s     %%dhh66r$   c                B    \         P                  ! V P                  4      # )z)Return the number of fields in the Layer.)r   get_field_countr   r>   s   &r!   
num_fieldsLayer.num_fieldst   s     ##DKK00r$   c                T    \        \        P                  ! V P                  4      4      # )z4Return the geometry type (OGRGeomType) of the Layer.)r   r   get_fd_geom_typer   r>   s   &r!   	geom_typeLayer.geom_typey   s     400=>>r$   c                     \         P                  ! V P                  4      p\        \        P
                  ! V4      4      #   \         d     R# i ; i)z0Return the Spatial Reference used in this Layer.N)r   get_layer_srsr   r   srs_api	clone_srsr	   )r   r   s   & r!   r   	Layer.srs~   sC    	$$TXX.C#G$5$5c$:;; 		s   >A AAc                    \        V P                  4       Uu. uFX  p\        \        P                  ! \        P
                  ! V P                  V4      4      V P                  P                  RR7      NKZ  	  up# u upi )z\
Return a list of string names corresponding to each of the Fields
available in this Layer.
TrP   )	r-   r[   r   r   get_field_nameget_field_defnr   r   rS   r9   s   & r!   fieldsLayer.fields   sj     4??+
 , ##D$7$7Q$GH!!!
 ,
 	
 
s   AA9c           
         \        V P                  4       Uu. uFC  p\        \        P                  ! \        P
                  ! V P                  V4      4      ,          NKE  	  up# u upi )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.
)r-   r[   r   r   get_field_typerh   r   r9   s   & r!   field_typesLayer.field_types   sV     4??+
+ $--d.A.A$++q.QRSS+
 	
 
s   A	A$c           	         \        V P                  4       Uu. uF8  p\        P                  ! \        P                  ! V P
                  V4      4      NK:  	  up# u upi )z;Return a list of the maximum field widths for the features.)r-   r[   r   get_field_widthrh   r   r9   s   & r!   field_widthsLayer.field_widths   sN    
 4??+
+   !4!4T[[!!DE+
 	
 
   >Ac           	         \        V P                  4       Uu. uF8  p\        P                  ! \        P                  ! V P
                  V4      4      NK:  	  up# u upi )z-Return the field precisions for the features.)r-   r[   r   get_field_precisionrh   r   r9   s   & r!   field_precisionsLayer.field_precisions   sN    
 4??+
+ $$T%8%8a%HI+
 	
 
rs   c                     \        \        P                  ! \        P                  ! V P
                  4      4      4      #   \         d     R # i ; i)N)r   geom_api
clone_geomr   get_spatial_filterr   r   r>   s   &r!   _get_spatial_filterLayer._get_spatial_filter   s>    	x2243J3J4883TUVV 		s   <? AAc                   \        V\        4      '       d.   \        P                  ! V P                  VP                  4       R# \        V\
        \        34      '       dS   \        V4      ^8X  g   \        R4      h\        \        V4      w  r#rE\        P                  ! V P                  W#WE4       R# Vf$   \        P                  ! V P                  R4       R# \        R4      h)   z/Spatial filter list/tuple must have 4 elements.NzJSpatial 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_rectr.   )r   filterxminyminxmaxymaxs   &&    r!   _set_spatial_filterLayer._set_spatial_filter   s    fk**##DHHfjj9..v;!# !RSS &)6%:"D((4tJ^##DHHd3 r$   c                    WP                   9  d   \        RV,          4      hV  Uu. uF  q"P                  V4      NK  	  up# u upi )zO
Return a list containing the given field name for every Feature
in the Layer.
zinvalid field name: %s)ri   r   get)r   
field_namerH   s   && r!   
get_fieldsLayer.get_fields   s>    
 [[( 8: EFF156$666s   Ac                    V'       d2   ^ RI Hp V  Uu. uF  q2! VP                  P                  4      NK   	  up# V  Uu. uF  q3P                  NK  	  up# u upi u upi )zJ
Return a list containing the OGRGeometry for every Feature in
the Layer.
)GEOSGeometry)django.contrib.gis.geosr   r   wkb)r   geosr   rH   s   &&  r!   	get_geomsLayer.get_geoms   sL    
 <<@ADDL/DAA*./$$II$// B/s
   $AAc                h    \        \        P                  ! V P                  \	        V4      4      4      # )a7  
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'.
)boolr   r   r   r   )r   
capabilitys   &&r!   r   Layer.test_capability   s%     D((;z3JKLLr$   )r   r   r   r   N)   )F)__name__
__module____qualname____firstlineno____doc__r"   r4   r;   r?   rC   r)   propertyrM   rB   r,   r[   r_   r   ri   rm   rq   rv   r|   r   spatial_filterr   r   r   __static_attributes____classdictcell__)__classdict__s   @r!   r   r      s$    
@$B>.   E E
 7 7 1 1 ? ?   
 
 	
 	
 
 
 
 
$ 13FGN7
0M Mr$   r   N) ctypesr   r   django.contrib.gis.gdal.baser    django.contrib.gis.gdal.enveloper   r   django.contrib.gis.gdal.errorr   r	   django.contrib.gis.gdal.featurer
   django.contrib.gis.gdal.fieldr   "django.contrib.gis.gdal.geometriesr    django.contrib.gis.gdal.geomtyper   "django.contrib.gis.gdal.prototypesr   r   r   ry   r   rc   django.contrib.gis.gdal.srsr   django.utils.encodingr   r   r    r$   r!   <module>r      s<    " 1 B E 3 7 : 8 9 ? = 8 8UMH UMr$   