
    `f                     n    d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z
 d dlmZmZ  G d de          Zd	S )
    )c_void_p)GDALBase)GDALException)ds)raster)force_bytes	force_strc            
       x    e Zd ZdZdddddddddd	Zd Zd Zed	             Zed
             Z	e
d             ZdS )Driverz
    Wrap a GDAL/OGR Data Source Driver.
    For more information, see the C API documentation:
    https://gdal.org/api/vector_c_api.html
    https://gdal.org/api/raster_c_api.html
    zESRI ShapefileTIGERGTiffJPEG)	esrishpshapetigerz
tiger/linetifftifjpegjpgc                    t          |t                    r|                                  |                                | j        v r | j        |                                         }n|}t
          t          fD ]5}t          |                    t          |                              }|r n6nt          |t                    r?|                                  t
          t          fD ]}|                    |          }|r nn7t          |t                    r|}nt          dt          |          z            |st          d|z            || _        dS )zT
        Initialize an GDAL/OGR driver on either a string or integer input.
        z/Unrecognized input type for GDAL/OGR Driver: %sz1Could not initialize GDAL/OGR Driver on input: %sN)
isinstancestrensure_registeredlower_aliasvcapircapir   get_driver_by_namer   int
get_driverr   typeptr)selfdr_inputnameifacedrivers        P/var/www/html/env/lib/python3.11/site-packages/django/contrib/gis/gdal/driver.py__init__zDriver.__init__$   sp    h$$ 	""$$$ ~~4;..{8>>#3#34    !%":":;t;L;L"M"MNN E#&& 	""$$$  ))(33 E(++ 	FFADNNR  
  	ChN       c                     | j         S )N)r&   r$   s    r)   __str__zDriver.__str__L   s
    yr+   c                     t          j                    st          j                     t          j                    st          j                     dS dS )zB
        Attempt to register all the data source drivers.
        N)r   get_driver_countregister_allr   clss    r)   r   zDriver.ensure_registeredO   sT     %'' 	!   %'' 	!     	! 	!r+   c                 P    t          j                    t          j                    z   S )zO
        Return the number of GDAL/OGR data source drivers registered.
        )r   r0   r   r2   s    r)   driver_countzDriver.driver_count[   s!    
 %''%*@*B*BBBr+   c                 N    t          t          j        | j                            S )zA
        Return description/name string for this driver.
        )r	   r   get_driver_descriptionr#   r-   s    r)   r&   zDriver.nameb   s    
 5dh??@@@r+   N)__name__
__module____qualname____doc__r   r*   r.   classmethodr   r5   propertyr&    r+   r)   r   r   
   s          !! F& & &P   	! 	! [	! C C [C A A XA A Ar+   r   N)ctypesr   django.contrib.gis.gdal.baser   django.contrib.gis.gdal.errorr   "django.contrib.gis.gdal.prototypesr   r   r   r   django.utils.encodingr   r	   r   r>   r+   r)   <module>rD      s          1 1 1 1 1 1 7 7 7 7 7 7 : : : : : : > > > > > > 8 8 8 8 8 8 8 8]A ]A ]A ]A ]AX ]A ]A ]A ]A ]Ar+   