Ë
    ~ìqj²  ã                   óN   — d Z ddlZddlZd„ Zd„ Zd„ Z	 	 	 	 	 	 d	d„Zd
d„Zdd„Z	y)z£Plot single geometries using Matplotlib.

Note: this module is experimental, and mainly targeting (interactive)
exploration, debugging and illustration purposes.

é    Nc                  óv   — dd l m}  | j                  «       }|j                  d«       |j	                  d«       |S )Nr   TÚequal)Úmatplotlib.pyplotÚpyplotÚgcaÚgridÚ
set_aspect)ÚpltÚaxs     úL/var/www/html/truck-me/venv/lib/python3.12/site-packages/shapely/plotting.pyÚ_default_axr      s,   € Ý#à	�‰‹€BØ‡G�GˆD„MØ‡M�M�'ÔØ€Ió    c                 óì  — ddl m} ddlm} t	        | t
        j                  «      r0 |j                  | j                  D �cg c]  }t        |«      ‘Œ c}Ž S  || «      }  |j                   |t        j                  | j                  j                  «      d d …d d…f   «      g| j                  D �cg c]0  } |t        j                  |j                  «      d d …d d…f   «      ‘Œ2 c}¢­Ž S c c}w c c}w )Nr   ©ÚPath)Úorienté   )Úmatplotlib.pathr   Úshapely.opsr   Ú
isinstanceÚshapelyÚMultiPolygonÚmake_compound_pathÚgeomsÚ_path_from_polygonÚnpÚasarrayÚexteriorÚcoordsÚ	interiors)Úpolygonr   r   ÚpolyÚrings        r   r   r      sÓ   € Ý$å"ä�'œ7×/Ñ/Ô0Ø&ˆt×&Ñ&Ø3:·=±=ÖA¨4Ô  Õ&ÒAð
ð 	
ñ ˜“/ˆØ&ˆt×&Ñ&Ù”—‘˜G×,Ñ,×3Ñ3Ó4²Q¸¸¸°UÑ;Ó<ð
à?F×?PÑ?PÖQ°t‰d”2—:‘:˜dŸk™kÓ*ª1¨b¨q¨b¨5Ñ1Õ2ÒQò
ð 	
ùò	 Bùò Rs   ÁC,Â15C1
c                 ó2   — ddl m}  |t        | «      fi |¤ŽS )aÎ  Get a Matplotlib patch from a (Multi)Polygon.

    Note: this function is experimental, and mainly targeting (interactive)
    exploration, debugging and illustration purposes.

    Parameters
    ----------
    polygon : shapely.Polygon or shapely.MultiPolygon
        The polygon to convert to a Matplotlib Patch.
    **kwargs
        Additional keyword arguments passed to the matplotlib Patch.

    Returns
    -------
    Matplotlib artist (PathPatch)

    r   ©Ú	PathPatch)Úmatplotlib.patchesr&   r   )r!   Úkwargsr&   s      r   Úpatch_from_polygonr)   '   s   € õ$ -áÔ'¨Ó0Ñ;°FÑ;Ð;r   c                 ó   — ddl m} |€
t        «       }|€d}|j                  |«      }|€t	        |«      }d|d<   t        |«      }|€|}t        | f|||dœ|¤Ž}	|j                  |	«       |j                  «        |rt        | ||¬«      }
|	|
fS |	S )aÿ  Plot a (Multi)Polygon.

    Note: this function is experimental, and mainly targeting (interactive)
    exploration, debugging and illustration purposes.

    Parameters
    ----------
    polygon : shapely.Polygon or shapely.MultiPolygon
        The polygon to plot.
    ax : matplotlib Axes, default None
        The axes on which to draw the plot. If not specified, will get the
        current active axes or create a new figure.
    add_points : bool, default True
        If True, also plot the coordinates (vertices) as points.
    color : matplotlib color specification
        Color for both the polygon fill (face) and boundary (edge). By default,
        the fill is using an alpha of 0.3. You can specify `facecolor` and
        `edgecolor` separately for greater control.
    facecolor : matplotlib color specification
        Color for the polygon fill.
    edgecolor : matplotlib color specification
        Color for the polygon boundary.
    linewidth : float
        The line width for the polygon boundary.
    **kwargs
        Additional keyword arguments passed to the matplotlib Patch.

    Returns
    -------
    Matplotlib artist (PathPatch), if `add_points` is false.
    A tuple of Matplotlib artists (PathPatch, Line2D), if `add_points` is true.

    r   )ÚcolorsÚC0g333333Ó?éÿÿÿÿ©Ú	facecolorÚ	edgecolorÚ	linewidth©r   Úcolor)
