https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/django/contrib/gis/gdal/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/django/contrib/gis/gdal/__pycache__/envelope.cpython-310.pyc
o

�a>�@sBdZddlmZmZddlmZGdd�de�ZGdd�d�ZdS)	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@s,eZdZdZdefdefdefdefgZdS)�OGREnvelopez&Represent the OGREnvelope C Structure.�MinX�MaxX�MinY�MaxYN)�__name__�
__module__�__qualname__�__doc__r�_fields_�rr�B/usr/lib/python3/dist-packages/django/contrib/gis/gdal/envelope.pyrs�rc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Ze	dd
��Z
e	dd��Ze	dd��Ze	dd��Z
e	dd��Ze	dd��Ze	dd��Ze	dd��ZdS)�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.
    cGs�t|�dkr@t|dt�r|d|_nFt|dttf�r6t|d�dkr.tdt|d���|�|d�n#tdt	|d���t|�dkrQ|�dd�|D��ntdt|���|j
|jkrctd	��|j|j
krmtd
��dS)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: %scSsg|]}t|��qSr)�float)�.0�arrr�
<listcomp>:sz%Envelope.__init__.<locals>.<listcomp>�#Incorrect number (%d) of arguments.zEnvelope minimum X > maximum X.zEnvelope minimum Y > maximum Y.N)�len�
isinstancer�	_envelope�tuple�listr�_from_sequence�	TypeError�type�min_x�max_x�min_y�max_y)�self�argsrrr�__init__%s �zEnvelope.__init__cCs�t|t�r|j|jko|j|jko|j|jko|j|jkSt|t�rDt|�dkrD|j|dkoC|j|dkoC|j|dkoC|j|dkStd��)zx
        Return True if the envelopes are equivalent; can compare against
        other Envelopes and 4-tuples.
        rrr��z4Equivalence testing only works with other Envelopes.)	rrr#r%r$r&rrr)r'�otherrrr�__eq__Ds

�
���zEnvelope.__eq__cCs
t|j�S)z,Return a string representation of the tuple.)�strr�r'rrr�__str__Rs
zEnvelope.__str__cCs<t�|_|d|j_|d|j_|d|j_|d|j_dS)z@Initialize the C OGR Envelope structure from the given sequence.rrr*r+N)rrrrrr	)r'�seqrrrr Vs
zEnvelope._from_sequencecGs�t|�dkr�t|dt�r|�|dj�St|dd�r7t|dd�r7|�|dj|dj|dj|dj�St|dttf�r�t|d�dkra|�|dd|dd|dd|ddf�St|d�dkr�|d\}}}}||j	j
kr{||j	_
||j	jkr�||j	_||j	jkr�||j	_||j	j
kr�||j	_
d
Sd
Stdt|d���tdt|d���t|�dkr�|�|d|d|d|df�St|�dkr�|�|�Std	t|d���)z�
        Modify the envelope to expand to include the boundaries of
        the passed-in 2-tuple (a point), 4-tuple (an extent) or
        envelope.
        rr�x�yr*rrrrN)rrr�expand_to_includer�hasattrr2r3rrrrrr	rr!r")r'r(�minx�miny�maxx�maxyrrrr4^s4
(2�"
zEnvelope.expand_to_includecC�|jjS)z-Return the value of the minimum X coordinate.)rrr/rrrr#��zEnvelope.min_xcCr:)z-Return the value of the minimum Y coordinate.)rrr/rrrr%�r;zEnvelope.min_ycCr:)z-Return the value of the maximum X coordinate.)rrr/rrrr$�r;zEnvelope.max_xcCr:)z-Return the value of the maximum Y coordinate.)rr	r/rrrr&�r;zEnvelope.max_ycC�|j|jfS)z"Return the upper-right coordinate.)r$r&r/rrr�ur��zEnvelope.urcCr<)z!Return the lower-left coordinate.)r#r%r/rrr�ll�r>zEnvelope.llcCs|j|j|j|jfS)z)Return a tuple representing the envelope.)r#r%r$r&r/rrrr�szEnvelope.tuplecCs0d|j|j|j|j|j|j|j|j|j|jf
S)z4Return WKT representing a Polygon for this envelope.z(POLYGON((%s %s,%s %s,%s %s,%s %s,%s %s)))r#r%r&r$r/rrr�wkt�s��zEnvelope.wktN)r
rrr
r)r-r0r r4�propertyr#r%r$r&r=r?rr@rrrrrs.*






rN)r
�ctypesrr�django.contrib.gis.gdal.errorrrrrrrr�<module>s
	

https://t.me/RX1948 - 2025