Skip to content

Commit 58878d0

Browse files
committed
[Geometry] Simplify QgsCurvePolygonV2::asGML3
Get back to simple code
1 parent 74042a2 commit 58878d0

1 file changed

Lines changed: 6 additions & 17 deletions

File tree

src/core/geometry/qgscurvepolygonv2.cpp

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -320,30 +320,19 @@ QDomElement QgsCurvePolygonV2::asGML3( QDomDocument& doc, int precision, const Q
320320
{
321321
QDomElement elemCurvePolygon = doc.createElementNS( ns, "Polygon" );
322322
QDomElement elemExterior = doc.createElementNS( ns, "exterior" );
323-
QDomElement outerRing = exteriorRing()->asGML3( doc, precision, ns );
324-
if ( outerRing.tagName() == QString( "Curve" ) )
323+
QDomElement curveElem = exteriorRing()->asGML3( doc, precision, ns );
324+
if ( curveElem.tagName() == "LineString" )
325325
{
326-
QDomNodeList posListElements = outerRing.elementsByTagName( "posList" );
327-
outerRing = doc.createElementNS( ns, "LinearRing" );
328-
outerRing.appendChild( posListElements.at( 0 ) );
326+
curveElem.setTagName( "LinearRing" );
329327
}
330-
else
331-
{
332-
outerRing.setTagName( "LinearRing" );
333-
}
334-
elemExterior.appendChild( outerRing );
328+
elemExterior.appendChild( curveElem );
335329
elemCurvePolygon.appendChild( elemExterior );
330+
336331
for ( int i = 0, n = numInteriorRings(); i < n; ++i )
337332
{
338333
QDomElement elemInterior = doc.createElementNS( ns, "interior" );
339334
QDomElement innerRing = interiorRing( i )->asGML3( doc, precision, ns );
340-
if ( innerRing.tagName() == QString( "Curve" ) )
341-
{
342-
QDomNodeList posListElements = innerRing.elementsByTagName( "posList" );
343-
innerRing = doc.createElementNS( ns, "LinearRing" );
344-
innerRing.appendChild( posListElements.at( 0 ) );
345-
}
346-
else
335+
if ( innerRing.tagName() == "LineString" )
347336
{
348337
innerRing.setTagName( "LinearRing" );
349338
}

0 commit comments

Comments
 (0)