U
    ¡‹®g'  ã                   @   s,   d dl mZ d dlmZ G dd„ deƒZdS )é   )ÚGEOSBase)Úpreparedc                   @   sl   e Zd ZdZejZejZdd„ Z	dd„ Z
dd„ Zdd	„ Zd
d„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )ÚPreparedGeometryzœ
    A geometry that is prepared for performing certain operations.
    At the moment this includes the contains covers, and intersects
    operations.
    c                 C   s2   || _ ddlm} t||ƒs t‚t |j¡| _d S )Nr   )ÚGEOSGeometry)Z
_base_geomZgeometryr   Ú
isinstanceÚ	TypeErrorÚcapiZgeos_prepareÚptr)ÚselfZgeomr   © r   úD/tmp/pip-unpacked-wheel-ye1bytdm/django/contrib/gis/geos/prepared.pyÚ__init__   s
    
zPreparedGeometry.__init__c                 C   s   t  | j|j¡S ©N)r   Zprepared_containsr	   ©r
   Úotherr   r   r   Úcontains   s    zPreparedGeometry.containsc                 C   s   t  | j|j¡S r   )r   Zprepared_contains_properlyr	   r   r   r   r   Úcontains_properly   s    z"PreparedGeometry.contains_properlyc                 C   s   t  | j|j¡S r   )r   Zprepared_coversr	   r   r   r   r   Úcovers   s    zPreparedGeometry.coversc                 C   s   t  | j|j¡S r   )r   Zprepared_intersectsr	   r   r   r   r   Ú
intersects!   s    zPreparedGeometry.intersectsc                 C   s   t  | j|j¡S r   )r   Zprepared_crossesr	   r   r   r   r   Úcrosses$   s    zPreparedGeometry.crossesc                 C   s   t  | j|j¡S r   )r   Zprepared_disjointr	   r   r   r   r   Údisjoint'   s    zPreparedGeometry.disjointc                 C   s   t  | j|j¡S r   )r   Zprepared_overlapsr	   r   r   r   r   Úoverlaps*   s    zPreparedGeometry.overlapsc                 C   s   t  | j|j¡S r   )r   Zprepared_touchesr	   r   r   r   r   Útouches-   s    zPreparedGeometry.touchesc                 C   s   t  | j|j¡S r   )r   Zprepared_withinr	   r   r   r   r   Úwithin0   s    zPreparedGeometry.withinN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ZPREPGEOM_PTRZptr_typeZprepared_destroyZ
destructorr   r   r   r   r   r   r   r   r   r   r   r   r   r   r      s   
r   N)Úbaser   Z
prototypesr   r   r   r   r   r   r   Ú<module>   s   