§
    eÎj²  ã                   óP   — 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	dS )z£Plot single geometries using Matplotlib.

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

é    Nc                  óŽ   — dd l m}  |                      ¦   «         }|                     d¦  «         |                     d¦  «         |S )Nr   TÚequal)Úmatplotlib.pyplotÚpyplotÚgcaÚgridÚ
set_aspect)ÚpltÚaxs     ú`/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/shapely/plotting.pyÚ_default_axr      sG   € Ø#Ð#Ð#Ð#Ð#Ð#à	�Š‰Œ€BØ‡G‚GˆD�M„M€MØ‡M‚M�'ÑÔÐØ€Ió    c                 ó8  ‡— ddl mŠ ddlm} t	          | t
          j        ¦  «        r ‰j        d„ | j        D ¦   «         Ž S  || ¦  «        }  ‰j         ‰t          j
        | j        j        ¦  «        d d …d d…f         ¦  «        gˆfd„| j        D ¦   «         ¢R Ž S )Nr   ©ÚPath)Úorientc                 ó,   — g | ]}t          |¦  «        ‘ŒS © )Ú_path_from_polygon)Ú.0Úpolys     r   ú
<listcomp>z&_path_from_polygon.<locals>.<listcomp>   s!   € ÐAÐAÐA¨4Õ  Ñ&Ô&ÐAÐAÐAr   é   c                 ól   •— g | ]0} ‰t          j        |j        ¦  «        d d …d d…f         ¦  «        ‘Œ1S ©Nr   ©ÚnpÚasarrayÚcoords)r   Úringr   s     €r   r   z&_path_from_polygon.<locals>.<listcomp>#   s@   ø€ ÐQÐQÐQ°tˆdˆd•2”:˜dœkÑ*Ô*¨1¨1¨1¨b¨q¨b¨5Ô1Ñ2Ô2ÐQÐQÐQr   )Úmatplotlib.pathr   Úshapely.opsr   Ú
isinstanceÚshapelyÚMultiPolygonÚmake_compound_pathÚgeomsr   r   Úexteriorr   Ú	interiors)Úpolygonr   r   s     @r   r   r      sÙ   ø€ Ø$Ð$Ð$Ð$Ð$Ð$à"Ð"Ð"Ð"Ð"Ð"å�'�7Ô/Ñ0Ô0ð 	
Ø&ˆtÔ&ØAÐA°7´=ÐAÑAÔAð
ð 	
ð �&˜‘/”/ˆØ&ˆtÔ&ØˆD•”˜GÔ,Ô3Ñ4Ô4°Q°Q°Q¸¸¸°UÔ;Ñ<Ô<ð
àQÐQÐQÐQ¸wÔ?PÐQÑQÔQð
ð 
ð 
ð 	
r   c                 ó:   — 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_polygonr0   '   s7   € ð$ -Ð,Ð,Ð,Ð,Ð,àˆ9Õ'¨Ñ0Ô0Ð;Ð;°FÐ;Ð;Ð;r   Tc                 óZ  — ddl m} |€t          ¦   «         }|€d}|                     |¦  «        }|€#t	          |¦  «        }d|d<   t          |¦  «        }|€|}t          | f|||dœ|¤Ž}	|                     |	¦  «         |                     ¦   «          |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   )ÚcolorsNÚC0g333333Ó?éÿÿÿÿ©Ú	facecolorÚ	edgecolorÚ	linewidth©r   Úcolor)
Ú
matplotlibr2   r   Úto_rgbaÚlistÚtupler0   Ú	add_patchÚautoscale_viewÚplot_points)r*   r   Ú
add_pointsr:   r6   r7   r8   r/   r2   ÚpatchÚlines              r   Úplot_polygonrE   >   sî   € ðV "Ð!Ð!Ð!Ð!Ð!à	€zÝ‰]Œ]ˆà€}ØˆØ�NŠN˜5Ñ!Ô!€EàÐÝ˜‘K”Kˆ	Øˆ	�"‰Ý˜)Ñ$Ô$ˆ	àÐØˆ	åØðØ$°	ÀYðð ØRXðð €Eð ‡L‚L�ÑÔÐØ×ÒÑÔÐàð Ý˜7 r°Ð7Ñ7Ô7ˆØ�dˆ{Ðà€Lr   r   c                 ó¬  ‡	— ddl m} ddlmŠ	 |€t	          ¦   «         }|€d}t          | t          j        ¦  «        r ‰	j        ˆ	fd„| j	        D ¦   «         Ž }n. ‰	t          j        | j        ¦  «        dd…dd…f         ¦  «        } ||fd||d	œ|¤Ž}|                     |¦  «         |                     ¦   «          |rt          | ||¬
¦  «        } || fS |S )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   Nr3   c                 ól   •— g | ]0} ‰t          j        |j        ¦  «        d d …d d…f         ¦  «        ‘Œ1S r   r   )r   Úmliner   s     €r   r   zplot_line.<locals>.<listcomp>­   s@   ø€ ÐLÐLÐL¸ˆdˆd•2”:˜eœlÑ+Ô+¨A¨A¨A¨r°¨r¨EÔ2Ñ3Ô3ÐLÐLÐLr   r   Únoner5   r9   )r.   r-   r!   r   r   r#   r$   ÚMultiLineStringr&   r'   r   r   r   r?   r@   rA   )
rD   r   rB   r:   r8   r/   r-   ÚpathrC   r   s
            @r   Ú	plot_linerL   ‡   s,  ø€ ð6 -Ð,Ð,Ð,Ð,Ð,Ø$Ð$Ð$Ð$Ð$Ð$à	€zÝ‰]Œ]ˆà€}Øˆå�$�Ô/Ñ0Ô0ð 4Ø&ˆtÔ&ØLÐLÐLÐLÀÄÐLÑLÔLð
ˆˆð ˆt•B”J˜tœ{Ñ+Ô+¨A¨A¨A¨r°¨r¨EÔ2Ñ3Ô3ˆàˆIØðØ¨%¸9ðð ØHNðð €Eð ‡L‚L�ÑÔÐØ×ÒÑÔÐàð Ý˜4 B¨eÐ4Ñ4Ô4ˆØ�dˆ{Ðà€Lr   Úoc                 ó    — |€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Úmarkerr:   )r   r$   Úget_coordinatesÚplot)Úgeomr   r:   rR   r/   r   rD   s          r   rA   rA   ¿   st   € ð0 
€zÝ‰]Œ]ˆåÔ$ TÑ*Ô*€FØˆbŒgØˆqˆqˆq�!ˆtŒ�f˜Q˜Q˜Q ˜T”lðØ.0¸Àuðð ØPVðð �G€Tð €Kr   )NTNNNN)NTNr   )NNrM   )
Ú__doc__Únumpyr   r$   r   r   r0   rE   rL   rA   r   r   r   ú<module>rX      s³   ððð ð Ð Ð Ð à €€€ðð ð ð
ð 
ð 
ð"<ð <ð <ð2 ØØ
ØØØðFð Fð Fð FðR5ð 5ð 5ð 5ðpð ð ð ð ð r   