+
    Tj.                        ^ RI Ht ^ RIHt ^ RIHt ^ RIHtHtH	t	 ^ RI
Ht ^ RIHt  ! R R]	4      t ! R	 R
]4      t]P                    ! R R]4      4       t]P                    ! R R]4      4       t]P                    ! R R]4      4       t]P                    ! R R]4      4       t]P                    ! R R]4      4       t]P                    ! R R]4      4       t]P                    ! R R]4      4       t]P                    ! R R]4      4       t]P                    ! R R]4      4       t]P                   ! ]R4       ]P                    ! R R]4      4       t]P                    ! R  R!]4      4       t]P                    ! R" R#]4      4       t]P                    ! R$ R%]4      4       t]P                    ! R& R']4      4       t]P                    ! R( R)]4      4       t]P                    ! R* R+]4      4       t ]P                    ! R, R-]4      4       t!]P                    ! R. R/]4      4       t"]P                    ! R0 R1]4      4       t#]P                    ! R2 R3]4      4       t$]P                    ! R4 R5]4      4       t%]P                    ! R6 R7]4      4       t&]P                    ! R8 R9]4      4       t']P                    ! R: R;]4      4       t( ! R< R=]4      t)]P                    ! R> R?])4      4       t* ! R@ RA])4      t+]P                    ! RB RC]+4      4       t,]P                    ! RD RE]+4      4       t-]P                    ! RF RG]+4      4       t.]P                    ! RH RI]+4      4       t/RJ# )K    )BaseSpatialField)Distance)NotSupportedError)
ExpressionLookup	Transform)Query)_lazy_re_compilec                   &   a  ] tR t^	t o R tRtV tR# )RasterBandTransformc                8    VP                  V P                  4      # N)compilelhs)selfcompiler
connections   &&&Y/var/www/idalgo/venv/lib/python3.14/site-packages/django/contrib/gis/db/models/lookups.pyas_sqlRasterBandTransform.as_sql
   s    ))     N__name__
__module____qualname____firstlineno__r   __static_attributes____classdictcell____classdict__s   @r   r   r   	   s     * *r   r   c                   t   a a ] tR t^t oRtRtRtRtRtV 3R lt	R t
RR ltR tV 3R ltR tR	 tR
tVtV ;t# )	GISLookupNFc                   < \        V\        \        34      '       d   TMV.vq n        \        SV `  W4       / V n        V P                  4        R # r   )
isinstancelisttuple
rhs_paramssuper__init__template_paramsprocess_rhs_params)r   r   rhs	__class__s   &&&r   r*   GISLookup.__init__   sB    '1#e}'E'EC5o"!!r   c                   V P                   '       dx   \        V P                   4      V P                  R 8X  d   ^M^8X  d   V P                  4        R# \        V P                   4      ^8  d   \	        RV P                  ,          4      hR# \        V P                  \        4      '       d   V P                  RR7       R# R# )relatezTuple too long for lookup %s.T)only_lhsN)r(   lenlookup_nameprocess_band_indices
ValueErrorr%   r   r   r   s   &r   r,   GISLookup.process_rhs_params   s    ???4??#T-=-=-IqQ))+T__%) !@4CSCS!STT *"566%%t%4 7r   c                0   V'       d,   ^V n         V P                  P                  ^,           V n        R# \	        V P                  \
        4      '       d$   V P                  P                  ^,           V n        M^V n        V P                  vV n         V n        R# )zg
Extract the lhs band index from the band transform class and the rhs
band index from the input tuple.
N)band_rhsr   
band_indexband_lhsr%   r   r(   )r   r2   s   &&r   r5   GISLookup.process_band_indices%   sh     DM HH//!3DMdhh 344 HH//!3DMDM*.//'r   c                >    R VP                   P                  V4      33# )%s)opsAdapter)r   valuer   s   &&&r   get_db_prep_lookupGISLookup.get_db_prep_lookup8   s    z~~--e4677r   c                  < \        V P                  \        4      '       d   \        SV `  W4      # \        V P                  \
        4      '       d+   V P                  P                  VP                  4      V n        \        SV `  W4      w  r4VP                  P                  V P                  P                  V P                  V4      pWS,          V3# r   )r%   r-   r	   r)   process_rhsr   resolve_expressionqueryr@   get_geom_placeholderr   output_field)r   r   r   r-   r(   placeholderr.   s   &&&   r   rF   GISLookup.process_rhs<   s    dhh&&7&x<<dhh
