ó
i4Vdc           @   sZ   d  d l  m Z d  d l m Z d  d l m Z d  d l m Z d e f d „  ƒ  YZ	 d S(   i   (   t   GEOSBase(   t   GEOSException(   t   geos_version_info(   t   preparedt   PreparedGeometryc           B   sz   e  Z d  Z e j Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z d „  Z d	 „  Z d
 „  Z d „  Z RS(   sœ   
    A geometry that is prepared for performing certain operations.
    At the moment this includes the contains covers, and intersects
    operations.
    c         C   sJ   | |  _  d d l m } t | | ƒ s1 t ‚ n  t j | j ƒ |  _ d  S(   Ni   (   t   GEOSGeometry(   t
   _base_geomt   geometryR   t
   isinstancet	   TypeErrort   capit   geos_preparet   ptr(   t   selft   geomR   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/contrib/gis/geos/prepared.pyt   __init__   s
    		c         C   s&   |  j  r" t r" t j |  j  ƒ n  d  S(   N(   t   _ptrR
   t   prepared_destroy(   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/contrib/gis/geos/prepared.pyt   __del__   s    c         C   s   t  j |  j | j ƒ S(   N(   R
   t   prepared_containsR   (   R   t   other(    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/contrib/gis/geos/prepared.pyt   contains   s    c         C   s   t  j |  j | j ƒ S(   N(   R
   t   prepared_contains_properlyR   (   R   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/contrib/gis/geos/prepared.pyt   contains_properly    s    c         C   s   t  j |  j | j ƒ S(   N(   R
   t   prepared_coversR   (   R   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/contrib/gis/geos/prepared.pyt   covers#   s    c         C   s   t  j |  j | j ƒ S(   N(   R
   t   prepared_intersectsR   (   R   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/contrib/gis/geos/prepared.pyt
   intersects&   s    c         C   s8   t  ƒ  d d k  r" t d ƒ ‚ n  t j |  j | j ƒ S(   Nt   versions   3.3.0s5   crosses on prepared geometries requires GEOS >= 3.3.0(   R   R   R
   t   prepared_crossesR   (   R   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/contrib/gis/geos/prepared.pyt   crosses+   s    c         C   s8   t  ƒ  d d k  r" t d ƒ ‚ n  t j |  j | j ƒ S(   NR   s   3.3.0s6   disjoint on prepared geometries requires GEOS >= 3.3.0(   R   R   R
   t   prepared_disjointR   (   R   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/contrib/gis/geos/prepared.pyt   disjoint0   s    c         C   s8   t  ƒ  d d k  r" t d ƒ ‚ n  t j |  j | j ƒ S(   NR   s   3.3.0s6   overlaps on prepared geometries requires GEOS >= 3.3.0(   R   R   R
   t   prepared_overlapsR   (   R   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/contrib/gis/geos/prepared.pyt   overlaps5   s    c         C   s8   t  ƒ  d d k  r" t d ƒ ‚ n  t j |  j | j ƒ S(   NR   s   3.3.0s5   touches on prepared geometries requires GEOS >= 3.3.0(   R   R   R
   t   prepared_touchesR   (   R   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/contrib/gis/geos/prepared.pyt   touches:   s    c         C   s8   t  ƒ  d d k  r" t d ƒ ‚ n  t j |  j | j ƒ S(   NR   s   3.3.0s4   within on prepared geometries requires GEOS >= 3.3.0(   R   R   R
   t   prepared_withinR   (   R   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/contrib/gis/geos/prepared.pyt   within?   s    (   t   __name__t
   __module__t   __doc__R
   t   PREPGEOM_PTRt   ptr_typeR   R   R   R   R   R   R   R    R"   R$   R&   (    (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/contrib/gis/geos/prepared.pyR      s   		
									N(
   t   baseR    t   errorR   t   libgeosR   t
   prototypesR   R
   R   (    (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/contrib/gis/geos/prepared.pyt   <module>   s   