Skip to content
Permalink
Browse files

Add assertGeometriesEqual function for testing

  • Loading branch information
m-kuhn committed Aug 21, 2018
1 parent c82fdab commit 8aca375a6e4bd48256c954385a3de2b88502c19d
Showing with 3 additions and 0 deletions.
  1. +3 −0 python/testing/__init__.py
@@ -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

0 comments on commit 8aca375

Please sign in to comment.
You can’t perform that action at this time.