Ë
    ¹ûàgœ  ã                   óN   — d Z ddlmZmZ ddlmZ  G d„ de«      Z G d„ d«      Zy)	aÙ  
 The GDAL/OGR library uses an Envelope structure to hold the bounding
 box information for a geometry.  The envelope (bounding box) contains
 two pairs of coordinates, one for the lower left coordinate and one
 for the upper right coordinate:

                           +----------o Upper right; (max_x, max_y)
                           |          |
                           |          |
                           |          |
 Lower left (min_x, min_y) o----------+
é    )Ú	StructureÚc_double)ÚGDALExceptionc                   ó,   — e Zd ZdZdefdefdefdefgZy)ÚOGREnvelopez&Represent the OGREnvelope C Structure.ÚMinXÚMaxXÚMinYÚMaxYN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú_fields_© ó    ú^/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/django/contrib/gis/gdal/envelope.pyr   r      s,   „ Ù,à	�ÐØ	�ÐØ	�ÐØ	�Ðð	�Hr   r   c                   ó®   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Ze	d„ «       Z
e	d„ «       Ze	d	„ «       Ze	d
„ «       Ze	d„ «       Ze	d„ «       Ze	d„ «       Ze	d„ «       Zy)ÚEnvelopez×
    The Envelope object is a C structure that contains the minimum and
    maximum X, Y coordinates for a rectangle bounding box.  The naming
    of the variables is compatible with the OGR Envelope structure.
    c                 óx  — t        |«      dk(  r‘t        |d   t        «      r|d   | _        nÁt        |d   t        t
        f«      r@t        |d   «      dk7  rt        dt        |d   «      z  «      ‚| j                  |d   «       nht        dt        |d   «      z  «      ‚t        |«      dk(  r)| j                  |D �cg c]  }t        |«      ‘Œ c}«       nt        dt        |«      z  «      ‚| j                  | j                  kD  rt        d«      ‚| j                  | j                  kD  rt        d«      ‚y	c c}w )
