3
®?d]B
  ã            
   @   sX  d dl mZ d dlZd dlZd dlmZmZ d dlmZ eej	d&dƒZ
dd„ edƒD ƒZd	d„ eD ƒZeeƒZed+ƒZdd„ ejD ƒZdd„ ejD ƒZejeƒZejd,ks®t‚edk�rTejdd-dd� x€eD ]xZejj\ZZejeeddd� ejeedddd� x@ejD ]6Z e j\ZZejeeddd� ejeedddd� �qW qÎW xˆeD ]€Zejj\ZZejeedddd� ejeeddddd� xBejD ]8Z e j\ZZejeeddd� ejeeddddd� �q’W �qPW ej!d.d/d d ddddd!� x.ejD ]$Z"e"j\ZZejeeddd"d� �qöW ej#d0dd$e$eƒe$ejƒe$ejƒej%f ƒ ej&d%ƒ dS )1é    )ÚpartialN)Ú
LineStringÚPoint)Úcascaded_uniong      4@c             C   s   g | ]}t tƒ tƒ ƒ‘qS © )r   Úr)Ú.0Úir   r   ú=/tmp/pip-build-op5p2y5_/shapely/shapely/examples/intersect.pyú
<listcomp>   s    r   éd   c             C   s   g | ]}|j d ƒ‘qS )g      @)Úbuffer)r   Úpr   r   r
   r      s    ç      9@c             C   s   g | ]}t j|ƒr|‘qS r   )ÚvectorÚ
intersects)r   Úpatchr   r   r
   r      s    c             c   s   | ]}t j|ƒs|V  qd S )N)r   r   )r   r   r   r   r
   ú	<genexpr>    s    r   ÚMultiLineStringÚ__main__é   é´   )ÚnumZfigsizeZdpiz#ccccccT)ÚcolorÚaaz#999999g      ð?)r   r   Úlwz#ffffffZredg      Ð?)r   Úalphar   g      à?)r   r   r   r   é   é2   )r   r   Z
head_widthZhead_lengthg      ø?é   z'Patches: %d/%d (%d), total length: %.1fzintersect.pngg      4Àç      9Àç      9À©r    r!   ©r   r   )r"   r#   )r   )r   r   içÿÿÿiçÿÿÿiäÿÿÿ)'Ú	functoolsr   ÚrandomZpylabZshapely.geometryr   r   Zshapely.opsr   Úuniformr   ÚrangeZpointsZspotsZpatchesr   ZgeomsZ
interceptsÚmissesÚintersectionZ	geom_typeÚAssertionErrorÚ__name__ÚfigureZspotZexteriorZxyÚxÚyÚfillZplotZ	interiorsZholeZarrowZsegmentÚtextÚlenÚlengthZsavefigr   r   r   r
   Ú<module>   sR   	





"

