Skip to content
Permalink
Browse files

fix circular string with extra parenthesis in qgsgeometry

  • Loading branch information
lbartoletti committed Aug 24, 2020
1 parent 9d8f3d3 commit d07218e4165afe8c24aff38d83bc8c19b74b72a5
Showing with 7 additions and 7 deletions.
  1. +7 −7 tests/src/python/test_qgsgeometry.py
@@ -4244,42 +4244,42 @@ def testGeometryDisplayString(self):

def testDeleteVertexCircularString(self):

wkt = "CircularString ((0 0,1 1,2 0))"
wkt = "CircularString (0 0,1 1,2 0)"
geom = QgsGeometry.fromWkt(wkt)
assert geom.deleteVertex(0)
self.assertEqual(geom.asWkt(), QgsCircularString().asWkt())

wkt = "CircularString ((0 0,1 1,2 0,3 -1,4 0))"
wkt = "CircularString (0 0,1 1,2 0,3 -1,4 0)"
geom = QgsGeometry.fromWkt(wkt)
assert geom.deleteVertex(0)
expected_wkt = "CircularString (2 0, 3 -1, 4 0)"
self.assertEqual(geom.asWkt(), QgsGeometry.fromWkt(expected_wkt).asWkt())

wkt = "CircularString ((0 0,1 1,2 0,3 -1,4 0))"
wkt = "CircularString (0 0,1 1,2 0,3 -1,4 0)"
geom = QgsGeometry.fromWkt(wkt)
assert geom.deleteVertex(1)
expected_wkt = "CircularString (0 0, 3 -1, 4 0)"
self.assertEqual(geom.asWkt(), QgsGeometry.fromWkt(expected_wkt).asWkt())

wkt = "CircularString ((0 0,1 1,2 0,3 -1,4 0))"
wkt = "CircularString (0 0,1 1,2 0,3 -1,4 0)"
geom = QgsGeometry.fromWkt(wkt)
assert geom.deleteVertex(2)
expected_wkt = "CircularString (0 0, 1 1, 4 0)"
self.assertEqual(geom.asWkt(), QgsGeometry.fromWkt(expected_wkt).asWkt())

wkt = "CircularString ((0 0,1 1,2 0,3 -1,4 0))"
wkt = "CircularString (0 0,1 1,2 0,3 -1,4 0)"
geom = QgsGeometry.fromWkt(wkt)
assert geom.deleteVertex(3)
expected_wkt = "CircularString (0 0, 1 1, 4 0)"
self.assertEqual(geom.asWkt(), QgsGeometry.fromWkt(expected_wkt).asWkt())

wkt = "CircularString ((0 0,1 1,2 0,3 -1,4 0))"
wkt = "CircularString (0 0,1 1,2 0,3 -1,4 0)"
geom = QgsGeometry.fromWkt(wkt)
assert geom.deleteVertex(4)
expected_wkt = "CircularString (0 0,1 1,2 0)"
self.assertEqual(geom.asWkt(), QgsGeometry.fromWkt(expected_wkt).asWkt())

wkt = "CircularString ((0 0,1 1,2 0,3 -1,4 0))"
wkt = "CircularString (0 0,1 1,2 0,3 -1,4 0)"
geom = QgsGeometry.fromWkt(wkt)
assert not geom.deleteVertex(-1)
assert not geom.deleteVertex(5)

0 comments on commit d07218e

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