
    he                         S r SSKJr  SSKJrJr  SSKJr  SSK	J
r
Jr  SSKJr  SSKJr   " S S	\5      r " S
 S\5      r " S S\\5      r " S S\5      r\\\
\\\\4\l        g)zw
This module houses the Geometry Collection objects:
GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon
    )
prototypes)GEOSGeometryLinearGeometryMixin)GEOM_PTR)
LinearRing
LineString)Point)Polygonc                      ^  \ rS rSrSrU 4S jrS rS rS rS r	S r
S	 r\R                  r\R                  r\S
 5       r\S 5       r\rSrU =r$ )GeometryCollection      c                    > [        U5      S:X  a'  [        US   [        [        45      (       a  US   nOUnOUnU R	                  U5        U R                  [        U5      U5      n[        TU ]  " U40 UD6  g)zEInitialize a Geometry Collection from a sequence of Geometry objects.   r   N)len
isinstancetuplelist_check_allowed_create_collectionsuper__init__)selfargskwargs
init_geoms
collection	__class__s        U/var/www/html/env/lib/python3.13/site-packages/django/contrib/gis/geos/collections.pyr   GeometryCollection.__init__   st     t9> $q'E4=11!!W
!
J 	J' ,,S_jI
.v.    c              #   N   #    [        [        U 5      5       H	  nX   v   M     g7f)z-Iterate over each Geometry in the Collection.N)ranger   )r   is     r   __iter__GeometryCollection.__iter__&   s     s4y!A'M "s   #%c                     U R                   $ )z3Return the number of geometries in this Collection.)num_geomr   s    r   __len__GeometryCollection.__len__+   s    }}r!   c                     [         U-  " U Vs/ s H$  n[        R                  " [        USU5      5      PM&     sn6 n[        R                  " U R
                  XA5      $ s  snf )Nptr)r   capi
geom_clonegetattrcreate_collection_typeid)r   lengthitemsggeomss        r   r   %GeometryCollection._create_collection0   s`    F"
 	 A 5! 45	
 %%dllEBBs   +Ac                 D    [         R                  " U R                  U5      $ N)r.   	get_geomnr-   r   indexs     r   _get_single_internal'GeometryCollection._get_single_internal<   s    ~~dhh..r!   c                 p    [        [        R                  " U R                  U5      5      U R                  S9$ )zFReturn the Geometry from this Collection at the given index (0-based).)srid)r   r.   r/   r=   r@   r;   s     r   _get_single_external'GeometryCollection._get_single_external?   s.     OOD55e<=DII
 	
r!   c                     U R                   nU R                  nU R                  X5      U l         U(       a  X@l        [        R                  " U5        g)zJCreate a new collection, and destroy the contents of the previous pointer.N)r-   r@   r   r.   destroy_geom)r   r3   r4   prev_ptrr@   s        r   	_set_listGeometryCollection._set_listF   s<    88yy**69I(#r!   c                 8    SSR                  S U  5       5      -  $ )z,Return the KML for this Geometry Collection.z!<MultiGeometry>%s</MultiGeometry> c              3   8   #    U  H  oR                   v   M     g 7fr9   )kml.0r5   s     r   	<genexpr>)GeometryCollection.kml.<locals>.<genexpr>U   s     <QDqUUD   )joinr)   s    r   rK   GeometryCollection.kmlR   s     3RWW<QD<Q5QQQr!   c                 &    [        S U  5       5      $ )zAReturn a tuple of all the coordinates in this Geometry Collectionc              3   8   #    U  H  oR                   v   M     g 7fr9   r   rL   s     r   rN   +GeometryCollection.tuple.<locals>.<genexpr>Z   s     +dWWdrP   rU   r)   s    r   r   GeometryCollection.tupleW   s     +d+++r!   )r-   r@   )__name__
__module____qualname____firstlineno__r2   r   r%   r*   r   r=   rA   rF   r   _set_single_rebuild_set_single_assign_extended_slice_rebuild_assign_extended_slicepropertyrK   r   coords__static_attributes____classcell__)r   s   @r   r   r      st    G/*


C/
$ 22K)HHR R , , Fr!   r   c                       \ rS rSr\rSrSrg)
MultiPoint`       N)rX   rY   rZ   r[   r	   _allowedr2   rb   rh   r!   r   re   re   `   s    HGr!   re   c                        \ rS rSr\\4rSrSrg)MultiLineStringe      rh   N)	rX   rY   rZ   r[   r   r   ri   r2   rb   rh   r!   r   rk   rk   e   s    J'HGr!   rk   c                       \ rS rSr\rSrSrg)MultiPolygonj      rh   N)rX   rY   rZ   r[   r
   ri   r2   rb   rh   r!   r   ro   ro   j   s    HGr!   ro   N)__doc__django.contrib.gis.geosr   r.    django.contrib.gis.geos.geometryr   r   django.contrib.gis.geos.libgeosr   "django.contrib.gis.geos.linestringr   r   django.contrib.gis.geos.pointr	   django.contrib.gis.geos.polygonr
   r   re   rk   ro   ri   rh   r!   r   <module>ry      sy   
 7 N 4 E / 3N Nd# 
)+= 
%  
  r!   