Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Oct 16, 2017
1 parent f03c657 commit 16c8c3e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/src/python/test_qgsgeometry.py
Expand Up @@ -1685,6 +1685,16 @@ def testReshape(self):
wkt = g.exportToWkt()
assert compareWkt(expWkt, wkt), "testReshape failed: mismatch Expected:\n%s\nGot:\n%s\n" % (expWkt, wkt)

# Test reshape with z support
wkt = 'LineStringZ (-1 0 -3, 0 0 20, 5 0 9999)'
g = QgsGeometry.fromWkt(wkt)

self.assertEqual(g.reshapeGeometry([QgsPointV2(QgsWKBTypes.PointZ, -1, 0, -3), QgsPointV2(QgsWKBTypes.PointZ, -6, 5, 55)]), 0)
wkt = g.exportToWkt()

expWkt = 'LineStringZ (-6 5 55, -1 0 -3, 0 0 20, 5 0 9999)'
assert compareWkt(expWkt, wkt), "testReshape failed: mismatch Expected:\n%s\nGot:\n%s\n" % (expWkt, wkt)

def testConvertToMultiType(self):
""" Test converting geometries to multi type """
point = QgsGeometry.fromWkt('Point (1 2)')
Expand Down

0 comments on commit 16c8c3e

Please sign in to comment.