+
    Tje!                         R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
Ht ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt  ! R R]4      t ! R R]]4      tR# )z\
SQL functions reference lists:
https://www.gaia-gis.it/gaia-sins/spatialite-sql-4.3.0.html
)models)BaseSpatialOperations)SpatiaLiteAdapter)SpatialOperator)GEOSGeometryGEOSGeometryBase)wkb_r)Distance)ImproperlyConfigured)DatabaseOperations)cached_property)get_version_tuplec                   2   a a ] tR t^t oV 3R ltRtVtV ;t# )SpatialiteNullCheckOperatorc                >   < \         SV `  WW44      w  rVR V,          V3# )z%s > 0)superas_sql)self
connectionlookuptemplate_params
sql_paramssqlparams	__class__s   &&&&&  i/var/www/idalgo/venv/lib/python3.14/site-packages/django/contrib/gis/db/backends/spatialite/operations.pyr   "SpatialiteNullCheckOperator.as_sql   s$    gnZU#~v%%     )__name__
__module____qualname____firstlineno__r   __static_attributes____classdictcell____classcell__)r   __classdict__s   @@r   r   r      s     & &r   r   c                   d  a  ] tR t^t o RtRt]tRtRt	Rt
RtRt/ R]! R	R
7      bR]! RR
7      bR]! RR
7      bR]! RR
7      bR]! RR
7      bR]! RR
7      bR]! RR
7      bR]! RR
7      bR]! RR
7      bR]! RR
7      bR]! RR
7      bR]! R R
7      bR!]! R"R
7      bR#]! R$R
7      bR%]! R	R
7      bR&]! R	R
7      bR']! R(R
7      bt]P"                  3tR)tR*R+R,R-R.R/R0R1R2R3R4R5R6R7R8R9R:R;R<R=R>R?R@RA/t]RB 4       t]RC 4       tRD tRE tRF tRG tRH tRI tRJ tRK tRL t RM t!RN t"RO t#RP t$RQ t%RR t&RSt'V t(RT# )USpatiaLiteOperations
spatialiteTCollectExtentMakeLineGUnionGeomFromTextequalsEquals)funcdisjointDisjointtouchesTouchescrossesCrosseswithinWithinoverlapsOverlapscontainsContains
intersects
IntersectsrelateRelate	coveredby	CoveredBycoversCovers	contained	MbrWithin
bbcontainsMbrContains
bboverlapsMbrOverlapssame_asexactdwithinPtDistWithinzCAST (AsEWKB(%s) AS BLOB)AsWKBSt_AsBinaryBoundingCircleGEOSMinimumBoundingCircleForcePolygonCWST_ForceLHRFromWKBST_GeomFromWKBFromWKTST_GeomFromTextLength	ST_LengthLineLocatePointST_Line_Locate_Point	NumPoints
ST_NPointsReverse
ST_ReverseScaleScaleCoords	TranslateST_TranslateUnionST_Unionc                    0 RmpV P                  4       '       g   V0 Rm,          pV P                  R8  d   VR0,          pV# )GeometryDistancerR   >   RotateIsEmptyMemSizeri   >   AzimuthGeoHash	MakeValid)      )geom_lib_versionspatial_version)r   unsupporteds   & r   unsupported_functions*SpatiaLiteOperations.unsupported_functionsU   sC    J$$&&>>K&(,--Kr   c                     V P                  4       R,          pTR8  d   \        R4      hT#   \         d2   p\        RT P                  P                  R,          : R24      ThRp?ii ; i)z0Determine the version of the SpatiaLite library.:rq   NNz1Cannot determine the SpatiaLite version for the "NAMEzJ" database. Was the SpatiaLite initialization SQL loaded on this database?Nz.GeoDjango supports SpatiaLite 4.3.0 and above.)          )spatialite_version_tuple	Exceptionr
   r   settings_dict)r   versionexcs   &  r   rs   $SpatiaLiteOperations.spatial_version^   su    	335b9G Y&'WXX  	& ??0088; 		s   - A),A$$A)c                    Vf   R# \        V4      P                  pV^ ,          R,          w  r4V^,          R,          w  rVW4WV3# )zF
Convert the polygon data received from SpatiaLite to min/max values.
N:N   N)r   shell)r   boxr   xminyminxmaxymaxs   &&     r   convert_extent#SpatiaLiteOperations.convert_extentm   sE     ;S!''1Xb\
1Xb\
D''r   c                    R# )zl
Return None because geometry columns are added via the
`AddGeometryColumn` stored procedure on SpatiaLite.
Nr   )r   fs   &&r   geo_db_type SpatiaLiteOperations.geo_db_typex   s    
 r   c                \   V'       g   . # V^ ,          p\        V\        4      '       d   VP                  V P                  4      '       d"   VR8X  d   \	        R4      hVP
                  pV.# \        V\        P                  ! VP                  V P                  4      4      4      p V.# TpV.# )z]
