
    OgV4                     $   d dl Zd dlZd dlZd dlmZmZ d dlmZ d dlm	Z	m
Z
mZmZmZ ej                  Zej                   Zej$                  Zej(                  j+                  dej                  ej                   ej,                  g      ej(                  j+                  d ej.                  d       ej.                  d       ej.                  d	      d ej0                  d
de      g      d               Zej(                  j+                  dej6                  ej8                  ej:                  ej$                  g      ej(                  j+                  d ej<                  ddgej>                        d ej<                  egg      dg      d               Z ej(                  j+                  dej                  ej                   ej,                  g      ej(                  j+                  degdd dgdgg      d               Z! ej.                  de      Z"de"jF                  _$        ej(                  j+                  dej                  ej                   ej$                  g      ej(                  j+                  dg d ej.                  d      e" ej.                  de       ej.                  de       ej.                  de      g      d               Z%d Z&d Z'd  Z(ej(                  j+                  d!d dgeee	dgfd dgede	egfddgddeegfg      d"        Z)ej(                  j+                  d#ddgddggd d g eddgddgg      gfg d$g d%gd d g eg d$g d%g      gfddgddgddgddggg d& eddgddgg       eddgddgg      gfg      d'        Z*d( Z+ej(                  j+                  d!g d)e
e
e	dgfg d*e
de	e
gfg d+dde
e
gfg      d,        Z,ej(                  j+                  dddgddgddgddggddgddgddggg      d-        Z-ej(                  j+                  ddej\                  gddgddgddggg      d.        Z/d/ Z0ej(                  j+                  d!g d0edde	gfg d1dede	gfg d2dddegfg      d3        Z1ej(                  j+                  d4ddg      ej(                  j+                  d5d6d7g      d8               Z2 ej,                  g d9      Z3 ej,                  g d:      Z4 ejj                  e      Z6 e       Z7 ejj                  ee3g;      Z8 ejj                  ee4g;      Z9 ejj                  ee3e4g;      Z:ej(                  j+                  d<eegd dge6e6gfdegd dge7e6gfdeddgg d&e6e7gfee3egg d=e8e6gfeee3gg d>e6e8gfdeee3gg d&e6e8gfedee3gg d&e6e8gfedee3gg d?e6e8gfeede3gg d?e6e8gfeee3dgg d?e6e8gfee3e4egg d@e:e6gfee3ee4gg d&e8e9gfeee3e4gg d?e6e:gfee3de4egg dAe:e6gfee3dee4gg dBe8e9gfee3ede4gg dCe8e9gfg      dD        Z;ej(                  j+                  d!d dge6e6e	dgfd dge6de	e6gfddgdde6e6gfg      dE        Z<ej(                  j+                  dejj                  ej6                  ej8                  ej:                  ej$                  g      ej(                  j+                  d ej<                  eg      dd dgdgg      dF               Z=ej(                  j+                  dGee
gd d g eee
g      gfee
gd dg eeg       ee
g      gfedgd d g eeg      gfedgd dg eeg       eg       gfdeddgg d& eeg       eg       gfede
gg dH eee
g      gfg      dI        Z>dJ Z?ej(                  j+                  d!d d g eee
g      dde	gfddgddd eee
g      gfg      dK        Z@dL ZAdM ZBdN ZCdO ZDej(                  j+                  dPegejj                  fe
gejj                  fegejj                  fe
gej6                  fegej6                  fegej8                  fegej8                  fegej:                  fe
gej:                  fg	      dQ        ZEy)R    N)
LinearRingPolygon)assert_geometries_equal)empty_pointline_stringlinear_ringpointpolygonfunccoordinates)   )r         )r   r   )r   r   foodtypec                     t        j                  t        t        f      5   | |ddg       d d d        y # 1 sw Y   y xY wNr   r   indicespytestraises	TypeError
ValueError)r   r   s     h/var/www/html/public_html/myphp/venv/lib/python3.12/site-packages/shapely/tests/test_creation_indices.pytest_invalid_coordinatesr      s8     
	:.	/ *[1a&)* * *   6?
geometriesr   r   helloc                     t        j                  t        t        f      5   | |ddg       d d d        y # 1 sw Y   y xY wr   r   )r   r   s     r   test_invalid_geometriesr"       s8     
	:.	/ )Z!Q() ) )r   r   z helloc                     t        j                  t        t        f      5   | ddgg|       d d d        y # 1 sw Y   y xY w)N皙?333333?r   r   r   r   s     r   test_invalid_indices_simpler(   1   s:    
 
	:.	/ ,sCj\7+, , ,s	   7A    Fout)NNN)r)   r    c                 6   | t         j                  u rddgddgg}ddg}n;| t         j                  u rddgddgddgddgdd	gd	d	gg}g d
}nt        t        g}ddg}t        j                  t        t        f      5   | |||       d d d        y # 1 sw Y   y xY w)Nr%   r&   皙?g      ?r   r   r   r)   r   )r   r   r   r   r   r   r   r*   )	shapelypointslinestringsr	   r   r   r   r   r   )r   r*   xr   s       r   test_invalid_outr3   >   s     w~~3Z#s$a&	$$	$VaVaVaVaVaV<$K a&		:.	/ *QS)* * *s   :BBc                      t        j                  t        j                        5  t        j                  ddgddggddg       d d d        y # 1 sw Y   y xY wNr   r   r   r   )r   r   r/   GEOSExceptionr0   r+       r   test_points_invalidr8   Z   sH    	w,,	- 9AA'!Q89 9 9    AAc                      t        j                  t        j                  ddgddggt              t        j                  ddgt        j
                              } t        | t        t        g       y )Nr   r)   r   r   r   r   )r/   r0   nparrayfloatintpr   r	   actuals    r   test_pointsrA   `   sQ    ^^
1a&1a&!/!Qrww/F FUEN3r7   c                     t        j                  t              5  t        j                  t        j                  ddgddggt              t        j                  ddgt
        j                               d d d        y # 1 sw Y   y xY w)Nr   r)   r   r   r   )	r   r   r   r/   r0   r;   r<   r=   r>   r+   r7   r   test_points_no_index_raisesrC   h   s`    	z	" 
