File: //lib/python3/dist-packages/django/contrib/gis/gdal/__pycache__/driver.cpython-310.pyc
o
�a� � @ sX d dl mZ d dlmZ d dlmZ d dlmZm Z
d dlmZm
Z
G dd� de�ZdS ) � )�c_void_p)�GDALBase)�
GDALException)�ds�raster)�force_bytes� force_strc
@ s\ e Zd ZdZdddddddddd� Zdd� Zd d
� Zedd� �Zed
d� �Z e
dd� �ZdS )�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
zESRI Shapefile�TIGER�GTiff�JPEG) �esri�shp�shape�tigerz
tiger/line�tiff�tif�jpeg�jpgc C s� t |t�r/| �� |�� | jv r| j|�� }n|}ttfD ]}t|�t |���}|r- nqn*t |t
�rI| �� ttfD ]}|�|�}|rG nq<nt |t�rQ|}ntdt
|� ��|satd| ��|| _dS )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&