Skip to content

Commit a55d4de

Browse files
authored
Create test_analysis.py
1 parent e44159c commit a55d4de

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_analysis.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import pytest
2+
import numpy as np
3+
from shapely.geometry import Polygon
4+
from planet_overlap.analysis import compute_intersections
5+
6+
def test_intersection_area():
7+
poly1 = Polygon([(-1,0), (0,1), (1,0), (0,-1)])
8+
poly2 = Polygon([(0,0), (1,1), (2,0), (1,-1)])
9+
area_matrix = compute_intersections([poly1, poly2])
10+
assert area_matrix.shape == (2,2)
11+
assert area_matrix[0,1] > 0
12+
assert area_matrix[1,0] == area_matrix[0,1]

0 commit comments

Comments
 (0)