o
    e                     @   s   d dl Z d dlmZ d dlmZmZmZmZmZ d dl	m
Z
mZmZmZ e d dd Zdd	 Zd
d Zdd Zdd Zdd Zdd Zdd Zdd ZdddZdS )    N)assert_allclose)boxget_coordinates
LineStringMultiLineStringPoint)patch_from_polygon	plot_lineplot_pointsplot_polygonZ
matplotlibc                  C   sV   t dddd} t| dddd}t| dsJ t| ds!J | dks)J d S )Nr      redblue   Z	facecolorZ	edgecolor	linewidth)r   r   equal_colorget_facecolorget_edgecolorget_linewidthpolyartist r   KD:\Projects\ConvertPro\env\Lib\site-packages\shapely/tests/test_plotting.pytest_patch_from_polygon
   s
   r   c                  C   sf   t ddddt dddd} t| dddd}t| ds J t| ds)J | dks1J d S )	Nr   r   皙?      ?r   r   r   r   )r   
differencer   r   r   r   r   r   r   r   r   %test_patch_from_polygon_with_interior   
   r   c                  C   sf   t ddddt dddd} t| dddd}t| ds J t| ds)J | dks1J d S )Nr   r      r   r   r   r   )r   unionr   r   r   r   r   r   r   r   r   test_patch_from_multipolygon   r    r#   c                  C   s   t dddd} t| \}}| j}t|t|  t| dddd}t| ddds,J t| dd	ds7J |	 dks?J d S )
Nr   r   Fr   r   Z
add_pointscolorr   g333333?alphag      ?)
r   r   get_pathverticesr   r   r   r   r   r   r   r   _plot_coordsr   r   r   test_plot_polygon"   s   
r-   c                  C   F   t ddddt dddd} t| \}}| j}t|t|  d S )Nr   r   r   r   )r   r   r   r(   r)   r   r   r*   r   r   r   test_plot_polygon_with_interior/      
r/   c                  C   r.   )Nr   r   r!   r   )r   r"   r   r(   r)   r   r   r*   r   r   r   test_plot_multipolygon6   r0   r1   c                  C   sx   t g d} t| \}}| j}t|t|  t| dddd}t| ds)J t| ds2J |	 dks:J d S )N)r   r   )r   r   )r   r   Fr   r   r$   none)
r   r	   r(   r)   r   r   r   r   r   r   liner   r+   r,   r   r   r   test_plot_line=   s   
r6   c                  C   sD   t tg dtddgg} t| \}}| j}t|t|  d S )Nr2   )r!   r!   )r   r   )r   r   r	   r(   r)   r   r   r4   r   r   r   test_plot_multilinestringJ   s   
r7   c                  C   s   t ddtg dtddddfD ]} t| }| j}t|t|  | dks+J qt dd} t| dddd}|	 dksAJ |
 dksIJ | dksQJ d S )	Nr   r2   r   Noner   +top)r%   markerZ	fillstyle)r   r   r   r
   r(   r)   r   r   Zget_linestyle	get_colorZ
get_markerZget_fillstyle)Zgeomr   r,   r   r   r   test_plot_pointsS   s   &

r=   c                 C   s$   dd l m} |j}| |j||dkS )Nr   r&   )Zmatplotlib.colorscolorsZcolorConverterZto_rgba)actualexpectedr'   r>   convr   r   r   r   b   s   r   )N)ZpytestZnumpy.testingr   Zshapelyr   r   r   r   r   Zshapely.plottingr   r	   r
   r   Zimportorskipr   r   r#   r-   r/   r1   r6   r7   r=   r   r   r   r   r   <module>   s    
	