Skip to content

Commit

Permalink
Add case single line at edge
Browse files Browse the repository at this point in the history
  • Loading branch information
JoerivanEngelen committed Aug 2, 2024
1 parent 42d0d32 commit 8de0087
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/test_snap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]}
Expand All @@ -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]
Expand Down

0 comments on commit 8de0087

Please sign in to comment.