o
    jb                     @   sB   d dl Z d dlZd dlZd dlmZmZmZ G dd de jZdS )    N)
LineStringMultiLineStringPointc                   @   sl   e Z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 Zdd Zdd ZdS )LinearReferencingTestCasec                 C   sJ   t dd| _tddg| _tddg| _tt| jjt| jjg| _d S )N   )r   r   )   r   )   r   )r      )	r   pointr   line1line2r   listZcoords	multilineself r   m/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/shapely/tests/legacy/test_linear_referencing.pysetUp
   s   
zLinearReferencingTestCase.setUpc                 C   4   | j | jdksJ | j j| jdddksJ d S N      ?T
normalized      ?)r   projectr
   r   r   r   r   test_line1_project      z,LinearReferencingTestCase.test_line1_projectc                 C   r   r   )r   Zline_locate_pointr
   r   r   r   r   test_alias_project   r   z,LinearReferencingTestCase.test_alias_projectc                 C   s<   | j | jdksJ | j j| jddtddksJ d S )Nr   Tr   gQUUU?   )r   r   r
   pytestZapproxr   r   r   r   test_line2_project   s   z,LinearReferencingTestCase.test_line2_projectc                 C   r   )Nr   Tr   g      ?)r   r   r
   r   r   r   r   test_multiline_project    r   z0LinearReferencingTestCase.test_multiline_projectc                 C   sJ   t jtjdd | jd| j W d    d S 1 sw   Y  d S )NZIllegalArgumentException)matchr   )r   ZraisesshapelyZGEOSExceptionr
   bufferr   r   r   r   r   test_not_supported_project$   s   "z4LinearReferencingTestCase.test_not_supported_projectc                 C   s   | j tdddksJ d S )Ni        )r   r   r   r   r   r   r   test_not_on_line_project(   s   z2LinearReferencingTestCase.test_not_on_line_projectc                 C   |   | j dtddsJ | j dtddsJ | j jdddtdds,J | j jdddtdds<J d S 	Nr   r&   g      g      ?Tr   r   r   r   interpolateequalsr   r   r   r   r   test_line1_interpolate,   s    $z0LinearReferencingTestCase.test_line1_interpolatec                 C   r(   r)   )r   Zline_interpolate_pointr,   r   r   r   r   r   test_alias_interpolate2   s   z0LinearReferencingTestCase.test_alias_interpolatec                 C   s@   | j dtddsJ | j jdddtddsJ d S )Nr         @Tr   r   )r   r+   r,   r   r   r   r   r   test_line2_interpolate<      $z0LinearReferencingTestCase.test_line2_interpolatec                 C   s@   | j dtddsJ | j jdddtddsJ d S )Nr   r   Tr   r/          @)r   r+   r,   r   r   r   r   r   test_multiline_interpolate@   r1   z4LinearReferencingTestCase.test_multiline_interpolatec                 C   s<   | j dtddsJ | j dtddsJ d S )Nir&   i  r2   r*   r   r   r   r   test_line_ends_interpolateD   s    z4LinearReferencingTestCase.test_line_ends_interpolateN)__name__
__module____qualname__r   r   r   r    r!   r%   r'   r-   r.   r0   r3   r4   r   r   r   r   r   	   s    
r   )	Zunittestr   r#   Zshapely.geometryr   r   r   ZTestCaser   r   r   r   r   <module>   s
    