OwlCyberSecurity - MANAGER
Edit File: envelope.cpython-39.pyc
a ���e� � @ sB d Z ddlmZmZ ddlmZ G dd� de�ZG dd� 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, e Zd ZdZdefdefdefdefgZdS )�OGREnvelopez&Represent the OGREnvelope C Structure.�MinX�MaxX�MinY�MaxYN)�__name__� __module__�__qualname__�__doc__r Z_fields_� r r �a/home/gouroczh/virtualenv/pat/3.9/lib/python3.9/site-packages/django/contrib/gis/gdal/envelope.pyr s �r c @ s� e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Ze dd � �Z e dd� �Ze dd� �Ze 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. c G s� t |�dkr�t|d t�r&|d | _q�t|d ttf�rnt |d �dkr^tdt |d � ��q�| �|d � q�tdt |d � ��n2t |�dkr�| �dd� |D �� ntdt |� ��| j | jkr�td ��| j| j kr�td ��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: %sc S s g | ]}t |��qS r )�float)�.0�ar r r � <listcomp>= � z%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�argsr r r �__init__&