++xx228>>BDH'-hC nn99HH!!488X
  *,,r   c                P    VP                   P                  V P                  ,          # r   )r@   gis_operatorsr4   )r   r   r-   s   &&&r   
get_rhs_opGISLookup.get_rhs_opH   s     ~~++D,<,<==r   c                    V P                  W4      w  r4V P                  W4      w  rV. VOVO5pR VRVRR/V P                  CpV P                  W%4      p	V	P	                  W W4      # )r   r-   rB   r?   )process_lhsrF   r+   rO   r   )
r   r   r   lhs_sql
lhs_paramsrhs_sqlr(   
sql_paramsr+   rhs_ops
   &&&       r   r   GISLookup.as_sqlN   s    "..xD"..xD/z/J/
 77T
 ""	
 5}}ZKKr   )r<   r:   r-   r(   r+   )F)r   r   r   r   sql_templatetransform_funcdistancer:   r<   r*   r,   r5   rC   rF   rO   r   r   r   __classcell__r.   r!   s   @@r   r#   r#      sH     LNHHH"5:&8
->L Lr   r#   c                       ] tR t^btRtRtRtR# )OverlapsLeftLookupzm
The overlaps_left operator returns true if A's bounding box overlaps or is
to the left of B's bounding box.
overlaps_leftr   Nr   r   r   r   __doc__r4   r   r   r   r   r_   r_   b   s    
 "Kr   r_   c                       ] tR t^ltRtRtRtR# )OverlapsRightLookupzq
The 'overlaps_right' operator returns true if A's bounding box overlaps or
is to the right of B's bounding box.
overlaps_rightr   Nra   r   r   r   rd   rd   l       
 #Kr   rd   c                       ] tR t^vtRtRtRtR# )OverlapsBelowLookupzg
The 'overlaps_below' operator returns true if A's bounding box overlaps or
is below B's bounding box.
overlaps_belowr   Nra   r   r   r   rh   rh   v   rf   r   rh   c                       ] tR t^tRtRtRtR# )OverlapsAboveLookupzg
The 'overlaps_above' operator returns true if A's bounding box overlaps or
is above B's bounding box.
overlaps_abover   Nra   r   r   r   rk   rk      rf   r   rk   c                       ] tR t^tRtRtRtR# )
LeftLookupzc
The 'left' operator returns true if A's bounding box is strictly to the
left of B's bounding box.
leftr   Nra   r   r   r   rn   rn      s    
 Kr   rn   c                       ] tR t^tRtRtRtR# )RightLookupze
The 'right' operator returns true if A's bounding box is strictly to the
right of B's bounding box.
rightr   Nra   r   r   r   rq   rq      s    
 Kr   rq   c                       ] tR t^tRtRtRtR# )StrictlyBelowLookupzd
The 'strictly_below' operator returns true if A's bounding box is strictly
below B's bounding box.
strictly_belowr   Nra   r   r   r   rt   rt      rf   r   rt   c                       ] tR t^tRtRtRtR# )StrictlyAboveLookupzd
The 'strictly_above' operator returns true if A's bounding box is strictly
above B's bounding box.
strictly_abover   Nra   r   r   r   rw   rw      rf   r   rw   c                       ] tR t^tRtRtRtR# )SameAsLookupz
The "~=" operator is the "same as" operator. It tests actual geometric
equality of two features. So if A and B are the same feature,
vertex-by-vertex, the operator returns true.
same_asr   Nra   r   r   r   rz   rz      s     Kr   rz   exactc                       ] tR t^tRtRtRtR# )BBContainsLookupze
The 'bbcontains' operator returns true if A's bounding box completely
contains by B's bounding box.

bbcontainsr   Nra   r   r   r   r~   r~          
 Kr   r~   c                       ] tR t^tRtRtRtR# )BBOverlapsLookupzW
