Skip to content

Commit 1a9501b

Browse files
olivierdalangnyalldawson
authored andcommitted
fix convertToCurve not converting CURVEPOLYGON (failing test case)
1 parent 7b3667e commit 1a9501b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/src/python/test_qgsgeometry.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -5570,8 +5570,11 @@ def testConvertToCurves(self):
55705570
["LINESTRING(-13151357.927248 3913656.64539871,-13151419.0845266 3913664.12016378,-13151441.323537 3913666.61175286,-13151456.8908442 3913666.61175286,-13151476.9059536 3913666.61175286,-13151496.921063 3913666.61175287,-13151521.3839744 3913666.61175287,-13151591.4368571 3913665.36595828)",
55715571
"CompoundCurve ((-13151357.92724799923598766 3913656.64539870992302895, -13151419.08452660031616688 3913664.12016378017142415, -13151441.32353699952363968 3913666.61175285978242755, -13151456.8908441998064518 3913666.61175285978242755, -13151476.90595359914004803 3913666.61175285978242755, -13151496.92106300033628941 3913666.61175287002697587, -13151521.38397439941763878 3913666.61175287002697587, -13151591.43685710057616234 3913665.36595827993005514))", 0.000001, 0.0000001],
55725572
["Point( 1 2 )", "Point( 1 2 )", 0.00001, 0.00001],
5573-
["MultiPoint( 1 2, 3 4 )", "MultiPoint( (1 2 ), (3 4 ))", 0.00001, 0.00001]
5574-
5573+
["MultiPoint( 1 2, 3 4 )", "MultiPoint( (1 2 ), (3 4 ))", 0.00001, 0.00001],
5574+
# A polygon converts to curve
5575+
["POLYGON((3 3,2.4142135623731 1.58578643762691,1 1,-0.414213562373092 1.5857864376269,-1 2.99999999999999,-0.414213562373101 4.41421356237309,0.999999999999991 5,2.41421356237309 4.4142135623731,3 3))", "CURVEPOLYGON(COMPOUNDCURVE(CircularString(3 3, -1 2.99999999999998979, 3 3)))", 0.00000001, 0.00000001],
5576+
# The same polygon, even if already CURVEPOLYGON, still converts to curve
5577+
["CURVEPOLYGON((3 3,2.4142135623731 1.58578643762691,1 1,-0.414213562373092 1.5857864376269,-1 2.99999999999999,-0.414213562373101 4.41421356237309,0.999999999999991 5,2.41421356237309 4.4142135623731,3 3))", "CURVEPOLYGON(COMPOUNDCURVE(CircularString(3 3, -1 2.99999999999998979, 3 3)))", 0.00000001, 0.00000001],
55755578
]
55765579
for t in tests:
55775580
g1 = QgsGeometry.fromWkt(t[0])

0 commit comments

Comments
 (0)