HHq!fq!f%U3HHaV2773	

 
 
s   AA??Bzindices,expectedc                     t        j                  dt              }t        |d<   t	        j
                  ddgddgg| |      }t        ||       ||u sJ y )Nr   r   r   r)   r.   )r;   emptyobjectr   r/   r0   r   r   expectedr*   r@   s       r   test_points_outrI   p   sY     ((1F
#CCF^^
Q!QF
 C*S==r7   zcoordinates,indices,expected)r   r   r   )r   r   r   )r   r   r   r   c                     t        j                  t        j                  | t              t        j                  |t        j
                              }t        ||       y Nr   r   )r/   r1   r;   r<   r=   r>   r   )r   r   rH   r@   s       r   test_linestringsrL      s?       
E*BHHWBGG4TF FH-r7   c                      t        j                  t        j                        5  t        j                  ddgddggddg       d d d        y # 1 sw Y   y xY wr5   )r   r   r/   r6   r1   r+   r7   r   test_linestrings_invalidrN      sJ    	w,,	- >aVaV,q!f=> > >r9   )r   r   r   r   r   r   )r   r   r   r)   r)   r)   )r   r   r   r)   r)   r)   c                     t        j                  dt              }t        |d<   t	        j
                  g d| |      }t        ||       ||u sJ y )Nr   r   r   )r   r   r   r   r   r   rP   rQ   rR   r.   )r;   rE   rF   r   r/   r1   r   rG   s       r   test_linestrings_outrS      sN     ((1F
#CCF  8F
 C*S==r7   c                    t        j                  t        j                  | t        j                        t        j
                  t        |       t        j                              }t        |t        j                  |              y rK   )	r/   linearringsr;   r<   float64zeroslenr>   r   )r   r@   s     r   test_linearringsrY      sT       
