Skip to content

Commit 8aca375

Browse files
committed
Add assertGeometriesEqual function for testing
1 parent c82fdab commit 8aca375

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

python/testing/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ def assertFilesEqual(self, filepath_expected, filepath_result):
196196
diff = list(diff)
197197
self.assertEqual(0, len(diff), ''.join(diff))
198198

199+
def assertGeometriesEqual(self, geom0, geom1, geom0_id='geometry 1', geom1_id='geometry 2', precision=14, topo_equal_check=False):
200+
self.checkGeometriesEqual(geom0, geom1, geom0_id, geom1_id, use_asserts=True, precision=precision, topo_equal_check=topo_equal_check)
201+
199202
def checkGeometriesEqual(self, geom0, geom1, geom0_id, geom1_id, use_asserts=False, precision=14, topo_equal_check=False):
200203
""" Checks whether two geometries are the same - using either a strict check of coordinates (up to given precision)
201204
or by using topological equality (where e.g. a polygon with clockwise is equal to a polygon with counter-clockwise

0 commit comments

Comments
 (0)