3
(h                 @   s   d Z G dd deZeZG dd deZG dd deeZedfedfed	fed
fedfedfedfedfdZedfedfedfedfedfedfedfedfedfedfd
ZdZ	d ddZ
dS )!z
 This module houses the GDAL & SRS Exception objects, and the
 check_err() routine which checks the status code returned by
 GDAL/OGR methods.
c               @   s   e Zd ZdS )GDALExceptionN)__name__
__module____qualname__ r   r   A/tmp/pip-install-q3hcpn_q/Django/django/contrib/gis/gdal/error.pyr   	   s   r   c               @   s   e Zd ZdS )SRSExceptionN)r   r   r   r   r   r   r   r      s   r   c               @   s   e Zd ZdZdZdS )OGRIndexErrora  
    This exception is raised when an invalid index is encountered, and has
    the 'silent_variable_feature' attribute set to true.  This ensures that
    django's templates proceed to use the next lookup type gracefully when
    an Exception is raised.  Fixes ticket #4740.
    TN)r   r   r   __doc__Zsilent_variable_failurer   r   r   r   r      s   r   zNot enough data.zNot enough memory.zUnsupported geometry type.zUnsupported operation.zCorrupt data.zOGR failure.zUnsupported SRS.zInvalid handle.)                        Z
AppDefinedZOutOfMemoryFileIOZ
OpenFailedZ
IllegalArgZNotSupportedZAssertionFailedZNoWriteAccessZUserInterruptZ
ObjectNull)
r
   r   r   r   r   r   r   r   	   
       Fc             C   sF   |rt nt}| tkrdS | |kr6||  \}}||ntd|  dS )zQ
    Checks the given CPL/OGRERR, and raises an exception where appropriate.
    NzUnknown error code: "%s")CPLERR_DICTOGRERR_DICTERR_NONEr   )codeZcplZerr_dictemsgr   r   r   	check_err>   s    
r   N)F)r	   	Exceptionr   ZOGRExceptionr   KeyErrorr   r   r   r   r   r   r   r   r   <module>   s0   