BJJ/[)9F FG$7$7$DEr7   c           	          t        j                  t        j                  t        f      5  t        j
                  | t        j                  t        |                    d d d        y # 1 sw Y   y xY wNr   )	r   r   r/   r6   r   rU   r;   rW   rX   )r   s    r   test_linearrings_invalidr\      sR     
--z:	; MK#k:J1KLM M Ms   4A''A0c                      t        j                  g dt        j                  d            } t	        | t        g d             y )N)rP   rP   rP   r)   r   )rP   rP   rP   rP   )r/   rU   r;   rW   r   r   r?   s    r   *test_linearrings_unclosed_all_coords_equalr^      s-      !9288A;OFFJ/O$PQr7   )r   r   r   r   r   )r   r   r   r   r   )r)   r)   r)   r)   r)   c                     t        j                  dt              }t        |d<   t	        j
                  g d| |      }t        ||       ||u sJ y )Nr   r   r)   )rP   rQ   rR   )r   r   rP   r.   )r;   rE   rF   r   r/   rU   r   rG   s       r   test_linearrings_outr`      sN     ((1F
#CCF  0F
 C*S==r7   dimorderCFc                    t         j                  j                  dd|       }t        j                  |j	                  d|       |      }t        j
                  t        d      d      }t        j                  ||      }t        j                  ||d d dgd d f   f      }t        j                  |j	                  d|       |      }t        j
                  t        d      d      }t        j                  ||      }t        ||       y )	N
   r   (   )rb   r   r   2      )r;   randomrandnasarrayreshaperepeatranger/   rU   hstackr   )	ra   rb   coordscoords1indices1result1coords2indices2result2s	            r   test_linearrings_bufferrx      s     YY__RC(Fjj4EBGyyrA&H!!'8<G iiA3	!234Gjj5UCGyyrA&H!!'8<GGW-r7   ))r%   r%   )r%   r-   )r-   r-   ))333333?ry   )ry   皙?)rz   rz   )holeszrings,indices,expected)r   r   r   )r   r   r   )r   r   r   r   )r   r   r   r   )r   r   r   r   r   )r   r   r   r   r   )r   r   r   r   r   c                     t        j                  t        j                  | t              t        j                  |t        j
                              }t        ||       y rK   )r/   polygonsr;   r<   rF   r>   r   )ringsr   rH   r@   s       r   test_polygonsr      s@    \ 
f%rxxrww/OF FH-r7   c                     t        j                  dt              }t        |d<   t	        j
                  t        t        g| |      }t        ||       ||u sJ y )Nr   r   r   r.   )r;   rE   rF   r   r/   r}   r   r   rG   s       r   test_polygons_outr   .  sL     ((1F
#CCF{K8'sSFC*S==r7   c                     t        j                  t        t        f      5   | t        g|       d d d        y # 1 sw Y   y xY wr[   )r   r   r   r   r	   r'   s     r    test_invalid_indices_collectionsr   >  s6     
	:.	/ 'eWg&' ' 's	   9Azgeometries,indices,expected)r   r   r   c                 |    t        j                  t        j                  | t              |      }t        ||       y rK   )r/   geometrycollectionsr;   r<   rF   r   )r   r   rH   r@   s       r   test_geometrycollectionsr   N  s0     ((
6*GF FH-r7   c                      t        j                  t              5  t        j                  t        j                  t        t        gt              ddg       d d d        y # 1 sw Y   y xY w)Nr   r   r   r   )
r   r   r   r/   r   r;   r<   r	   r   rF   r+   r7   r   (test_geometrycollections_no_index_raisesr   `  sJ    	z	" 
##HHe[)81a&	

 
 
