Skip to content

Commit

Permalink
Take wfs gml directly from geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Feb 10, 2017
1 parent c0eb997 commit 83c62da
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/server/services/wfs/qgswfsgetfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,14 @@ namespace QgsWfs
gmlElem = QgsOgcUtils::geometryToGML( &centroid, doc, prec );
}
else
gmlElem = QgsOgcUtils::geometryToGML( &geom, doc, prec );
{
QgsAbstractGeometry* abstractGeom = geom.geometry();
if ( abstractGeom )
{
gmlElem = abstractGeom->asGML2( doc, prec, "http://www.opengis.net/gml" );
}
}

if ( !gmlElem.isNull() )
{
QgsRectangle box = geom.boundingBox();
Expand Down Expand Up @@ -1237,7 +1244,14 @@ namespace QgsWfs
gmlElem = QgsOgcUtils::geometryToGML( &centroid, doc, QStringLiteral( "GML3" ), prec );
}
else
gmlElem = QgsOgcUtils::geometryToGML( &geom, doc, QStringLiteral( "GML3" ), prec );
{
QgsAbstractGeometry* abstractGeom = geom.geometry();
if ( abstractGeom )
{
gmlElem = abstractGeom->asGML3( doc, prec, "http://www.opengis.net/gml" );
}
}

if ( !gmlElem.isNull() )
{
QgsRectangle box = geom.boundingBox();
Expand Down

0 comments on commit 83c62da

Please sign in to comment.