From 8de0087412cff984c8df650159a80d504267247a Mon Sep 17 00:00:00 2001 From: Joeri van Engelen Date: Fri, 2 Aug 2024 13:53:00 +0200 Subject: [PATCH] Add case single line at edge --- tests/test_snap.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/test_snap.py b/tests/test_snap.py index d38131646..91b03bb86 100644 --- a/tests/test_snap.py +++ b/tests/test_snap.py @@ -152,7 +152,7 @@ def test_snap_to_grid(): class LineCases: def case_single_line(self): - line_x = [2.2, 2.2, 2.2] + line_x = [40.2, 40.2, 40.2] line_y = [82.0, 40.0, 0.0] geometry = gpd.GeoDataFrame( geometry=[shapely.linestrings(line_x, line_y)], data={"a": [1.0]} @@ -161,6 +161,16 @@ def case_single_line(self): line_counts = np.array([8, 172]) return geometry, unique_values, line_counts + def case_single_line_at_edge(self): + line_x = [40.0, 40.0, 40.0] + line_y = [82.0, 40.0, 0.0] + geometry = gpd.GeoDataFrame( + geometry=[shapely.linestrings(line_x, line_y)], data={"a": [1.0]} + ) + unique_values = np.array([0.0, np.nan]) + line_counts = np.array([9, 172]) + return geometry, unique_values, line_counts + def case_parallel_lines(self): line_x1 = [10.2, 10.2, 10.2] line_x2 = [30.2, 30.2, 30.2]