The 'bboverlaps' operator returns true if A's bounding box overlaps B's
bounding box.

bboverlapsr   Nra   r   r   r   r   r      r   r   r   c                       ] tR t^tRtRtRtR# )ContainedLookupzh
The 'contained' operator returns true if A's bounding box is completely
contained by B's bounding box.
	containedr   Nra   r   r   r   r   r      s    
 Kr   r   c                       ] tR t^tRtRtR# )ContainsLookupcontainsr   Nr   r   r   r   r4   r   r   r   r   r   r          Kr   r   c                       ] tR t^tRtRtR# )ContainsProperlyLookupcontains_properlyr   Nr   r   r   r   r   r      s    %Kr   r   c                       ] tR t^tRtRtR# )CoveredByLookup	coveredbyr   Nr   r   r   r   r   r      s    Kr   r   c                       ] tR t^tRtRtR# )CoversLookupcoversr   Nr   r   r   r   r   r          Kr   r   c                       ] tR t^tRtRtR# )CrossesLookupcrossesr   Nr   r   r   r   r   r          Kr   r   c                       ] tR t^tRtRtR# )DisjointLookupdisjointr   Nr   r   r   r   r   r      r   r   r   c                       ] tR tRtRtRtR# )EqualsLookupi  equalsr   Nr   r   r   r   r   r     r   r   r   c                       ] tR tRtRtRtR# )IntersectsLookupi  
intersectsr   Nr   r   r   r   r   r     s    Kr   r   c                       ] tR tRtRtRtR# )OverlapsLookupi  overlapsr   Nr   r   r   r   r   r     r   r   r   c                   J   a a ] tR tRt oRtRt]! R4      tV 3R ltRt	Vt
V ;t# )RelateLookupi  r1   z%(func)s(%(lhs)s, %(rhs)s, %%s)z^[012TF*]{9}$c                  < V P                   ^ ,          pVP                  P                  V P                  ,          p\	        VR4      '       d   VP                  V4       MI\        V\        4      '       d"   V P                  P                  V4      '       g   \        RV,          4      h\        SV `1  W4      w  rVV. VOVN53# )r   check_relate_argumentz)Invalid intersection matrix pattern "%s".)r(   r@   rN   r4   hasattrr   r%   strpattern_regexmatchr6   r)   rF   )r   r   r   pattern
backend_opsqlparamsr.   s   &&&    r   rF   RelateLookup.process_rhs  s    //!$^^11$2B2BC
:677,,W5GS))1C1C1I1I'1R1RH7RSSg)(?&f&g&&&r   r   )r   r   r   r   r4   rY   r
   r   rF   r   r   r\   r]   s   @@r   r   r     s$     K4L$%56M	' 	'r   r   c                       ] tR tRtRtRtR# )TouchesLookupi"  touchesr   Nr   r   r   r   r   r   "  r   r   r   c                       ] tR tRtRtRtR# )WithinLookupi'  withinr   Nr   r   r   r   r   r   '  r   r   r   c                   4   a  ] tR tRt o RtRtR tR tRtV t	R# )DistanceLookupBasei,  Tz+%(func)s(%(lhs)s, %(rhs)s) %(op)s %(value)sc                   ^\        V P                  4      u;8:  d   ^8:  g   M \        RV P                  ,          4      h\        V P                  4      ^8X  d$   V P                  ^,          R8w  d   \        R4      h\        V P                  4      ^8  d-   V P                  ^,          R8w  d   V P	                  4        R# R# R# )   z22, 3, or 4-element tuple required for '%s' lookup.spheroidzHFor 4-element tuples the last argument must be the 'spheroid' directive.N)r3   r(   r6   r4   r5   r7   s   &r   r,   %DistanceLookupBase.process_rhs_params0  s    C(-A-DtGWGWW  !Q&4??1+=+K  t!#(:j(H%%' )I#r   c                .   V P                   ^ ,          p\        VR4      '       d+   VP                  VP                  VP                  4      4      # RVP
                  P                  V P                  P                  V P                   V P                  4      3# )r   rG   r?   )