zŒ
        The initialization function may take an OGREnvelope structure, 4-element
        tuple or list, or 4 individual arguments.
        é   r   é   ú(Incorrect number of tuple elements (%d).úIncorrect type of argument: %sú#Incorrect number (%d) of arguments.zEnvelope minimum X > maximum X.zEnvelope minimum Y > maximum Y.N)ÚlenÚ
isinstancer   Ú	_envelopeÚtupleÚlistr   Ú_from_sequenceÚ	TypeErrorÚtypeÚfloatÚmin_xÚmax_xÚmin_yÚmax_y)ÚselfÚargsÚas      r   Ú__init__zEnvelope.__init__'   s  € ô ˆt‹9˜Š>Ü˜$˜q™'¤;Ô/à!% a¡�•Ü˜D ™G¤e¬T ]Ô3ä�t˜A‘w“< 1Ò$Ü'ØBÄSÈÈaÉÃ\ÑQóð ð ×'Ñ'¨¨Q©Õ0äÐ @Ä4ÈÈQÉÃ=Ñ PÓQÐQÜ�‹Y˜!Š^ð ×Ñ°4Ö 8¨a¤ q¥Ò 8Õ9äÐ EÌÈDË	Ñ QÓRÐRð �:‰:˜Ÿ
™
Ò"ÜÐ AÓBÐBØ�:‰:˜Ÿ
™
Ò"ÜÐ AÓBÐBð #ùò !9s   Â=D7c                 óä  — t        |t        «      rj| j                  |j                  k(  xrO | j                  |j                  k(  xr4 | j                  |j                  k(  xr | j
                  |j
                  k(  S t        |t        «      r\t        |«      dk(  rN| j                  |d   k(  xr: | j                  |d   k(  xr& | j                  |d   k(  xr | j
                  |d   k(  S t        d«      ‚)zx
        Return True if the envelopes are equivalent; can compare against
        other Envelopes and 4-tuples.
        r   r   r   é   é   z4Equivalence testing only works with other Envelopes.)	r   r   r%   r'   r&   r(   r   r   r   )r)   Úothers     r   Ú__eq__zEnvelope.__eq__H   sÞ   € ô
 �eœXÔ&à—‘˜uŸ{™{Ñ*ò 0Ø—Z‘Z 5§;¡;Ñ.ò0à—Z‘Z 5§;¡;Ñ.ò0ð —Z‘Z 5§;¡;Ñ.ð	ô ˜œuÔ%¬#¨e«*¸ª/à—‘˜u Q™xÑ'ò -Ø—Z‘Z 5¨¡8Ñ+ò-à—Z‘Z 5¨¡8Ñ+ò-ð —Z‘Z 5¨¡8Ñ+ð	ô  Ð VÓWÐWr   c                 ó,   — t        | j                  «      S )z,Return a string representation of the tuple.)Ústrr   ©r)   s    r   Ú__str__zEnvelope.__str__^   s   € ä�4—:‘:‹Ðr   c                 óÂ   — t        «       | _        |d   | j                  _        |d   | j                  _        |d   | j                  _        |d   | j                  _        y)z@Initialize the C OGR Envelope structure from the given sequence.r   r   r.   r/   N)r   r   r   r
   r	   r   )r)   Úseqs     r   r!   zEnvelope._from_sequenceb   sK   € ä$›ˆŒØ! !™fˆ�‰ÔØ! !™fˆ�‰ÔØ! !™fˆ�‰ÔØ! !™fˆ�‰Õr   c                 óÀ  — t        |«      dk(  �rèt        |d   t        «      r| j                  |d   j                  «      S t        |d   d«      rWt        |d   d«      rH| j                  |d   j                  |d   j                  |d   j                  |d   j                  «      S t        |d   t        t        f«      �rt        |d   «      dk(  r-| j                  |d   d   |d   d   |d   d   |d   d   f«      S t        |d   «      dk(  r³|d   \  }}}}|| j                  j                  k  r|| j                  _
        || j                  j                  k  r|| j                  _        || j                  j                  kD  r|| j                  _        || j                  j                  kD  rF|| j                  _        y
t        dt        |d   «      z  «      ‚t        dt!        |d   «      z  «      ‚y
t        |«      dk(  r!| j                  |d   |d   |d   |d   f«      S t        |«      dk(  r| j                  |«      S t        d	t        |d   «      z  «      ‚)zž
        Modify the envelope to expand to include the boundaries of
        the passed-in 2-tuple (a point), 4-tuple (an extent) or
        envelope.
        r   r   ÚxÚyr.   r   r   r   r   N)r   r   r   Úexpand_to_includer   Úhasattrr9   r:   r    r   r   r
   r	   r   r   r"   r#   )r)   r*   ÚminxÚminyÚmaxxÚmaxys         r   r;   zEnvelope.expand_to_includej   s6  € ô ˆt‹9˜‹>Ü˜$˜q™'¤8Ô,Ø×-Ñ-¨d°1©g¯m©mÓ<Ð<Ü˜˜a™ #Ô&¬7°4¸±7¸CÔ+@Ø×-Ñ-Ø˜‘G—I‘I˜t A™wŸy™y¨$¨q©'¯)©)°T¸!±W·Y±Yóð ô ˜D ™G¤e¬T ]Õ3ä�t˜A‘w“< 1Ò$Ø×1Ñ1Ø˜a™ ™ T¨!¡W¨Q¡Z°°a±¸±¸TÀ!¹WÀQ¹ZÐHóð ô ˜˜a™“\ QÒ&Ø/3°A©wÑ,�T˜4  tØ˜dŸn™n×1Ñ1Ò1Ø.2˜Ÿ™Ô+Ø˜dŸn™n×1Ñ1Ò1Ø.2˜Ÿ™Ô+Ø˜dŸn™n×1Ñ1Ò1Ø.2˜Ÿ™Ô+Ø˜dŸn™n×1Ñ1Ò1Ø.2˜Ÿ™Õ+ä'ØBÄSÈÈaÉÃ\ÑQóð ô  Ð @Ä4ÈÈQÉÃ=Ñ PÓQÐQð 2ô �‹Y˜!Š^à×)Ñ)¨4°©7°D¸±G¸TÀ!¹WÀdÈ1ÁgÐ*NÓOÐOÜ�‹Y˜!Š^à×)Ñ)¨$Ó/Ð/äÐ EÌÈDÐQRÉGËÑ TÓUÐUr   c                 ó.   — | j                   j                  S )z-Return the value of the minimum X coordinate.)r   r   r4   s    r   r%   zEnvelope.min_xš   ó   € ð �~‰~×"Ñ"Ð"r   c                 ó.   — | j                   j                  S )z-Return the value of the minimum Y coordinate.)r   r
   r4   s    r   r'   zEnvelope.min_yŸ   rB   r   c                 ó.   — | j                   j                  S )z-Return the value of the maximum X coordinate.)r   r	   r4   s    r   r&   zEnvelope.max_x¤   rB   r   c                 ó.   — | j                   j                  S )z-Return the value of the maximum Y coordinate.)r   r   r4   s    r   r(   zEnvelope.max_y©   rB   r   c                 ó2   — | j                   | j                  fS )z"Return the upper-right coordinate.)r&   r(   r4   s    r   ÚurzEnvelope.ur®   ó   € ð —
‘
˜DŸJ™JÐ'Ð'r   c                 ó2   — | j                   | j                  fS )z!Return the lower-left coordinate.)r%   r'   r4   s    r   ÚllzEnvelope.ll³   rH   r   c                 ó^   — | j                   | j                  | j                  | j                  fS )z)Return a tuple representing the envelope.)r%   r'   r&   r(   r4   s    r   r   zEnvelope.tuple¸   s#   € ð —
‘
˜DŸJ™J¨¯
©
°D·J±JÐ?Ð?r   c                 ó  — d| j                   ›d| j                  ›d| j                   ›d| j                  ›d| j                  ›d| j                  ›d| j                  ›d| j                  ›d| j                   ›d| j                  ›d�S )z4Return WKT representing a Polygon for this envelope.z	POLYGON((ú ú,z)))r%   r'   r(   r&   r4   s    r   ÚwktzEnvelope.wkt½   sT   � ð
 �J‹JØ�J‹JØ�J‹JØ�J‹JØ�J‹JØ�J‹JØ�J‹JØ�J‹JØ�J‹JØ�J‹Jð
ð 	
r   N)r   r   r   r   r,   r1   r5   r!   r;   Úpropertyr%   r'   r&   r(   rG   rJ   r   rO   r   r   r   r   r       sÇ   „ ñòCòBXò,ò%ò.Vð` ñ#ó ð#ð ñ#ó ð#ð ñ#ó ð#ð ñ#ó ð#ð ñ(ó ð(ð ñ(ó ð(ð ñ@ó ð@ð ñ
ó ñ
r   r   N)r   Úctypesr   r   Údjango.contrib.gis.gdal.errorr   r   r   r   r   r   ú<module>rS      s*   ðñ÷ 'å 7ô�)ô ÷l
ò l
r   