
    DgT                         d Z ddlZddlmZ ddlmZ ddlmZ d Z	d Z
d Zd	 Zd
 Zd Zd Zej                   j#                  d      d        Zej                   j#                  d      d        Zd Zd Zd Zd Zy)z
Tests for GEOSClipByRect based on unit tests from libgeos.

There are some expected differences due to Shapely's handling of empty
geometries.
    N)clip_by_rect)dumps)loadsc                  \    t        d      } t        | dddd      }t        |d      dk(  sJ y)zPoint outsidezPOINT (0 0)
      r   rounding_precisionGEOMETRYCOLLECTION EMPTYNload_wktr   dump_wktgeom1geom2s     e/var/www/html/public_html/venv/lib/python3.12/site-packages/shapely/tests/legacy/test_clip_by_rect.pytest_point_outsider      s4    ]#EBB/EEa04NNNN    c                  \    t        d      } t        | dddd      }t        |d      dk(  sJ y)zPoint insidezPOINT (15 15)r   r   r   r	   Nr   r   s     r   test_point_insider      s3    _%EBB/EEa0OCCCr   c                  \    t        d      } t        | dddd      }t        |d      dk(  sJ y)zPoint on boundaryzPOINT (15 10)r   r   r   r	   r   Nr   r   s     r   test_point_on_boundaryr      s4    _%EBB/EEa04NNNNr   c                  \    t        d      } t        | dddd      }t        |d      dk(  sJ y)zLine outsidezLINESTRING (0 0, -5 5)r   r   r   r	   r   Nr   r   s     r   test_line_outsider   $   s5    -.EBB/EEa04NNNNr   c                  \    t        d      } t        | dddd      }t        |d      dk(  sJ y)zLine insidezLINESTRING (15 15, 16 15)r   r   r   r	   Nr   r   s     r   test_line_insider   +   s5    01EBB/EEa04OOOOr   c                  \    t        d      } t        | dddd      }t        |d      dk(  sJ y)zLine on boundaryz LINESTRING (10 15, 10 10, 15 10)r   r   r   r	   r   Nr   r   s     r   test_line_on_boundaryr   2   s5    78EBB/EEa04NNNNr   c                  \    t        d      } t        | dddd      }t        |d      dk(  sJ y)zLine splitting rectanglezLINESTRING (10 5, 25 20)r   r   r   r	   zLINESTRING (15 10, 20 15)Nr   r   s     r   test_line_splitting_rectangler    9   s5    /0EBB/EEa04OOOOr   zTODO issue to CCW)reasonc                  \    t        d      } t        | dddd      }t        |d      dk(  sJ y)z/Polygon shell (CCW) fully on rectangle boundary-POLYGON ((10 10, 20 10, 20 20, 10 20, 10 10))r   r   r   r	   Nr   r   s     r   2test_polygon_shell_ccw_fully_on_rectangle_boundaryr$   @   =     DEEBB/E1-:	;	;r   zTODO issue to CWc                  \    t        d      } t        | dddd      }t        |d      dk(  sJ y)z.Polygon shell (CW) fully on rectangle boundaryz-POLYGON ((10 10, 10 20, 20 20, 20 10, 10 10))r   r   r   r	   r#   Nr   r   s     r   1test_polygon_shell_cc_fully_on_rectangle_boundaryr'   K   r%   r   c                  \    t        d      } t        | dddd      }t        |d      dk(  sJ y)z.Polygon hole (CCW) fully on rectangle boundaryLPOLYGON ((0 0, 0 30, 30 30, 30 0, 0 0), (10 10, 20 10, 20 20, 10 20, 10 10))r   r   r   r	   r   Nr   r   s     r   ,polygon_hole_ccw_fully_on_rectangle_boundaryr*   V   9    VE BB/EEa04NNNNr   c                  \    t        d      } t        | dddd      }t        |d      dk(  sJ y)z-Polygon hole (CW) fully on rectangle boundaryzLPOLYGON ((0 0, 0 30, 30 30, 30 0, 0 0), (10 10, 10 20, 20 20, 20 10, 10 10))r   r   r   r	   r   Nr   r   s     r   +polygon_hole_cw_fully_on_rectangle_boundaryr-   _   r+   r   c                  `    d} t        |       }t        |dddd      }t        |d      | k(  sJ y)zPolygon fully within rectanglezLPOLYGON ((1 1, 1 30, 30 30, 30 1, 1 1), (10 10, 20 10, 20 20, 10 20, 10 10))r   (   r	   Nr   wktr   r   s      r   polygon_fully_within_rectangler2   h   s7    
XCSME1b"-EEa0C777r   c                  `    d} t        |       }t        |dddd      }t        |d      dk(  sJ y)zPolygon overlapping rectangler)         r   r	   z5POLYGON ((5 5, 5 15, 10 15, 10 10, 15 10, 15 5, 5 5))Nr   r0   s      r   polygon_overlapping_rectangler6   p   s@    
XCSME1b"-E1-B	C	Cr   )__doc__pytestshapely.opsr   shapely.wktr   r   r   r   r   r   r   r   r   r   r    markxfailr$   r'   r*   r-   r2   r6    r   r   <module>r>      s     $ ) )ODOOPOP -. / ,- .OO8r   