o
    h                     @   s   d dl Z d dlmZ d dlmZmZmZmZmZm	Z	 d dl
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 ZdddZdS )    N)assert_allclose)
LineStringMultiLineStringMultiPolygonPointboxget_coordinates)orient)patch_from_polygon	plot_lineplot_pointsplot_polygon
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   	facecolor	edgecolor	linewidth)r   r
   equal_colorget_facecolorget_edgecolorget_linewidthpolyartist r   V/var/www/html/scripts/venv/lib/python3.10/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   
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   
r3   c                  C   sJ   t ddddt dddd} t| \}}| j}t|tt|  d S )Nr   r   r!   r"   )r   r#   r   r.   r/   r   r   r	   r0   r   r   r   test_plot_polygon_with_interior7   s   
r4   c                  C   sF   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   r0   r   r   r   test_plot_multipolygon>   s   
r5   c                  C   st   t ddddt dddd} t ddddt dddd}t| |g}t|\}}| j}t|tt| d S )	Nr   r   r!   r"   r            )	r   r#   r   r   r.   r/   r   r   r	   )poly1poly2r   r   r1   r2   r   r   r   $test_plot_multipolygon_with_interiorE   s   
r;   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   r1   r2   r   r   r   test_plot_lineO   s   
r@   c                  C   sD   t tg dtddgg} t| \}}| j}t|t|  d S )Nr<   )r&   r&   )r   r   )r   r   r   r.   r/   r   r   r>   r   r   r   test_plot_multilinestring\   s   
rA   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   r<   r   Noner   +top)r+   marker	fillstyle)r   r   r   r   r.   r/   r   r   get_linestyle	get_color
get_markerget_fillstyle)geomr   r2   r   r   r   test_plot_pointse   s   &

rL   c                 C   s$   ddl m} |j}| |j||dkS )Nr   )colorsr,   )r   rM   colorConverterto_rgba)actualexpectedr-   rM   convr   r   r   r   t   s   r   )N)pytestnumpy.testingr   shapelyr   r   r   r   r   r   shapely.opsr	   shapely.plottingr
   r   r   r   importorskipr    r$   r(   r3   r4   r5   r;   r@   rA   rL   r   r   r   r   r   <module>   s"     

	