o
    ä›e  ã                   @   s`   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„ deƒZd	S )
é    )Úc_void_p)ÚGDALBase)ÚGDALException)Úds)Úraster)Úforce_bytesÚ	force_strc                
   @   s\   e Zd ZdZddddddddddœ	Zdd„ Zd	d
„ Zedd„ ƒZedd„ ƒZ	e
d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                 C   sÌ   t |tƒr/|  ¡  | ¡ | jv r| j| ¡  }n|}ttfD ]}t| t	|ƒ¡ƒ}|r- nqn*t |t
ƒrI|  ¡  ttfD ]}| |¡}|rG nq<nt |tƒrQ|}ntdt|ƒ ƒ‚|satd| ƒ‚|| _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Údriver© r&   úQ/var/www/html/venv/lib/python3.10/site-packages/django/contrib/gis/gdal/driver.pyÚ__init__$   s:   
ÿ€

ÿ€

ÿÿ
zDriver.__init__c                 C   s   | j S )N)r#   ©r!   r&   r&   r'   Ú__str__L   s   zDriver.__str__c                 C   s(   t  ¡ st  ¡  t ¡ st ¡  dS dS )zB
        Attempt to register all the data source drivers.
        N)r   Úget_driver_countÚregister_allr   ©Úclsr&   r&   r'   r   O   s
   ÿzDriver.ensure_registeredc                 C   s   t  ¡ t ¡  S )zO
        Return the number of GDAL/OGR data source drivers registered.
        )r   r+   r   r-   r&   r&   r'   Údriver_count[   ó   zDriver.driver_countc                 C   s   t t | j¡ƒS )zA
        Return description/name string for this driver.
        )r   r   Úget_driver_descriptionr    r)   r&   r&   r'   r#   b   r0   zDriver.nameN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r(   r*   Úclassmethodr   r/   Úpropertyr#   r&   r&   r&   r'   r	   
   s(    õ(

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&   r'   Ú<module>   s    