/usr/local/lib/python3.9/site-packages/django/contrib/gis/db/backends/base/__pycache__
a Ӱ�h� � @ sZ d dl mZ d dlmZ d dlmZ d dlmZ d dlm Z d dl mZ G dd� d�ZdS ) � )� GeometryField)�Distance)�Area)�NotSupportedError)�cached_propertyc s� e Zd ZdZdZdZdZdZdZdZ e dd� �ZdZdZ i Zh d�ZdZd d � Zdd� Zd d� Zdd� Zdd� Zdd� Z� fdd�Zdd� Zdd� Zdd� Zdd� Zee�Z� fdd �Zd!d"� Z d#d$� Z!d%d&� Z"� Z#S )'�BaseSpatialOperationsFN�%sc C s | j S �N)�select��self� r �X/usr/local/lib/python3.9/site-packages/django/contrib/gis/db/backends/base/operations.py� select_extent s z#BaseSpatialOperations.select_extentr � >! ZAsGMLZ SymDifferenceZCentroidZEnvelopeZLengthZIsEmptyZAzimuthZ AsGeoJSON� Transform�UnionZFromWKBZIsValidZPointOnSurfaceZLineLocatePointZMemSizer Z PerimeterZAsSVGZGeoHashZ DifferenceZ MakeValidZIntersectionZGeometryDistanceZAsKMLZReverseZ NumGeometriesZBoundingCircleZ SnapToGridr Z TranslateZ NumPointsZFromWKTZScalec C s t d��d S )Nz:Aggregate extent not implemented for this spatial backend.��NotImplementedError�r �box�sridr r r �convert_extentM 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 �convert_extent3dR s �z&BaseSpatialOperations.convert_extent3dc C s d| S )Nz'%s'r )r �namer r r �geo_quote_nameX s z$BaseSpatialOperations.geo_quote_namec C s t d��dS )zh Return the database column type for the geometry field on the spatial backend. zGsubclasses of BaseSpatialOperations must provide a geo_db_type() methodNr )r �fr r r �geo_db_type\ s �z!BaseSpatialOperations.geo_db_typec C s t d��dS )zu Return the distance parameters for the given geometry field, lookup value, and lookup type. z:Distance operations not available on this spatial backend.Nr )r r �valueZlookup_typer r r �get_distancee s �z"BaseSpatialOperations.get_distancec C s� dd� }t |d�r6||j|�r2d| �d�|jf S dS |||�r\d| �d�| j|j|jf S | jjjrvd| j|jf S d | j S d S )a Return 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. c S s | d uo| j |j kS r )r )r �fieldr r r �transform_valuev s zCBaseSpatialOperations.get_geom_placeholder.<locals>.transform_valueZas_sqlz%s(%%s, %s)r r z%s(%s(%%s,%s), %s)z %s(%%s,%s)z%s(%%s)N)�hasattr�output_field�spatial_function_namer � from_text� connection�featuresZhas_spatialrefsys_table)r r r �compilerr! r r r �get_geom_placeholdern s �� � z*BaseSpatialOperations.get_geom_placeholderc s* t || j�rtd|j ��t� �|� d S )NzA%s spatial aggregation is not supported by this database backend.)� isinstance�disallowed_aggregatesr r �super�check_expression_support�r � expression�� __class__r r r- � s ��z.BaseSpatialOperations.check_expression_supportc C s t d��d S )Nz;Aggregate support not implemented for this spatial backend.r )r Zagg_namer r r �spatial_aggregate_name� s �z,BaseSpatialOperations.spatial_aggregate_namec C s* || j v rtd| ��| 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 r$ � 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() methodr r r r r �spatial_ref_sys� s �z%BaseSpatialOperations.spatial_ref_sysc s, t � �|�}t|jt�r(|�| �|�� |S r )r, �get_db_convertersr* r# r �append�get_geometry_converter)r r/ � convertersr0 r r r: � s z'BaseSpatialOperations.get_db_convertersc C s t d��d S )NzSSubclasses of BaseSpatialOperations must provide a get_geometry_converter() method.r r. r r r r<