
    Og                         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 j                  d       d Zd Zd Zd	 Zd
 Zd Zd Zd Zd ZddZy)    N)assert_allclose)boxget_coordinates
LineStringMultiLineStringPoint)patch_from_polygon	plot_lineplot_pointsplot_polygon
matplotlibc                      t        dddd      } t        | ddd      }t        |j                         d      sJ t        |j	                         d      sJ |j                         dk(  sJ y )Nr      redblue   	facecolor	edgecolor	linewidth)r   r	   equal_colorget_facecolorget_edgecolorget_linewidthpolyartists     `/var/www/html/public_html/myphp/venv/lib/python3.12/site-packages/shapely/tests/test_plotting.pytest_patch_from_polygonr   
   sk    q!Q?DSTUFv++-u555v++-v666!Q&&&    c                     t        dddd      j                  t        dddd            } t        | ddd      }t        |j	                         d      sJ t        |j                         d      sJ |j                         dk(  sJ y )	Nr   r   皙?      ?r   r   r   r   )r   
differencer	   r   r   r   r   r   s     r   %test_patch_from_polygon_with_interiorr%      s    q!Q?%%c#sC&=>DSTUFv++-u555v++-v666!Q&&&r    c                     t        dddd      j                  t        dddd            } t        | ddd      }t        |j	                         d      sJ t        |j                         d      sJ |j                         dk(  sJ y )Nr   r      r   r   r   r   )r   unionr	   r   r   r   r   r   s     r   test_patch_from_multipolygonr)      s    q!Q?  Q1a1DSTUFv++-u555v++-v666!Q&&&r    c                  Z   t        dddd      } t        |       \  }}|j                         j                  }t	        |t        |              t        | ddd      }t        |j                         dd      sJ t        |j                         dd	      sJ |j                         dk(  sJ y )
Nr   r   Fr   r   
add_pointscolorr   g333333?alphag      ?)
r   r   get_pathverticesr   r   r   r   r   r   r   r   _plot_coordss       r   test_plot_polygonr5   "   s    q!Q?DT"IFA//#,,KK!67 $5KFv++-uC@@@v++-uC@@@!Q&&&r    c                      t        dddd      j                  t        dddd            } t        |       \  }}|j                         j                  }t        |t        |              y )Nr   r   r"   r#   )r   r$   r   r0   r1   r   r   r2   s       r   test_plot_polygon_with_interiorr7   /   sV    q!Q?%%c#sC&=>DT"IFA//#,,KK!67r    c                      t        dddd      j                  t        dddd            } t        |       \  }}|j                         j                  }t        |t        |              y )Nr   r   r'   r   )r   r(   r   r0   r1   r   r   r2   s       r   test_plot_multipolygonr9   6   sU    q!Q?  Q1a1DT"IFA//#,,KK!67r    c                  P   t        g d      } t        |       \  }}|j                         j                  }t	        |t        |              t        | ddd      }t        |j                         d      sJ t        |j                         d      sJ |j                         dk(  sJ y )N)r   r   )r   r   )r   r   Fr   r   r+   none)
r   r
   r0   r1   r   r   r   r   r   r   liner   r3   r4   s       r   test_plot_liner?   =   s    ./D$IFA//#,,KK!67 tUaHFv++-u555v++-v666!Q&&&r    c                      t        t        g d      t        ddg      g      } t        |       \  }}|j                         j                  }t        |t        |              y )Nr;   )r'   r'   )r   r   )r   r   r
   r0   r1   r   r   r=   s       r   test_plot_multilinestringrA   J   sT    	,	-z66:J/KLD $IFA//#,,KK!67r    c                     t        dd      t        g d      t        dddd      fD ]Q  } t        |       }|j	                         j
                  }t        |t        |              |j                         dk(  rQJ  t        dd      } t        | ddd      }|j                         dk(  sJ |j                         dk(  sJ |j                         dk(  sJ y )	Nr   r;   r   Noner   +top)r-   marker	fillstyle)r   r   r   r   r0   r1   r   r   get_linestyle	get_color
get_markerget_fillstyle)geomr   r4   s      r   test_plot_pointsrM   S   s    q!j)ABC1aQROT 0T"oo'00_T%:;##%///	0 A;DU3%HF&&&#%%%!U***r    c                 R    dd l m} |j                  }| |j                  ||      k(  S )Nr   r.   )matplotlib.colorscolorscolorConverterto_rgba)actualexpectedr/   rP   convs        r   r   r   b   s(    &  DT\\(%\888r    )N)pytestnumpy.testingr   shapelyr   r   r   r   r   shapely.plottingr	   r
   r   r   importorskipr   r%   r)   r5   r7   r9   r?   rA   rM   r    r    r   <module>r\      sY     ) L L U U   L !'''
'88
'8+9r    