Skip to content

Commit

Permalink
Don't use linestring() wkt but linestring empty
Browse files Browse the repository at this point in the history
  • Loading branch information
lbartoletti committed Aug 24, 2020
1 parent 56b603a commit c21e563
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/src/python/test_qgsdistancearea.py
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions tests/src/python/test_qgsgeometry.py
Expand Up @@ -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))')
Expand Down Expand Up @@ -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)')
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit c21e563

Please sign in to comment.