ó
®â0_c           @   s   d  e  f d „  ƒ  YZ d S(   t   BaseSpatialOperationsc           B   sÇ  e  Z d  Z i  Z e Z e Z e Z e Z d) Z
 d) Z e Z e Z e Z e Z e Z e Z e Z e Z e Z e Z e Z e Z e Z e Z e Z e Z e Z e Z e Z e Z e Z  e Z! e Z" e Z# e Z$ d* Z% d Z& i  Z' d d d d d d d d	 d
 d d d d d d d d d d d d d d d d d d d h Z( e Z) e Z* e Z+ e Z, e Z- e Z. e Z/ d „  Z0 d „  Z1 d  „  Z2 d! „  Z3 d" „  Z4 d# „  Z5 d$ „  Z6 d% „  Z7 d& „  Z8 d' „  Z9 d( „  Z: RS(+   sš   
    This module holds the base `BaseSpatialBackend` object, which is
    instantiated by each spatial database backend with the features
    it has.
    t    t   Areat	   AsGeoJSONt   AsGMLt   AsKMLt   AsSVGt   BoundingCirclet   Centroidt
   Differencet   Distancet   Envelopet   ForceRHRt   GeoHasht   Intersectiont   IsValidt   Lengtht	   MakeValidt   MemSizet   NumGeometriest	   NumPointst	   Perimetert   PointOnSurfacet   Reverset   Scalet
   SnapToGridt   SymDifferencet	   Transformt	   Translatet   Unionc         C   s   t  d ƒ ‚ d  S(   Ns:   Aggregate extent not implemented for this spatial backend.(   t   NotImplementedError(   t   selft   boxt   srid(    (    sP   /tmp/pip-unpacked-wheel-BAJOf3/django/contrib/gis/db/backends/base/operations.pyt   convert_extentP   s    c         C   s   t  d ƒ ‚ d  S(   Ns=   Aggregate 3D extent not implemented for this spatial backend.(   R   (   R   R    R!   (    (    sP   /tmp/pip-unpacked-wheel-BAJOf3/django/contrib/gis/db/backends/base/operations.pyt   convert_extent3dS   s    c         C   s   d | S(   Ns   '%s'(    (   R   t   name(    (    sP   /tmp/pip-unpacked-wheel-BAJOf3/django/contrib/gis/db/backends/base/operations.pyt   geo_quote_nameW   s    c         C   s   t  d ƒ ‚ d S(   si   
        Returns the database column type for the geometry field on
        the spatial backend.
        sG   subclasses of BaseSpatialOperations must provide a geo_db_type() methodN(   R   (   R   t   f(    (    sP   /tmp/pip-unpacked-wheel-BAJOf3/django/contrib/gis/db/backends/base/operations.pyt   geo_db_type[   s    c         C   s   t  d ƒ ‚ d S(   sv   
        Returns the distance parameters for the given geometry field,
        lookup value, and lookup type.
        s:   Distance operations not available on this spatial backend.N(   R   (   R   R&   t   valuet   lookup_type(    (    sP   /tmp/pip-unpacked-wheel-BAJOf3/django/contrib/gis/db/backends/base/operations.pyt   get_distanceb   s    c         C   s   t  d ƒ ‚ d S(   s  
        Returns the placeholder for the given geometry field with the given
        value.  Depending on the spatial backend, the placeholder may contain a
        stored procedure call to the transformation function of the spatial
        backend.
        sN   subclasses of BaseSpatialOperations must provide a geo_db_placeholder() methodN(   R   (   R   R&   R(   t   compiler(    (    sP   /tmp/pip-unpacked-wheel-BAJOf3/django/contrib/gis/db/backends/base/operations.pyt   get_geom_placeholderi   s    c         C   sB   t  | |  j ƒ r( t d | j ƒ ‚ n  t t |  ƒ j | ƒ d  S(   NsA   %s spatial aggregation is not supported by this database backend.(   t
   isinstancet   disallowed_aggregatesR   R$   t   superR    t   check_expression_support(   R   t
   expression(    (    sP   /tmp/pip-unpacked-wheel-BAJOf3/django/contrib/gis/db/backends/base/operations.pyR0   r   s    c         C   s   t  d ƒ ‚ d  S(   Ns;   Aggregate support not implemented for this spatial backend.(   R   (   R   t   agg_name(    (    sP   /tmp/pip-unpacked-wheel-BAJOf3/django/contrib/gis/db/backends/base/operations.pyt   spatial_aggregate_namey   s    c         C   s<   | |  j  k r" t d | ƒ ‚ n  |  j j | |  j | ƒ S(   Ns-   This backend doesn't support the %s function.(   t   unsupported_functionsR   t   function_namest   gett   geom_func_prefix(   R   t	   func_name(    (    sP   /tmp/pip-unpacked-wheel-BAJOf3/django/contrib/gis/db/backends/base/operations.pyt   spatial_function_name|   s    c         C   s   t  d ƒ ‚ d  S(   NsM   Subclasses of BaseSpatialOperations must provide a geometry_columns() method.(   R   (   R   (    (    sP   /tmp/pip-unpacked-wheel-BAJOf3/django/contrib/gis/db/backends/base/operations.pyt   geometry_columns‚   s    c         C   s   t  d ƒ ‚ d  S(   NsK   subclasses of BaseSpatialOperations must a provide spatial_ref_sys() method(   R   (   R   (    (    sP   /tmp/pip-unpacked-wheel-BAJOf3/django/contrib/gis/db/backends/base/operations.pyt   spatial_ref_sys…   s    N(    (;   t   __name__t
   __module__t   __doc__t   truncate_paramst   Falset   postgist
   spatialitet   mysqlt   oraclet   Nonet   spatial_versiont   selectt	   geographyt   geometryt   areat   bounding_circlet   centroidt
   differencet   distancet   distance_spheret   distance_spheroidt   envelopet	   force_rhrt   mem_sizet   num_geomt
   num_pointst	   perimetert   perimeter3dt   point_on_surfacet
   polygonizet   reverset   scalet   snap_to_gridt   sym_differencet	   transformt	   translatet   unionR.   R7   R5   R4   t   geohasht   geojsont   gmlt   kmlt   svgt	   from_textt   from_wkbR"   R#   R%   R'   R*   R,   R0   R3   R9   R:   R;   (    (    (    sP   /tmp/pip-unpacked-wheel-BAJOf3/django/contrib/gis/db/backends/base/operations.pyR       sx   											N(   t   objectR    (    (    (    sP   /tmp/pip-unpacked-wheel-BAJOf3/django/contrib/gis/db/backends/base/operations.pyt   <module>   R   