a
    ßÁd?  ã                   @   s<   d Z ddlZddlmZmZ G dd„ deƒZeejjd< dS )z%Multi-part collections of geometries
é    N)ÚBaseGeometryÚBaseMultipartGeometryc                   @   s*   e Zd ZdZg Zddd„Zedd„ ƒZdS )ÚGeometryCollectionaN  
    A collection of one or more geometries that may contain more than one type
    of geometry.

    Parameters
    ----------
    geoms : list
        A list of shapely geometry instances, which may be of varying
        geometry types.

    Attributes
    ----------
    geoms : sequence
        A sequence of Shapely geometry instances

    Examples
    --------
    Create a GeometryCollection with a Point and a LineString

    >>> from shapely import LineString, Point
    >>> p = Point(51, -1)
    >>> l = LineString([(52, -1), (49, 2)])
    >>> gc = GeometryCollection([p, l])
    Nc                 C   s:   |st  d¡S t|tƒr0t|dƒr*|j}n|g}t  |¡S )NzGEOMETRYCOLLECTION EMPTYÚgeoms)ÚshapelyZfrom_wktÚ
isinstancer   Úhasattrr   Zgeometrycollections)Úselfr   © r
   ú^/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/shapely/geometry/collection.pyÚ__new__$   s    


zGeometryCollection.__new__c                 C   s(   g }| j D ]}| |j¡ q
td|d�S )Nr   )ÚtypeÚ
geometries)r   ÚappendÚ__geo_interface__Údict)r	   r   Zgeomr
   r
   r   r   2   s    
z$GeometryCollection.__geo_interface__)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   Úpropertyr   r
   r
   r
   r   r      s
   
r   é   )r   r   Zshapely.geometry.baser   r   r   ÚlibÚregistryr
   r
   r
   r   Ú<module>   s   2