File manager - Edit - /usr/local/CyberPanel/lib/python3.10/site-packages/django/contrib/gis/geos/__pycache__/polygon.cpython-310.pyc
Back
o �h6 � @ sD d dl mZ d dlmZ d dlmZ d dlmZ G dd� de�Z dS )� )� prototypes)�GEOSGeometry)�GEOM_PTR)� LinearRingc s� e Zd ZdZ� fdd�Zdd� Zdd� Zedd � �Zd d� Z dd � Z d!dd�Zdd� Zdd� Z dd� ZejZejZedd� �Zdd� Zdd� Zeee�ZeZedd� �ZeZedd � �Z� ZS )"�Polygon� c s� |st � j| �dd�fi |�� dS |^}}t|�}|dkrAt|d ttf�rA|d s0d}d}nt|d d t�rA|d }t|�}| �|d |g|��}t � j|fi |�� dS )a� Initialize on an exterior ring and a sequence of holes (both instances may be either LinearRing instances, or a tuple/list that may be constructed into a LinearRing). Examples of initialization, where shell, hole1, and hole2 are valid LinearRing geometries: >>> from django.contrib.gis.geos import LinearRing, Polygon >>> shell = hole1 = hole2 = LinearRing() >>> poly = Polygon(shell, hole1, hole2) >>> poly = Polygon(shell, (hole1, hole2)) >>> # Example where a tuple parameters are used: >>> poly = Polygon(((0, 0), (0, 10), (10, 10), (10, 0), (0, 0)), ... ((4, 4), (4, 6), (6, 6), (6, 4), (4, 4))) r Nr � )�super�__init__�_create_polygon�len� isinstance�tuple�listr )�self�args�kwargs�ext_ring� init_holes�n_holes�polygon�� __class__r �U/usr/local/CyberPanel/lib/python3.10/site-packages/django/contrib/gis/geos/polygon.pyr s zPolygon.__init__c c s"