Return the distance parameters for the given geometry field,
lookup value, and lookup type.
rN   zNOnly numeric values of degree units are allowed on geographic DWithin queries.)	
isinstancer	   geodeticr   
ValueErrormgetattrunit_attname
units_name)r   r   valuelookup_type
dist_params   &&&& r   get_distance!SpatiaLiteOperations.get_distance   s    
 IaeX&&zz$//**)+$6  #WW
 | %800doo1NO

 | J|r   c                    V P                   P                  4       p VP                  RV,          4       VP                  4       pVP	                  4        V^ ,          #   TP	                  4        i ; i)z
Helper routine for calling SpatiaLite functions and returning
their result.
Any error occurring in this method should be handled by the caller.
z	SELECT %s)r   _cursorexecutefetchoneclose)r   r1   cursorrows   &&  r   _get_spatialite_func)SpatiaLiteOperations._get_spatialite_func   sW     ((*	NN;-.//#CLLN1v LLNs   (A A/c                $    V P                  R4      # )z:Return the version of GEOS used by SpatiaLite as a string.zgeos_version()r   r   s   &r   geos_version!SpatiaLiteOperations.geos_version   s    (()9::r   c                $    V P                  R4      # )z:Return the version of the PROJ library used by SpatiaLite.zproj4_version()r   r   s   &r   proj_version!SpatiaLiteOperations.proj_version   s    (():;;r   c                $    V P                  R4      # )z8Return the version of LWGEOM library used by SpatiaLite.zlwgeom_version()r   r   s   &r   lwgeom_version#SpatiaLiteOperations.lwgeom_version       (();<<r   c                $    V P                  R4      # )z8Return the version of RTTOPO library used by SpatiaLite.zrttopo_version()r   r   s   &r   rttopo_version#SpatiaLiteOperations.rttopo_version   r   r   c                d    V P                   R8  d   V P                  4       # V P                  4       # )zN
Return the version of the version-dependant geom library used by
SpatiaLite.
)rp   )rs   r   r   r   s   &r   rr   %SpatiaLiteOperations.geom_lib_version   s0    
 4'&&((&&((r   c                $    V P                  R4      # )z2Return the SpatiaLite library version as a string.zspatialite_version()r   r   s   &r   spatialite_version'SpatiaLiteOperations.spatialite_version   s    (()?@@r   c                @    V P                  4       pV.\        V4      O5# )zT
Return the SpatiaLite version as a tuple (version string, major,
minor, subminor).
)r   r   )r   r   s   & r   r|   -SpatiaLiteOperations.spatialite_version_tuple   s&    
 ))+5+G455r   c                f    VP                  4       R8X  d   RMVP                  4       p\        W4      # )zZ
Return the spatial aggregate SQL template and function for the
given Aggregate instance.
unionunionagg)lowerr   )r   agg_names   &&r   spatial_aggregate_name+SpatiaLiteOperations.spatial_aggregate_name   s+    
 "*!1W!<:(..BRt&&r   c                    ^ RI Hp V# )r{   )SpatialiteGeometryColumns)0django.contrib.gis.db.backends.spatialite.modelsr   )r   r   s   & r   geometry_columns%SpatiaLiteOperations.geometry_columns   s    	
 )(r   c                    ^ RI Hp V# )r{   )SpatialiteSpatialRefSys)r   r   )r   r   s   & r   spatial_ref_sys$SpatiaLiteOperations.spatial_ref_sys   s    	
 '&r   c                l   aa VP                   P                  o\        4       P                  oVV3R  lpV# )c                 4   < V f   R # \        S! V 4      S4      # )N)r   )r   
expressionr   
geom_classreads   &&&r   	converter>SpatiaLiteOperations.get_geometry_converter.<locals>.converter   s     =4W.>tE{J.WWr   )output_fieldr   r   r   )r   r   r   r   r   s   && @@r   get_geometry_converter+SpatiaLiteOperations.get_geometry_converter   s-    ,,77
w||	X r   r   N))r   r    r!   r"   namer)   r   Adaptercollectextentmakeliner   	from_textr   r   gis_operatorsr   Extent3Ddisallowed_aggregatesselectfunction_namesr   ru   rs   r   r   r   r   r   r   r   r   rr   r   r|   r   r   r   r   r#   r$   )r&   s   @r   r(   r(      s6    DJGGFHHI-8< 	/Z@ 	.I>	
 	.I> 	-8< 	/Z@ 	/Z@ 	1|D 	-8< 	0kB 	-8< 	_+6$ 	o=9%( 	o=9), 	.H=-. 	,(;/2 	?73M8 $__.(F 	5-#$+1\<^N    	(0;<==)A6')' r   r(   N)__doc__django.contrib.gis.dbr   .django.contrib.gis.db.backends.base.operationsr   1django.contrib.gis.db.backends.spatialite.adapterr   $django.contrib.gis.db.backends.utilsr    django.contrib.gis.geos.geometryr   r   %django.contrib.gis.geos.prototypes.ior   django.contrib.gis.measurer	   django.core.exceptionsr
   %django.db.backends.sqlite3.operationsr   django.utils.functionalr   django.utils.versionr   r   r(   r   r   r   <module>r      sK   
 ) P O @ K 7 / 7 D 3 2&/ &P02D Pr   