r(   r   r   rG   rH   r@   get_distancer   rJ   r4   )r   r   r   
dist_params   &&& r   process_distance#DistanceLookupBase.process_distance?  s    __Q'
 z#788 Z::8>>JK		
 ++HH))4??D<L<L		
r   r   N)
r   r   r   r   r[   rY   r,   r   r   r   r    s   @r   r   r   ,  s     H@L(
 
r   r   c                   F   a a ] tR tRt oRtRtV 3R ltV 3R ltRtVt	V ;t
# )DWithinLookupiM  dwithinz%%(func)s(%(lhs)s, %(rhs)s, %(value)s)c                   < V P                   ^ ,          pVP                  P                  '       g4   \        VR4      '       d"   \	        V\
        4      '       g   \        R4      h\        SV `!  W4      # )r   rG   zXThis backend does not support expressions for specifying distance in the dwithin lookup.)	r(   featuressupports_dwithin_distance_exprr   r%   r   r   r)   r   )r   r   r   r   r.   s   &&& r   r   DWithinLookup.process_distanceR  sb    __Q'
##BBB
$899z844#2  w'==r   c                z   < V P                  W4      w  r4W0P                  R &   \        SV `  W4      w  rVV. VOVO53# )rB   )r   r+   r)   rF   )r   r   r   dist_sqldist_paramsrU   r   r.   s   &&&    r   rF   DWithinLookup.process_rhs_  sK     $ 5 5h K(0W%'-hC/&/;///r   r   )r   r   r   r   r4   rY   r   rF   r   r   r\   r]   s   @@r   r   r   M  s     K:L>0 0r   r   c                   &   a  ] tR tRt o R tRtV tR# )DistanceLookupFromFunctionif  c                   \        V P                  4      ^8H  ;'       d    V P                  R,          R8H  ;'       g    RpVP                  P                  V P                  V P
                  VR7      pVP                  VP                  VP                  4      4      w  rVV P                  W4      w  rxRRVRV P                  RV/,          . VOVO53# )	   r   N)r   z%(func)s %(op)s %(dist)sfuncopdist)r3   r(   r@   distance_expr_for_lookupr   r-   r   rG   rH   r   r   )	r   r   r   r   distance_exprr   r   r   r   s	   &&&      r   r   !DistanceLookupFromFunction.as_sqlg  s     A%KK$//"*=*K  	 #??HHdhh @ 
 &&}'G'G'WX $ 5 5h K&&#tTWWfh)WW#f#{#
 	
r   r   Nr   r    s   @r   r   r   f  s     
 
r   r   c                       ] tR tRtRtRtRtR# )DistanceGTLookupiv  distance_gt>r   Nr   r   r   r   r4   r   r   r   r   r   r   r   v      K	Br   r   c                       ] tR tRtRtRtRtR# )DistanceGTELookupi|  distance_gtez>=r   Nr   r   r   r   r   r   |       K	Br   r   c                       ] tR tRtRtRtRtR# )DistanceLTLookupi  distance_lt<r   Nr   r   r   r   r   r     r   r   r   c                       ] tR tRtRtRtRtR# )DistanceLTELookupi  distance_ltez<=r   Nr   r   r   r   r   r     r   r   r   N)0#django.contrib.gis.db.models.fieldsr   django.contrib.gis.measurer   	django.dbr   django.db.modelsr   r   r   django.db.models.sql.queryr	   django.utils.regex_helperr
   r   r#   register_lookupr_   rd   rh   rk   rn   rq   rt   rw   rz   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>r      s%   @ / ' : : , 6*) *
LL LLh !!" " "" !!#) # "# !!#) # "# !!#) # "# !!  " !!)  " !!#) # "# !!#) # "# !!9  "     w 7 !!y  " !!y  " !!i  " !!Y  " !!&Y & "& !!i  " !!9  " !!I  " !!Y  " !!9  " !!y  " !!Y  " !!'9 ' "'" !!I  " !!9  "
 
B !!0& 0 "00
!3 
  !!1  "
 !!2  "
 !!1  "
 !!2  "r   