Skip to content
Permalink
Browse files

[Geometry] Simplify QgsCurvePolygonV2::asGML3

Get back to simple code
  • Loading branch information
rldhont committed Jul 4, 2017
1 parent 74042a2 commit 58878d08294916cd3d814d0a1a4da630e3ab9e11
Showing with 6 additions and 17 deletions.
  1. +6 −17 src/core/geometry/qgscurvepolygonv2.cpp
@@ -320,30 +320,19 @@ QDomElement QgsCurvePolygonV2::asGML3( QDomDocument& doc, int precision, const Q
{
QDomElement elemCurvePolygon = doc.createElementNS( ns, "Polygon" );
QDomElement elemExterior = doc.createElementNS( ns, "exterior" );
QDomElement outerRing = exteriorRing()->asGML3( doc, precision, ns );
if ( outerRing.tagName() == QString( "Curve" ) )
QDomElement curveElem = exteriorRing()->asGML3( doc, precision, ns );
if ( curveElem.tagName() == "LineString" )
{
QDomNodeList posListElements = outerRing.elementsByTagName( "posList" );
outerRing = doc.createElementNS( ns, "LinearRing" );
outerRing.appendChild( posListElements.at( 0 ) );
curveElem.setTagName( "LinearRing" );
}
else
{
outerRing.setTagName( "LinearRing" );
}
elemExterior.appendChild( outerRing );
elemExterior.appendChild( curveElem );
elemCurvePolygon.appendChild( elemExterior );

for ( int i = 0, n = numInteriorRings(); i < n; ++i )
{
QDomElement elemInterior = doc.createElementNS( ns, "interior" );
QDomElement innerRing = interiorRing( i )->asGML3( doc, precision, ns );
if ( innerRing.tagName() == QString( "Curve" ) )
{
QDomNodeList posListElements = innerRing.elementsByTagName( "posList" );
innerRing = doc.createElementNS( ns, "LinearRing" );
innerRing.appendChild( posListElements.at( 0 ) );
}
else
if ( innerRing.tagName() == "LineString" )
{
innerRing.setTagName( "LinearRing" );
}

0 comments on commit 58878d0

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