
    h                     `    S SK Jr  S SKJr  S SKJr  S SKJr  S SKJ	r	  S SK
Jr   " S S5      rg)	    )GeometryField)Distance)Area)NotSupportedError)cached_propertyc                      ^  \ rS rSrSrSrSrSrSrSr	Sr
\S 5       rSrSr0 r1 SkrSrS	 rS
 rS rS rS rS rU 4S jrS rS rS rS r\" \5      rU 4S jr S r!S r"S r#Sr$U =r%$ )BaseSpatialOperations	   FN%sc                     U R                   $ N)selectselfs    `/var/www/html/env/lib/python3.13/site-packages/django/contrib/gis/db/backends/base/operations.pyselect_extent#BaseSpatialOperations.select_extent   s    {{      >"   r   AsGMLAsKMLAsSVGScaleUnionLengthAzimuthFromWKBFromWKTGeoHashIsEmptyIsValidMemSizeReverseCentroidr   Envelope	AsGeoJSON	MakeValid	NumPoints	Perimeter	Transform	Translate
Difference
SnapToGridClosestPointIntersectionNumGeometriesSymDifferenceBoundingCirclePointOnSurfaceLineLocatePointGeometryDistancec                     [        S5      e)Nz:Aggregate extent not implemented for this spatial backend.NotImplementedErrorr   boxsrids      r   convert_extent$BaseSpatialOperations.convert_extentN   s    !H
 	
r   c                     [        S5      e)Nz=Aggregate 3D extent not implemented for this spatial backend.r8   r:   s      r   convert_extent3d&BaseSpatialOperations.convert_extent3dS   s    !K
 	
r   c                     SU-  $ )Nz'%s'r   )r   names     r   geo_quote_name$BaseSpatialOperations.geo_quote_nameY   s    }r   c                     [        S5      e)zP
Return the database column type for the geometry field on
the spatial backend.
zGsubclasses of BaseSpatialOperations must provide a geo_db_type() methodr8   )r   fs     r   geo_db_type!BaseSpatialOperations.geo_db_type]   s    
 "U
 	
r   c                     [        S5      e)z]
Return the distance parameters for the given geometry field,
lookup value, and lookup type.
z:Distance operations not available on this spatial backend.r8   )r   rG   valuelookup_types       r   get_distance"BaseSpatialOperations.get_distancef   s    
 "H
 	
r   c                    S n[        US5      (       a=  U" UR                  U5      (       a#  U R                  S5      < SUR                  < S3$ S$ U" X!5      (       a?  U R                  S5      < SU R                  < SUR                  < S	UR                  < S3$ U R
                  R                  R                  (       a  U R                  < SUR                  < S3$ S
U R                  -  $ )z
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                 J    U S L=(       a    U R                   UR                   :g  $ r   )r<   )rK   fields     r   transform_valueCBaseSpatialOperations.get_geom_placeholder.<locals>.transform_valuew   s    $Auzz)AAr   as_sqlr+   z(%s, )r   (z(%s,z), z%s(%%s))hasattroutput_fieldspatial_function_namer<   	from_text
connectionfeatureshas_spatialrefsys_table)r   rG   rK   compilerrR   s        r   get_geom_placeholder*BaseSpatialOperations.get_geom_placeholdero   s    	B 5(## #5#5#5q99 "&!;!;K!H!&&Q 
 5$$ **;7

	  __%%==#'>>166:: t~~--r   c                    > [        XR                  5      (       a  [        SUR                  -  5      e[        TU ]  U5        g )NzA%s spatial aggregation is not supported by this database backend.)
isinstancedisallowed_aggregatesr   rC   supercheck_expression_support)r   
expression	__class__s     r   re   .BaseSpatialOperations.check_expression_support   s?    j"<"<==#S//"  	(4r   c                     [        S5      e)Nz;Aggregate support not implemented for this spatial backend.r8   )r   agg_names     r   spatial_aggregate_name,BaseSpatialOperations.spatial_aggregate_name   s    !I
 	
r   c                     XR                   ;   a  [        SU-  5      eU R                  R                  XR                  U-   5      $ )Nz-This backend doesn't support the %s function.)unsupported_functionsr   function_namesgetgeom_func_prefix)r   	func_names     r   rY   +BaseSpatialOperations.spatial_function_name   sG    222#?)K  ""&&y2G2G)2STTr   c                     [        S5      e)NzMSubclasses of BaseSpatialOperations must provide a geometry_columns() method.r8   r   s    r   geometry_columns&BaseSpatialOperations.geometry_columns   s    !
 	
r   c                     [        S5      e)NzKsubclasses of BaseSpatialOperations must a provide spatial_ref_sys() methodr8   r   s    r   spatial_ref_sys%BaseSpatialOperations.spatial_ref_sys   s    !
 	
r   c                    > [         TU ]  U5      n[        UR                  [        5      (       a   UR                  U R                  U5      5        U$ r   )rd   get_db_convertersrb   rX   r   appendget_geometry_converter)r   rf   
convertersrg   s      r   r{   'BaseSpatialOperations.get_db_converters   sD    W.z:
j--}==d99*EFr   c                     [        S5      e)NzSSubclasses of BaseSpatialOperations must provide a get_geometry_converter() method.r8   )r   rf   s     r   r}   ,BaseSpatialOperations.get_geometry_converter   s    !/
 	
r   c                    UR                  U R                  5      (       a1  U R                  R                  R                  (       a  g[	        S5      eUR                  U R                  5      nU(       a  [        R                  " U5      $ g )Nsq_mz2Area on geodetic coordinate systems not supported.)geodeticr[   r\   supports_area_geodeticr9   
units_nameAreaMeasureunit_attname)r   rQ   r   s      r   get_area_att_for_field,BaseSpatialOperations.get_area_att_for_field   sj    >>$//**''>>%D  ))$//:J"//
;; r   c                    S nUR                  U R                  5      (       a)  U R                  R                  R                  (       a  SnU$ UR	                  U R                  5      nU(       a  [
        R                  " U5      nU$ )Nm)r   r[   r\   supports_distance_geodeticr   DistanceMeasurer   )r   rQ   dist_attunitss       r   get_distance_att_for_field0BaseSpatialOperations.get_distance_att_for_field   sg    >>$//**''BB
  $$T__5E*77>r   )&__name__
__module____qualname____firstlineno__postgis
spatialitemariadbmysqloraclespatial_versionr   r   r   rc   rq   ro   rn   rZ   r=   r@   rD   rH   rM   r_   re   rk   rY   ru   rx   staticmethodr   distance_expr_for_lookupr{   r}   r   r   __static_attributes____classcell__)rg   s   @r   r	   r	   	   s     GJGEFO F   N#L I




.>5

U

  ,H5

<	 	r   r	   N)django.contrib.gis.db.modelsr   &django.contrib.gis.db.models.functionsr   django.contrib.gis.measurer   r   r   	django.dbr   django.utils.functionalr   r	   r   r   r   <module>r      s#    6 ; : B ' 3I Ir   