o
    Jf
                     @   sV   d Z ddlZddlmZ ddlmZ ddlmZ dgZG dd deZ	e	ej
jd< dS )	z1Collections of linestrings and related utilities
    N)EmptyPartError)
linestring)BaseMultipartGeometryMultiLineStringc                   @   s4   e Zd ZdZg Zd
ddZedd Zddd	ZdS )r   a   
    A collection of one or more LineStrings.

    A MultiLineString has non-zero length and zero area.

    Parameters
    ----------
    lines : sequence
        A sequence LineStrings, or a sequence of line-like coordinate
        sequences or array-likes (see accepted input for LineString).

    Attributes
    ----------
    geoms : sequence
        A sequence of LineStrings

    Examples
    --------
    Construct a MultiLineString containing two LineStrings.

    >>> lines = MultiLineString([[[0, 0], [1, 2]], [[4, 4], [5, 6]]])
    Nc                 C   s   |st dS t|tr|S t|d|}t|}g }t|D ]}t|| }|j	r.t
d|| qt|dkr?t dS t |S )NzMULTILINESTRING EMPTYgeomsz1Can't create MultiLineString with empty componentr   )shapelyfrom_wkt
isinstancer   getattrlenranger   
LineStringis_emptyr   appendmultilinestrings)selflinesmsubsiline r   l/home/deployuser/azure_apps/autowriter/venv/lib/python3.10/site-packages/shapely/geometry/multilinestring.py__new__&   s"   



zMultiLineString.__new__c                 C   s   dt dd | jD dS )Nr   c                 s   s$    | ]}t d d |jD V  qdS )c                 s   s    | ]}|V  qd S Nr   ).0cr   r   r   	<genexpr>B   s    z>MultiLineString.__geo_interface__.<locals>.<genexpr>.<genexpr>N)tuplecoords)r   gr   r   r   r   B   s   " z4MultiLineString.__geo_interface__.<locals>.<genexpr>)typecoordinates)r   r   )r   r   r   r   __geo_interface__>   s   z!MultiLineString.__geo_interface__      ?c                    sF   | j rdS du r| jrdnddd fdd| jD  d	 S )
a  Returns a group of SVG polyline elements for the LineString geometry.

        Parameters
        ==========
        scale_factor : float
            Multiplication factor for the SVG stroke-width.  Default is 1.
        stroke_color : str, optional
            Hex string for stroke color. Default is to use "#66cc99" if
            geometry is valid, and "#ff3333" if invalid.
        opacity : float
            Float number between 0 and 1 for color opacity. Default value is 0.8
        z<g />Nz#66cc99z#ff3333z<g> c                 3   s    | ]
}|  V  qd S r   )svg)r   popacityscale_factorstroke_colorr   r   r   X   s    z&MultiLineString.svg.<locals>.<genexpr>z</g>)r   is_validjoinr   )r   r*   r+   r)   r   r(   r   r&   E   s   zMultiLineString.svgr   )r$   NN)	__name__
__module____qualname____doc__	__slots__r   propertyr#   r&   r   r   r   r   r      s    

   )r1   r   shapely.errorsr   shapely.geometryr   shapely.geometry.baser   __all__r   libregistryr   r   r   r   <module>   s    Q