+
    Tj6                     L    ^ RI Ht ^ RIHt ^ RIHt ^ RIHt  ! R R]4      t	R# )    )
prototypes)GEOSGeometry)GEOM_PTR)
LinearRingc                      a a ] tR t^t o^tV 3R ltR tR t]R 4       t	R t
R tRR ltR tR	 tR
 t]P"                  t]P&                  t]R 4       tR tR t]! ]]4      t]t]R 4       t]t]R 4       tRtVtV ;t # )Polygonc                  < V'       g$   \         SV `  ! V P                  ^ R4      3/ VB  R# Vvr4\        V4      pV^8X  dp   \	        V^ ,          \
        \        34      '       dM   V^ ,          '       g   Rp^ pM8\	        V^ ,          ^ ,          \        4      '       d   V^ ,          p\        V4      pV P                  V^,           V.VO4      p\         SV `  ! V3/ VB  R# )ak  
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)))
N )super__init___create_polygonlen
isinstancetuplelistr   )selfargskwargsext_ring
init_holesn_holespolygon	__class__s   &*,    T/var/www/idalgo/venv/lib/python3.14/site-packages/django/contrib/gis/geos/polygon.pyr   Polygon.__init__
   s    " GT11!T:EfE !%j/ a<Jz!}udmDDa==
JqM!,j99']
j/&&w{X4K
4KL+F+    c              #  X   "   \        \        V 4      4       F  pW,          x  K  	  R# 5i)z&Iterate over each ring in the polygon.N)ranger   )r   is   & r   __iter__Polygon.__iter__0   s     s4y!A'M "s   (*c                (    V P                   ^,           # )z+Return the number of rings in this Polygon.)num_interior_ringsr   s   &r   __len__Polygon.__len__5   s    &&**r   c                    Vw  r#rEV FU  p\        V\        \        34      '       d   K!  \        RV: RV: RV: RV: RV: RV: RV: RV: RV: RV: R24      u # 	  \	        W#3W%3WE3WC3W#334      # )z2Construct a Polygon from a bounding box (4-tuple).z	POLYGON(( z, z)))r   floatintr   r   )clsbboxx0y0x1y1zs   &&     r   	from_bboxPolygon.from_bbox9   sq     Aa%..#2r2r2r2r2?   2(RHrhIJJr   c                   V'       g   \         P                  ! 4       # . pV FL  p\        V\        4      '       d   VP	                  V4       K,  VP	                  V P                  V4      4       KN  	  V P                  VP                  ^ 4      4      pV^,
          pV'       d1   \        V,          ! V Uu. uF  q@P                  V4      NK  	  up!  pMRp\         P                  ! WWV4      # u upi )r   N)	capicreate_empty_polygonr   r   append_construct_ring_clonepopcreate_polygon)r   lengthitemsringsrshellr   holes_params   &&&     r   r   Polygon._create_polygonF   s    
 ,,..A!X&&QT11!45	  EIIaL)1*#g-0OAQ0OPKK""5w??	 1Ps   4C,c                    \        V\        4      '       d   \        P                  ! V4      # \        P                  ! VP                  4      # N)r   r   r5   
geom_cloneptr)r   gs   &&r   r9   Polygon._clone_   s1    a""??1%%??155))r   c                ~    \        V\        4      '       d   V#  \        V4      #   \         d    \        T4      hi ; i)z1Try to construct a ring from the given parameter.)r   r   	TypeError)r   parammsgs   &&&r   r8   Polygon._construct_ringe   s?     eZ((L	!e$$ 	!C. 	!s   
% <c                    V P                   pV P                  pV P                  W4      V n         V'       d   W@n        \        P                  ! V4       R # rD   )rF   sridr   r5   destroy_geom)r   r<   r=   prev_ptrrO   s   &&&  r   	_set_listPolygon._set_listu   s>     88yy''6I(#r   c                    V^ 8X  d!   \         P                  ! V P                  4      # \         P                  ! V P                  V^,
          4      # )a  
Return 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!
Return 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.
)r5   get_extringrF   get_intringr   indexs   &&r   _get_single_internalPolygon._get_single_internal   s=     A:##DHH-- ##DHHeai88r   c                v    \        \        P                  ! V P                  V4      4      V P                  R 7      # ))rO   )r   r5   rE   rY   rO   rW   s   &&r   _get_single_externalPolygon._get_single_external   s,    OOD55e<=DII
 	
r   c                B    \         P                  ! V P                  4      # )z$Return the number of interior rings.)r5   
get_nringsrF   r$   s   &r   r#   Polygon.num_interior_rings   s     txx((r   c                    V ^ ,          # )z%Get the exterior ring of the Polygon.r
   r$   s   &r   _get_ext_ringPolygon._get_ext_ring   s    Awr   c                    W^ &   R# )z%Set the exterior ring of the Polygon.Nr
   )r   rings   &&r   _set_ext_ringPolygon._set_ext_ring   s	    Qr   c                   a  \         ;QJ d)    . V 3R l\        \        S 4      4       4       F  NK  	  5# ! V 3R l\        \        S 4      4       4       4      # )z,Get the tuple for each ring in this Polygon.c              3   J   <"   T F  pSV,          P                   x  K  	  R # 5irD   )r   .0r   r   s   & r   	<genexpr> Polygon.tuple.<locals>.<genexpr>   s     =,<qT!W]],<s    #)r   r   r   r$   s   fr   r   Polygon.tuple   s9     u=E#d),<=u=u=E#d),<===r   c                   a  RP                  V 3R l\        S P                  4       4       4      pRS ^ ,          P                  : RV: R2# )z.Return the KML representation of this Polygon. c              3   f   <"   T F&  pR SV^,           ,          P                   ,          x  K(  	  R# 5i)z%<innerBoundaryIs>%s</innerBoundaryIs>N)kmlrj   s   & r   rl   Polygon.kml.<locals>.<genexpr>   s,      
3 4d1q5kooEE3s   .1z<Polygon><outerBoundaryIs>z</outerBoundaryIs>z
</Polygon>)joinr   r#   rr   )r   	inner_kmls   f r   rr   Polygon.kml   sE     GG 
4223
 
	
 GKK
 	
r   )rF   rO   )zZParameter must be a sequence of LinearRings or objects that can initialize to LinearRings.)!__name__
__module____qualname____firstlineno__
_minlengthr   r    r%   classmethodr2   r   r9   r8   rR   rY   r\   r   _set_single_rebuild_set_single_assign_extended_slice_rebuild_assign_extended_slicepropertyr#   rb   rf   exterior_ringr@   r   coordsrr   __static_attributes____classdictcell____classcell__)r   __classdict__s   @@r   r   r      s     J$,L
+ 	K 	K@2*! $9$

 22K)HH ) )

 ]M:ME> > F	
 	
 	
r   r   N)
django.contrib.gis.geosr   r5    django.contrib.gis.geos.geometryr   django.contrib.gis.geos.libgeosr   "django.contrib.gis.geos.linestringr   r   r
   r   r   <module>r      s    6 9 4 9v
l v
r   