î
ªÍ X  ã               @   s   Gd  d „  d e  ƒ Z d S)c                   s  e  Z d  Z d Z i  Z d Z d Z d Z d Z d Z	 d Z
 d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z  d Z! d Z" d Z# f  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' d Z( d Z) d Z* d Z+ d Z, d Z- d Z. d! d" „  Z/ d# d$ „  Z0 d% d& „  Z1 d' d( „  Z2 d) d* „  Z3 d+ d, „  Z4 d- d. „  Z5 ‡  f d/ d0 †  Z6 d1 d2 „  Z7 d3 d4 „  Z8 d5 d6 „  Z9 d7 d8 „  Z: ‡  S)9ÚBaseSpatialOperationszš
    This module holds the base `BaseSpatialBackend` object, which is
    instantiated by each spatial database backend with the features
    it has.
    FNÚ ZAreaZ	AsGeoJSONZAsGMLZAsKMLZAsSVGZBoundingCircleZCentroidZ
DifferenceZDistanceZEnvelopeZForceRHRZGeoHashZIntersectionZIsValidZLengthZ	MakeValidZMemSizeZNumGeometriesZ	NumPointsZ	PerimeterZPointOnSurfaceZReverseZScaleZ
SnapToGridZSymDifferenceZ	TransformZ	TranslateÚUnionc             C   s   t  d ƒ ‚ d  S)Nz:Aggregate extent not implemented for this spatial backend.)ÚNotImplementedError)ÚselfÚboxÚsrid© r   ú\/home/ubuntu/projects/ifolica/build/django/django/contrib/gis/db/backends/base/operations.pyÚconvert_extentP   s    z$BaseSpatialOperations.convert_extentc             C   s   t  d ƒ ‚ d  S)Nz=Aggregate 3D extent not implemented for this spatial backend.)r   )r   r   r   r   r   r	   Úconvert_extent3dS   s    z&BaseSpatialOperations.convert_extent3dc             C   s   t  d ƒ ‚ d  S)Nz:Aggregate method not implemented for this spatial backend.)r   )r   Zgeom_valZ
geom_fieldr   r   r	   Úconvert_geomV   s    z"BaseSpatialOperations.convert_geomc             C   s   d | S)Nz'%s'r   )r   Únamer   r   r	   Úgeo_quote_nameZ   s    z$BaseSpatialOperations.geo_quote_namec             C   s   t  d ƒ ‚ d S)zi
        Returns the database column type for the geometry field on
        the spatial backend.
        zGsubclasses of BaseSpatialOperations must provide a geo_db_type() methodN)r   )r   Úfr   r   r	   Úgeo_db_type^   s    z!BaseSpatialOperations.geo_db_typec             C   s   t  d ƒ ‚ d S)zv
        Returns the distance parameters for the given geometry field,
        lookup value, and lookup type.
        z:Distance operations not available on this spatial backend.N)r   )r   r   ÚvalueZlookup_typer   r   r	   Úget_distancee   s    z"BaseSpatialOperations.get_distancec             C   s   t  d ƒ ‚ d S)a  
        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.
        zNsubclasses of BaseSpatialOperations must provide a geo_db_placeholder() methodN)r   )r   r   r   Úcompilerr   r   r	   Úget_geom_placeholderl   s    z*BaseSpatialOperations.get_geom_placeholderc                sB   t  | |  j ƒ r( t d | j ƒ ‚ n  t t |  ƒ j | ƒ d  S)NzA%s spatial aggregation is not supported by this database backend.)Ú
isinstanceÚdisallowed_aggregatesr   r   Úsuperr   Úcheck_expression_support)r   Z
expression)Ú	__class__r   r	   r   u   s    z.BaseSpatialOperations.check_expression_supportc             C   s   t  d ƒ ‚ d  S)Nz;Aggregate support not implemented for this spatial backend.)r   )r   Zagg_namer   r   r	   Úspatial_aggregate_name|   s    z,BaseSpatialOperations.spatial_aggregate_namec             C   s<   | |  j  k r" t d | ƒ ‚ n  |  j j | |  j | ƒ S)Nz-This backend doesn't support the %s function.)Úunsupported_functionsr   Úfunction_namesÚgetÚgeom_func_prefix)r   Ú	func_namer   r   r	   Úspatial_function_name   s    z+BaseSpatialOperations.spatial_function_namec             C   s   t  d ƒ ‚ d  S)NzMSubclasses of BaseSpatialOperations must provide a geometry_columns() method.)r   )r   r   r   r	   Úgeometry_columns…   s    z&BaseSpatialOperations.geometry_columnsc             C   s   t  d ƒ ‚ d  S)NzKsubclasses of BaseSpatialOperations must a provide spatial_ref_sys() method)r   )r   r   r   r	   Úspatial_ref_sysˆ   s    z%BaseSpatialOperations.spatial_ref_sys);Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ztruncate_paramsZpostgisZ
spatialiteZmysqlZoracleZspatial_versionÚselectZ	geographyZgeometryÚareaZbounding_circleZcentroidÚ
differenceZdistanceZdistance_sphereZdistance_spheroidZenvelopeZ	force_rhrZmem_sizeZnum_geomZ
num_pointsZ	perimeterZperimeter3dZpoint_on_surfaceZ
polygonizeÚreverseZscaleZsnap_to_gridZsym_differenceZ	transformÚ	translateÚunionr   r   r   r   ZgeohashZgeojsonZgmlZkmlÚsvgZ	from_textZfrom_wkbr
   r   r   r   r   r   r   r   r   r    r!   r"   r   r   )r   r	   r      sz   	r   N)Úobjectr   r   r   r   r	   Ú<module>   s    