Ú
matplotlibr+   r   Úto_rgbaÚlistÚtupler)   Ú	add_patchÚautoscale_viewÚplot_points)r!   r   Ú
add_pointsr3   r/   r0   r1   r(   r+   ÚpatchÚlines              r   Úplot_polygonr>   >   s´   € õV "à	€zÜ‹]ˆà€}ØˆØ�N‰N˜5Ó!€EàÐÜ˜“Kˆ	Øˆ	�"‰Ü˜)Ó$ˆ	àÐØˆ	äØðØ$°	ÀYñØRXñ€Eð ‡L�L�ÔØ×ÑÔáÜ˜7 r°Ô7ˆØ�dˆ{Ðà€Lr   c                 ó  — ddl m} ddlm} |€
t	        «       }|€d}t        | t        j                  «      rT |j                  | j                  D �cg c]0  } |t        j                  |j                  «      dd…dd…f   «      ‘Œ2 c}Ž }	n. |t        j                  | j                  «      dd…dd…f   «      }	 ||	fd||dœ|¤Ž}
|j                  |
«       |j                  «        |rt        | ||¬	«      } |
| fS |
S c c}w )
aq  Plot a (Multi)LineString/LinearRing.

    Note: this function is experimental, and mainly targeting (interactive)
    exploration, debugging and illustration purposes.

    Parameters
    ----------
    line : shapely.LineString or shapely.LinearRing
        The line to plot.
    ax : matplotlib Axes, default None
        The axes on which to draw the plot. If not specified, will get the
        current active axes or create a new figure.
    add_points : bool, default True
        If True, also plot the coordinates (vertices) as points.
    color : matplotlib color specification
        Color for the line (edgecolor under the hood) and points.
    linewidth : float, default 2
        The line width for the polygon boundary.
    **kwargs
        Additional keyword arguments passed to the matplotlib Patch.

    Returns
    -------
    Matplotlib artist (PathPatch)

    r   r%   r   Nr,   r   Únoner.   r2   )r'   r&   r   r   r   r   r   ÚMultiLineStringr   r   r   r   r   r8   r9   r:   )r=   r   r;   r3   r1   r(   r&   r   ÚmlineÚpathr<   s              r   Ú	plot_linerD   ‡   sú   € õ6 -Ý$à	€zÜ‹]ˆà€}Øˆä�$œ×/Ñ/Ô0Ø&ˆt×&Ñ&ØAEÇÁÖL¸‰d”2—:‘:˜eŸl™lÓ+ªA¨r°¨r¨EÑ2Õ3ÒLð
‰ñ ”B—J‘J˜tŸ{™{Ó+ªA¨r°¨r¨EÑ2Ó3ˆáØðØ¨%¸9ñØHNñ€Eð ‡L�L�ÔØ×ÑÔáÜ˜4 B¨eÔ4ˆØ�dˆ{Ðà€Lùò Ms   Á5C=c                 ó˜   — |€
t        «       }t        j                  | «      } |j                  |dd…df   |dd…df   fd||dœ|¤Ž\  }|S )a  Plot a Point/MultiPoint or the vertices of any other geometry type.

    Parameters
    ----------
    geom : shapely.Geometry
        Any shapely Geometry object, from which all vertices are extracted
        and plotted.
    ax : matplotlib Axes, default None
        The axes on which to draw the plot. If not specified, will get the
        current active axes or create a new figure.
    color : matplotlib color specification
        Color for the filled points. You can use `markeredgecolor` and
        `markerfacecolor` to have different edge and fill colors.
    marker : str, default "o"
        The matplotlib marker for the points.
    **kwargs
        Additional keyword arguments passed to matplotlib `plot` (Line2D).

    Returns
    -------
    Matplotlib artist (Line2D)

    Nr   é   Ú )Ú	linestyleÚmarkerr3   )r   r   Úget_coordinatesÚplot)Úgeomr   r3   rI   r(   r   r=   s          r   r:   r:   ¿   sb   € ð0 
€zÜ‹]ˆä×$Ñ$ TÓ*€FØˆb�g‰gØŠq�!ˆt‰�fšQ ˜T‘lðØ.0¸ÀuñØPVñ�G€Tð €Kr   )NTNNNN)NTNr   )NNÚo)
Ú__doc__Únumpyr   r   r   r   r)   r>   rD   r:   © r   r   ú<module>rQ      sG   ðñó ã òò
ò"<ð2 ØØ
ØØØóFóR5ôpr   