Skip to content
Permalink
Browse files

Don't use linestring() wkt but linestring empty

  • Loading branch information
lbartoletti committed Aug 24, 2020
1 parent 56b603a commit c21e563e04f520f94e7edf763481f173b089a9dd
Showing with 6 additions and 6 deletions.
  1. +1 −1 tests/src/python/test_qgsdistancearea.py
  2. +5 −5 tests/src/python/test_qgsgeometry.py
@@ -984,7 +984,7 @@ def testSplitGeometryAtAntimeridian(self):
self.assertEqual(g.asWkt(), 'PointZ (1 2 3)')
g = da.splitGeometryAtAntimeridian(QgsGeometry.fromWkt('PointM(1 2 3)'))
self.assertEqual(g.asWkt(), 'PointM (1 2 3)')
g = da.splitGeometryAtAntimeridian(QgsGeometry.fromWkt('LineString()'))
g = da.splitGeometryAtAntimeridian(QgsGeometry.fromWkt('LineString EMPTY'))
self.assertEqual(g.asWkt(), 'MultiLineString EMPTY')

# lines
@@ -842,7 +842,7 @@ def testReferenceGeometry(self):
"Perimeter {}: mismatch Expected:\n{}\nGot:\n{}\n".format(i + 1, exp, result))

def testCollection(self):
g = QgsGeometry.fromWkt('MultiLineString()')
g = QgsGeometry.fromWkt('MultiLineString EMPTY')
self.assertEqual(len(g.get()), 0)
self.assertTrue(g.get())
g = QgsGeometry.fromWkt('MultiLineString((0 0, 1 1),(13 2, 14 1))')
@@ -4528,7 +4528,7 @@ def testCurveSinuosity(self):
"""
Test curve straightDistance2d() and sinuosity()
"""
linestring = QgsGeometry.fromWkt('LineString()')
linestring = QgsGeometry.fromWkt('LineString EMPTY')
self.assertTrue(math.isnan(linestring.constGet().straightDistance2d()))
self.assertTrue(math.isnan(linestring.constGet().sinuosity()))
linestring = QgsGeometry.fromWkt('LineString(0 0, 10 0)')
@@ -4844,7 +4844,7 @@ def testPolygonize(self):
empty = QgsGeometry()
o = QgsGeometry.polygonize([empty])
self.assertFalse(o)
line = QgsGeometry.fromWkt('LineString()')
line = QgsGeometry.fromWkt('LineString EMPTY')
o = QgsGeometry.polygonize([line])
self.assertFalse(o)

@@ -4873,7 +4873,7 @@ def testDelaunayTriangulation(self):
empty = QgsGeometry()
o = empty.delaunayTriangulation()
self.assertFalse(o)
line = QgsGeometry.fromWkt('LineString()')
line = QgsGeometry.fromWkt('LineString EMPTY')
o = line.delaunayTriangulation()
self.assertFalse(o)

@@ -4952,7 +4952,7 @@ def testVoronoi(self):
empty = QgsGeometry()
o = empty.voronoiDiagram()
self.assertFalse(o)
line = QgsGeometry.fromWkt('LineString()')
line = QgsGeometry.fromWkt('LineString EMPTY')
o = line.voronoiDiagram()
self.assertFalse(o)

0 comments on commit c21e563

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