https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /usr/lib64/python2.7/site-packages/django/contrib/gis/geos/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.7/site-packages/django/contrib/gis/geos/polygon.pyc
�
r�\c@s�ddlmZmZddlmZddlmZmZddlm	Z	ddl
mZddl
mZddlmZdefd	��YZd
S(i����(tc_uinttbyref(tGEOSGeometry(tget_pointer_arrtGEOM_PTR(t
LinearRing(t
prototypes(tsix(txrangetPolygoncBs�eZdZd�Zd�Zd�Zed��Zd�Zd�Z	dd�Z
d	�Zd
�Zd�Z
ejZejZed��Zd
�Zd�Zeee�ZeZed��ZeZed��ZRS(icOs�|std��n|d}|d}t|�}|dkr�t|dttf�r�t|d�dkrd}d}q�t|ddt�r�|d}t|�}q�n|j|d|f|�}tt|�j	||�dS(sY
        Initializes 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:
        >>> 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), (0, 10), (0, 0)),
                           ((4, 4), (4, 6), (6, 6), (6, 4), (4, 4)))
        sJMust provide at least one LinearRing, or a tuple, to initialize a Polygon.iiN((
t	TypeErrortlent
isinstancettupletlistRt_create_polygontsuperR	t__init__(tselftargstkwargstext_ringt
init_holestn_holestpolygon((sA/tmp/pip-install-XxeQeY/django/django/contrib/gis/geos/polygon.pyRs

%	
ccs*x#tt|��D]}||VqWdS(s'Iterates over each ring in the polygon.N(RR(Rti((sA/tmp/pip-install-XxeQeY/django/django/contrib/gis/geos/polygon.pyt__iter__/scCs|jdS(s,Returns the number of rings in this Polygon.i(tnum_interior_rings(R((sA/tmp/pip-install-XxeQeY/django/django/contrib/gis/geos/polygon.pyt__len__4sc
Cs�|\}}}}xS|D]K}t|tjtf�std||||||||||f
�SqWt||f||f||f||f||ff�S(s3Constructs a Polygon from a bounding box (4-tuple).s,POLYGON((%s %s, %s %s, %s %s, %s %s, %s %s))(RRt
integer_typestfloatRR	(tclstbboxtx0ty0tx1ty1tz((sA/tmp/pip-install-XxeQeY/django/django/contrib/gis/geos/polygon.pyt	from_bbox8s
*c
Cs�g}xC|D];}t|t�r2|j|�q
|j|j|��q
W|j|jd��}|d}|r�t|�}xBt|�D]+\}}|j|�||<t|�}	q�Wnd}	t
j||	t|��S(Nii(
RRtappendt_construct_ringt_clonetpopRt	enumerateRtNonetcapitcreate_polygonR(
RtlengthtitemstringstrtshellRtholesRtholes_param((sA/tmp/pip-install-XxeQeY/django/django/contrib/gis/geos/polygon.pyRCs

cCs0t|t�rtj|�Stj|j�SdS(N(RRR-t
geom_clonetptr(Rtg((sA/tmp/pip-install-XxeQeY/django/django/contrib/gis/geos/polygon.pyR)\s
sYParameter must be a sequence of LinearRings or objects that can initialize to LinearRingscCsKt|t�r|Syt|�}|SWntk
rFt|��nXdS(sGHelper routine for trying to construct a ring from the given parameter.N(RRR
(Rtparamtmsgtring((sA/tmp/pip-install-XxeQeY/django/django/contrib/gis/geos/polygon.pyR(bs
cCsJ|j}|j}|j||�|_|r9||_ntj|�dS(N(R7tsridRR-tdestroy_geom(RR/R0tprev_ptrR<((sA/tmp/pip-install-XxeQeY/django/django/contrib/gis/geos/polygon.pyt	_set_listks		cCs7|dkrtj|j�Stj|j|d�SdS(sN
        Returns the ring at the specified index.  The first index, 0, will
        always return the exterior ring.  Indices > 0 will return the
        interior ring at the given index (e.g., poly[1] and poly[2] would
        return the first and second interior ring, respectively).

        CAREFUL: Internal/External are not the same as Interior/Exterior!
        _get_single_internal returns a pointer from the existing geometries for use
        internally by the object's methods.  _get_single_external returns a clone
        of the same geometry for use by external code.
        iiN(R-tget_extringR7tget_intring(Rtindex((sA/tmp/pip-install-XxeQeY/django/django/contrib/gis/geos/polygon.pyt_get_single_internaltscCs%ttj|j|��d|j�S(NR<(RR-R6RCR<(RRB((sA/tmp/pip-install-XxeQeY/django/django/contrib/gis/geos/polygon.pyt_get_single_external�scCstj|j�S(s%Returns the number of interior rings.(R-t
get_nringsR7(R((sA/tmp/pip-install-XxeQeY/django/django/contrib/gis/geos/polygon.pyR�scCs|dS(s&Gets the exterior ring of the Polygon.i((R((sA/tmp/pip-install-XxeQeY/django/django/contrib/gis/geos/polygon.pyt
_get_ext_ring�scCs||d<dS(s&Sets the exterior ring of the Polygon.iN((RR;((sA/tmp/pip-install-XxeQeY/django/django/contrib/gis/geos/polygon.pyt
_set_ext_ring�scCs0tgtt|��D]}||j^q�S(s-Gets the tuple for each ring in this Polygon.(R
RR(RR((sA/tmp/pip-install-XxeQeY/django/django/contrib/gis/geos/polygon.pyR
�scCsOdjgt|j�D]}d||dj^q�}d|dj|fS(s/Returns the KML representation of this Polygon.ts%<innerBoundaryIs>%s</innerBoundaryIs>is:<Polygon><outerBoundaryIs>%s</outerBoundaryIs>%s</Polygon>i(tjoinRRtkml(RRt	inner_kml((sA/tmp/pip-install-XxeQeY/django/django/contrib/gis/geos/polygon.pyRJ�s	1(t__name__t
__module__t
_minlengthRRRtclassmethodR&RR)R(R?RCRDRt_set_single_rebuildt_set_singlet_assign_extended_slice_rebuildt_assign_extended_slicetpropertyRRFRGt
exterior_ringR3R
tcoordsRJ(((sA/tmp/pip-install-XxeQeY/django/django/contrib/gis/geos/polygon.pyR		s*	#													N(tctypesRRt django.contrib.gis.geos.geometryRtdjango.contrib.gis.geos.libgeosRRt"django.contrib.gis.geos.linestringRtdjango.contrib.gis.geosRR-tdjango.utilsRtdjango.utils.six.movesRR	(((sA/tmp/pip-install-XxeQeY/django/django/contrib/gis/geos/polygon.pyt<module>s

https://t.me/AnonymousX5 - 2025