s   =A  A)c                     t        j                  dt              }t        |d<   t	        j
                  t        t        g| |      }t        ||       ||u sJ y )Nr   r   r)   r.   )	r;   rE   rF   r   r/   r   r	   r   r   rG   s       r   test_geometrycollections_outr   g  sM     ((1F
#CCF((%)=wTWXFC*S==r7   c                      t        j                  t        j                  t        gt
              t        j                  dt        j                              } t        | t        j                  t        g             y Nr   r   r   )	r/   multipointsr;   r<   r	   rF   rW   r>   r   r?   s    r   test_multipointsr   v  sL      
%'!2771KF FG$7$7$@Ar7   c                      t        j                  t        j                  t        gt
              t        j                  dt        j                              } t        | t        j                  t        g             y r   )	r/   multilinestringsr;   r<   r   rF   rW   r>   r   r?   s    r   test_multilinestringsr   }  L    %%
+f-rxx7QF FG$<$<k]$KLr7   c                      t        j                  t        j                  t        gt
              t        j                  dt        j                              } t        | t        j                  t        g             y r   )	r/   r   r;   r<   r   rF   rW   r>   r   r?   s    r   test_multilinearringsr     r   r7   c                      t        j                  t        j                  t        gt
              t        j                  dt        j                              } t        | t        j                  t        g             y r   )	r/   multipolygonsr;   r<   r
   rF   rW   r>   r   r?   s    r   test_multipolygonsr     sL    ""
'&)288ARWW3MF FG$9$97)$DEr7   zgeometries,funcc                 v    t        j                  t              5   || dg       d d d        y # 1 sw Y   y xY w)Nr   r   )r   r   r   )r   r   s     r   test_incompatible_typesr     s1     
y	! &Z!%& & &s   /8)Fnumpyr;   r   r/   r   r   shapely.testingr   shapely.tests.commonr   r   r   r	   r
   r0   pntsr1   lstrsr   	geom_collmarkparametrizerU   rE   fullrF   r   r   r   r   r<   r>   r"   r(   non_writeableflags	writeabler3   r8   rA   rC   rI   rL   rN   rS   rY   nanr\   r^   r`   rx   hole_1hole_2r}   poly
poly_emptypoly_hole_1poly_hole_2poly_hole_1_2r   r   r   r   r   r   r   r   r   r   r   r+   r7   r   <module>r      s      ' 3 V V~~''	 
W^^W00'2E2EF V,	*	*
 
  ##	 8288QF"''2D("((UG9:MwW))
 
W^^W00'2E2EF eWhA$EF, G,
 &) %    
W^^W00'2M2MN 	v&6"V$
*
*94
 
Q%T23
Q%{E23
Q$eU+,		 "a&1a&	Aq6EAq6Aq6*:$;#<=
Y	!Q%I0F*G)HIVaVaVaV,QFQF#$eaVaV,<&=>	
..> 	k;TJK	k4kJK	dD+{CD		 q!fq!fq!fq!f51a&1a&1a&9QSFF bff+1v1v1v	.MMR
 	;dK@A	4dK@A	4t[9:		 A'3*-. . (. 
		A	B			A	Bw$Y
g{6(;g{6(;   VV4DE 
{	#aVdD\:
	q!fz4&89
T4	(,z8JK
v{	+Yd8KL
{F	+Y{8KL
[&	1<$ATU
t[&	1<$ATU
t[&	1<$ATU
{D&	1<$ATU
{FD	1<$ATU&&+6D!	
 &+v6+&	
 +vv6=!	
 &$<D!	
 &$V<+&	
 &+tV<+&	
I),Z.[,Z. 
Q$k401
Q$k401
Q$dD)* 
  ##	 XRXXug%61a&2$$OP' Q	'
 !
	1v	5+2F(G'HI
	1v	5'(:I{m<T'UV
AE7!3 45
AE7!3Yr] CD
tT	"L9eW3EyQS}2UV
{	#YE;;O1P0QR
.
.
 
Q)UK014{KL
Q$dIuk.B$CDEBMMF 
'""#
(()
G$$%
++,
G''(
'**+
G,,-
'''(
--.
&&r7   