ó
    µRj›  ã                   óN   • S r SSKJrJr  SSKJr   " S S\5      r " S S5      rg)	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                   ó4   • \ rS rSrSrS\4S\4S\4S\4/rSrg)	ÚOGREnvelopeé   z&Represent the OGREnvelope C Structure.ÚMinXÚMaxXÚMinYÚMaxY© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú_fields_Ú__static_attributes__r   ó    ÚLD:\diplom_project\venv\Lib\site-packages\django/contrib/gis/gdal/envelope.pyr   r      s,   † Ù,à	�ÐØ	�ÐØ	�ÐØ	�Ðð	ƒHr   r   c                   ó¶   • \ rS rSrSrS rS rS rS rS r	\
S 5       r\
S	 5       r\
S
 5       r\
S 5       r\
S 5       r\
S 5       r\
S 5       r\
S 5       rSrg)ÚEnvelopeé   zÇ
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                 óœ  • [        U5      S:X  aœ  [        US   [        5      (       a  US   U l        OË[        US   [        [
        45      (       aA  [        US   5      S:w  a  [        S[        US   5      -  5      eU R                  US   5        Ol[        S[        US   5      -  5      e[        U5      S:X  a,  U R                  U Vs/ s H  n[        U5      PM     sn5        O[        S[        U5      -  5      eU R                  U R                  :”  a  [        S5      eU R                  U R                  :”  a  [        S5      eg	s  snf )
zt
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__ÚEnvelope.__init__&   s!  € ô ˆt‹9˜‹>Ü˜$˜q™'¤;×/Ñ/à!% a¡�•Ü˜D ™G¤e¬T ]×3Ñ3ä�t˜A‘w“< 1Ó$Ü'ØBÄSÈÈaÉÃ\ÑQóð ð ×'Ñ'¨¨Q©Õ0äÐ @Ä4ÈÈQÉÃ=Ñ PÓQÐQÜ�‹Y˜!‹^ð ×Ñ±4Ó 8²4¨a¤ q¦±4Ñ 8Õ9äÐ EÌÈDË	Ñ QÓRÐRð �:‰:˜Ÿ
™
Ó"ÜÐ AÓBÐBØ�:‰:˜Ÿ
™
Ó"ÜÐ AÓBÐBð #ùò !9s   Ã
E	c                 ó6  • [        U[        5      (       ay  U R                  UR                  :H  =(       aY    U R                  UR                  :H  =(       a9    U R                  UR                  :H  =(       a    U R
                  UR
                  :H  $ [        U[        5      (       al  [        U5      S:X  a]  U R                  US   :H  =(       aD    U R                  US   :H  =(       a+    U R                  US   :H  =(       a    U R
                  US   :H  $ [        S5      e)z`
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__ÚEnvelope.__eq__G   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                 ó,   • [        U R                  5      $ )z,Return a string representation of the tuple.)Ústrr#   ©r-   s    r   Ú__str__ÚEnvelope.__str__]   s   € ä�4—:‘:‹Ðr   c                 óÂ   • [        5       U l        US   U R                  l        US   U R                  l        US   U R                  l        US   U R                  l        g)z@Initialize the C OGR Envelope structure from the given sequence.r   r   r3   r4   N)r   r"   r	   r   r
   r   )r-   Úseqs     r   r%   ÚEnvelope._from_sequencea   sK   € ä$›ˆŒØ! !™fˆ�‰ÔØ! !™fˆ�‰ÔØ! !™fˆ�‰ÔØ! !™fˆ�‰Õr   c                 óæ  • [        U5      S:X  Gaø  [        US   [        5      (       a  U R                  US   R                  5      $ [        US   S5      (       a\  [        US   S5      (       aH  U R                  US   R                  US   R                  US   R                  US   R                  5      $ [        US   [        [        45      (       Ga  [        US   5      S:X  a-  U R                  US   S   US   S   US   S   US   S   45      $ [        US   5      S:X  a®  US   u  p#pEX R                  R                  :  a  X R                  l
        X0R                  R                  :  a  X0R                  l        X@R                  R                  :”  a  X@R                  l        XPR                  R                  :”  a  XPR                  l        g
g
[        S[        US   5      -  5      e[        S[!        US   5      -  5      e[        U5      S:X  a!  U R                  US   US   US   US   45      $ [        U5      S:X  a  U R                  U5      $ [        S	[        US   5      -  5      e)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Úyr3   r   r   r   r   N)r    r!   r   Úexpand_to_includer#   ÚhasattrrA   rB   r$   r"   r	   r   r
   r   r   r&   r'   )r-   r.   ÚminxÚminyÚmaxxÚmaxys         r   rC   ÚEnvelope.expand_to_includei   s.  € ô ˆ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Ò3ä�t˜A‘w“< 1Ó$Ø×1Ñ1Ø˜a™ ™ T¨!¡W¨Q¡Z°°a±¸±¸TÀ!¹WÀQ¹ZÐHóð ô ˜˜a™“\ QÓ&Ø/3°A©wÑ,�T ØŸn™n×1Ñ1Ó1Ø.2Ÿ™Ô+ØŸn™n×1Ñ1Ó1Ø.2Ÿ™Ô+ØŸn™n×1Ñ1Ó1Ø.2Ÿ™Ô+ØŸn™n×1Ñ1Ó1Ø.2Ÿ™Õ+ð 2ô (ØBÄSÈÈaÉÃ\ÑQóð ô  Ð @Ä4ÈÈQÉÃ=Ñ PÓQÐQÜ�‹Y˜!‹^à×)Ñ)¨4°©7°D¸±G¸TÀ!¹WÀdÈ1ÁgÐ*NÓOÐOÜ�‹Y˜!‹^à×)Ñ)¨$Ó/Ð/äÐ EÌÈDÐQRÉGËÑ TÓUÐUr   c                 ó.   • U R                   R                  $ )z-Return the value of the minimum X coordinate.)r"   r	   r:   s    r   r)   ÚEnvelope.min_x™   ó   € ð �~‰~×"Ñ"Ð"r   c                 ó.   • U R                   R                  $ )z-Return the value of the minimum Y coordinate.)r"   r   r:   s    r   r+   ÚEnvelope.min_yž   rL   r   c                 ó.   • U R                   R                  $ )z-Return the value of the maximum X coordinate.)r"   r
   r:   s    r   r*   ÚEnvelope.max_x£   rL   r   c                 ó.   • U R                   R                  $ )z-Return the value of the maximum Y coordinate.)r"   r   r:   s    r   r,   ÚEnvelope.max_y¨   rL   r   c                 ó2   • U R                   U R                  4$ )z"Return the upper-right coordinate.)r*   r,   r:   s    r   ÚurÚEnvelope.ur­   ó   € ð —
‘
˜DŸJ™JÐ'Ð'r   c                 ó2   • U R                   U R                  4$ )z!Return the lower-left coordinate.)r)   r+   r:   s    r   ÚllÚEnvelope.ll²   rV   r   c                 ó^   • U R                   U R                  U R                  U R                  4$ )z)Return a tuple representing the envelope.)r)   r+   r*   r,   r:   s    r   r#   ÚEnvelope.tuple·   s#   € ð —
‘
˜DŸJ™J¨¯
©
°D·J±JÐ?Ð?r   c                 ó   • SU R                   < SU R                  < SU R                   < SU R                  < SU R                  < SU R                  < SU R                  < SU R                  < SU R                   < SU R                  < S3$ )z4Return WKT representing a Polygon for this envelope.z	POLYGON((Ú Ú,z)))r)   r+   r,   r*   r:   s    r   ÚwktÚEnvelope.wkt¼   sT   � ð
 �JŒJØ�JŒJØ�JŒJØ�JŒJØ�JŒJØ�JŒJØ�JŒJØ�JŒJØ�JŒJØ�JŒJð
ð 	
r   )r"   N)r   r   r   r   r   r0   r6   r;   r%   rC   Úpropertyr)   r+   r*   r,   rT   rX   r#   r_   r   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>rd      s*   ðñ÷ 'å 7ô�)ô ÷l
ò l
r   