
    Og                     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     U/var/www/html/public_html/myphp/venv/lib/python3.12/site-packages/shapely/plotting.py_default_axr      s,    #	BGGDMMM'I    c                    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   )matplotlib.pathr   
isinstanceshapelyMultiPolygonmake_compound_pathgeoms_path_from_polygonnpasarrayexteriorcoords	interiors)polygonr   polyrings       r   r   r      s    $'7//0&t&&3:==A4 &A
 	
 't&&G,,334QU;<
?F?P?PQtd2::dkk*1bqb512Q
 	
 B
 Rs   C#5C#
c                 2    ddl m}  |t        |       fi |S )a  
    Gets 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
    **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
    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_pointsr1   r-   r.   r/   r&   r)   patchlines              r   plot_polygonr<   ;   s    T "	z]}NN5!EK		")$		$	YRXE LL7r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 )
a[  
    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
    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,   r0   )r%   r$   r   r   r   r   r   MultiLineStringr   r   r   r   r   r6   r7   r8   )r;   r   r9   r1   r/   r&   r$   r   mlinepathr:   s              r   	plot_linerB      s    4 -$	z]}$//0&t&&AELd2::ell+ArrE23L
 BJJt{{+ArrE23%9HNE LL4Be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
        `markeredgecolor` 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markerr1   )r   r   get_coordinatesplot)geomr   r1   rG   r&   r   r;   s          r   r8   r8      sb    0 
z]$$T*Fbggq!tfQTl.0uPVGT Kr   )NTNNNN)NTNr   )NNo)
__doc__numpyr   r   r   r   r'   r<   rB   r8    r   r   <module>rO      sG     
<0 
EP4nr   