Skip to content

Commit

Permalink
Add assertGeometriesEqual function for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Aug 21, 2018
1 parent c82fdab commit 8aca375
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/testing/__init__.py
Expand Up @@ -196,6 +196,9 @@ def assertFilesEqual(self, filepath_expected, filepath_result):
diff = list(diff)
self.assertEqual(0, len(diff), ''.join(diff))

def assertGeometriesEqual(self, geom0, geom1, geom0_id='geometry 1', geom1_id='geometry 2', precision=14, topo_equal_check=False):
self.checkGeometriesEqual(geom0, geom1, geom0_id, geom1_id, use_asserts=True, precision=precision, topo_equal_check=topo_equal_check)

def checkGeometriesEqual(self, geom0, geom1, geom0_id, geom1_id, use_asserts=False, precision=14, topo_equal_check=False):
""" Checks whether two geometries are the same - using either a strict check of coordinates (up to given precision)
or by using topological equality (where e.g. a polygon with clockwise is equal to a polygon with counter-clockwise
Expand Down

0 comments on commit 8aca375

Please sign in to comment.