a
    ŠJ5dì
  ã                   @   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   )ÚshapelyZfrom_wktÚ
isinstancer   ÚgetattrÚlenÚranger   Z
LineStringÚis_emptyr   ÚappendZmultilinestrings)ÚselfÚlinesÚmÚsubsÚiÚline© r   ú\/var/www/html/django/DPS/env/lib/python3.9/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   ó    z>MultiLineString.__geo_interface__.<locals>.<genexpr>.<genexpr>N)ÚtupleZcoords)r   Úgr   r   r   r   B   r   z4MultiLineString.__geo_interface__.<locals>.<genexpr>)ÚtypeZ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   r   z&MultiLineString.svg.<locals>.<genexpr>z</g>)r   Zis_validÚjoinr   )r   r&   r'   r%   r   r$   r   r"   E   s    ÿþÿzMultiLineString.svg)N)r    NN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   Úpropertyr   r"   r   r   r   r   r      s   

é   )r,   r   Zshapely.errorsr   Zshapely.geometryr   Zshapely.geometry.baser   Ú__all__r   ÚlibÚregistryr   r   r   r   Ú<module>   s   Q