@@ -65,6 +65,7 @@ class TestQgsCurvePolygon: public QObject
65
65
void testWKB ();
66
66
void testWKT ();
67
67
void testExport ();
68
+ void testExportOfCompoundCurveRing ();
68
69
void testCast ();
69
70
void removeInteriorRings_github_issue_49578 ();
70
71
};
@@ -1738,7 +1739,7 @@ void TestQgsCurvePolygon::testExport()
1738
1739
QGSCOMPAREGML ( elemToString ( QgsCurvePolygon ().asGml2 ( doc ) ), expectedGML2empty );
1739
1740
1740
1741
// as GML3
1741
- QString expectedSimpleGML3 ( QStringLiteral ( " <Polygon xmlns=\" gml\" ><exterior xmlns=\" gml\" ><Curve xmlns=\" gml\" ><segments xmlns=\" gml\" ><ArcString xmlns=\" gml\" ><posList xmlns=\" gml\" srsDimension=\" 3\" >0 0 10 1 0 11 2 0 12 1 0.5 13 0 0 10</posList></ArcString></segments></Curve></exterior></Polygon>" ) );
1742
+ QString expectedSimpleGML3 ( QStringLiteral ( " <Polygon xmlns=\" gml\" ><exterior xmlns=\" gml\" ><Ring xmlns= \" gml \" ><curveMember xmlns= \" gml \" >< Curve xmlns=\" gml\" ><segments xmlns=\" gml\" ><ArcString xmlns=\" gml\" ><posList xmlns=\" gml\" srsDimension=\" 3\" >0 0 10 1 0 11 2 0 12 1 0.5 13 0 0 10</posList></ArcString></segments></Curve></curveMember></Ring ></exterior></Polygon>" ) );
1742
1743
res = elemToString ( exportPolygon.asGml3 ( doc, 2 ) );
1743
1744
QCOMPARE ( elemToString ( exportPolygon.asGml3 ( doc ) ), expectedSimpleGML3 );
1744
1745
@@ -1793,15 +1794,27 @@ void TestQgsCurvePolygon::testExport()
1793
1794
QGSCOMPAREGML ( res, expectedGML2prec2 );
1794
1795
1795
1796
// as GML3
1796
- QString expectedGML3 ( QStringLiteral ( " <Polygon xmlns=\" gml\" ><exterior xmlns=\" gml\" ><Curve xmlns=\" gml\" ><segments xmlns=\" gml\" ><ArcString xmlns=\" gml\" ><posList xmlns=\" gml\" srsDimension=\" 3\" >0 0 10 1 0 11 2 0 12 1 0.5 13 0 0 10</posList></ArcString></segments></Curve></exterior><interior xmlns=\" gml\" ><Curve xmlns=\" gml\" ><segments xmlns=\" gml\" ><ArcString xmlns=\" gml\" ><posList xmlns=\" gml\" srsDimension=\" 3\" >0 0 10 0.10000000000000001 0 11 0.20000000000000001 0 12 0.10000000000000001 0.05 13 0 0 10</posList></ArcString></segments></Curve></interior></Polygon>" ) );
1797
+ QString expectedGML3 ( QStringLiteral ( " <Polygon xmlns=\" gml\" ><exterior xmlns=\" gml\" ><Ring xmlns= \" gml \" ><curveMember xmlns= \" gml \" >< Curve xmlns=\" gml\" ><segments xmlns=\" gml\" ><ArcString xmlns=\" gml\" ><posList xmlns=\" gml\" srsDimension=\" 3\" >0 0 10 1 0 11 2 0 12 1 0.5 13 0 0 10</posList></ArcString></segments></Curve></curveMember></Ring></ exterior><interior xmlns=\" gml\" ><Ring xmlns= \" gml \" ><curveMember xmlns= \" gml \" >< Curve xmlns=\" gml\" ><segments xmlns=\" gml\" ><ArcString xmlns=\" gml\" ><posList xmlns=\" gml\" srsDimension=\" 3\" >0 0 10 0.10000000000000001 0 11 0.20000000000000001 0 12 0.10000000000000001 0.05 13 0 0 10</posList></ArcString></segments></Curve></curveMember></Ring ></interior></Polygon>" ) );
1797
1798
res = elemToString ( exportPolygon.asGml3 ( doc ) );
1798
1799
QCOMPARE ( res, expectedGML3 );
1799
1800
1800
- QString expectedGML3prec3 ( QStringLiteral ( " <Polygon xmlns=\" gml\" ><exterior xmlns=\" gml\" ><Curve xmlns=\" gml\" ><segments xmlns=\" gml\" ><ArcString xmlns=\" gml\" ><posList xmlns=\" gml\" srsDimension=\" 3\" >0 0 10 1 0 11 2 0 12 1 0.5 13 0 0 10</posList></ArcString></segments></Curve></exterior><interior xmlns=\" gml\" ><Curve xmlns=\" gml\" ><segments xmlns=\" gml\" ><ArcString xmlns=\" gml\" ><posList xmlns=\" gml\" srsDimension=\" 3\" >0 0 10 0.1 0 11 0.2 0 12 0.1 0.05 13 0 0 10</posList></ArcString></segments></Curve></interior></Polygon>" ) );
1801
+ QString expectedGML3prec3 ( QStringLiteral ( " <Polygon xmlns=\" gml\" ><exterior xmlns=\" gml\" ><Ring xmlns= \" gml \" ><curveMember xmlns= \" gml \" >< Curve xmlns=\" gml\" ><segments xmlns=\" gml\" ><ArcString xmlns=\" gml\" ><posList xmlns=\" gml\" srsDimension=\" 3\" >0 0 10 1 0 11 2 0 12 1 0.5 13 0 0 10</posList></ArcString></segments></Curve></curveMember></Ring></ exterior><interior xmlns=\" gml\" ><Ring xmlns= \" gml \" ><curveMember xmlns= \" gml \" >< Curve xmlns=\" gml\" ><segments xmlns=\" gml\" ><ArcString xmlns=\" gml\" ><posList xmlns=\" gml\" srsDimension=\" 3\" >0 0 10 0.1 0 11 0.2 0 12 0.1 0.05 13 0 0 10</posList></ArcString></segments></Curve></curveMember></Ring ></interior></Polygon>" ) );
1801
1802
res = elemToString ( exportPolygon.asGml3 ( doc, 3 ) );
1802
1803
QCOMPARE ( res, expectedGML3prec3 );
1803
1804
}
1804
1805
1806
+ void TestQgsCurvePolygon::testExportOfCompoundCurveRing ()
1807
+ {
1808
+ QgsCurvePolygon curvePoly;
1809
+ curvePoly.fromWkt ( QStringLiteral ( " CURVEPOLYGON (COMPOUNDCURVE ((0 -1,0 1),CIRCULARSTRING (0 1,1 0,0 -1)))" ) );
1810
+
1811
+ // as GML3
1812
+ QString expectedGML3 ( QStringLiteral ( " <Polygon xmlns=\" gml\" ><exterior xmlns=\" gml\" ><Ring xmlns=\" gml\" ><curveMember xmlns=\" gml\" ><LineString xmlns=\" gml\" ><posList xmlns=\" gml\" srsDimension=\" 2\" >0 -1 0 1</posList></LineString></curveMember><curveMember xmlns=\" gml\" ><Curve xmlns=\" gml\" ><segments xmlns=\" gml\" ><ArcString xmlns=\" gml\" ><posList xmlns=\" gml\" srsDimension=\" 2\" >0 1 1 0 0 -1</posList></ArcString></segments></Curve></curveMember></Ring></exterior></Polygon>" ) );
1813
+ QDomDocument doc ( QStringLiteral ( " gml" ) );
1814
+ QString res = elemToString ( curvePoly.asGml3 ( doc ) );
1815
+ QCOMPARE ( res, expectedGML3 );
1816
+ }
1817
+
1805
1818
void TestQgsCurvePolygon::testCast ()
1806
1819
{
1807
1820
QVERIFY ( !QgsCurvePolygon ().cast ( nullptr ) );
0 commit comments