Skip to content

Commit

Permalink
[FEATURE]: append the feature geometry to the feature info (probably …
Browse files Browse the repository at this point in the history
…make that optionally in the future with a new request parameter)

git-svn-id: http://svn.osgeo.org/qgis/trunk@14275 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Sep 23, 2010
1 parent f13cebe commit d7d8789
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/mapserver/qgswmsserver.cpp
Expand Up @@ -18,6 +18,7 @@
#include "qgsconfigparser.h"
#include "qgsepsgcache.h"
#include "qgsfield.h"
#include "qgsgeometry.h"
#include "qgsmaplayer.h"
#include "qgsmaplayerregistry.h"
#include "qgsmaprenderer.h"
Expand Down Expand Up @@ -953,7 +954,19 @@ int QgsWMSServer::featureInfoFromVectorLayer( QgsVectorLayer* layer, const QgsPo
attributeElement.setAttribute( "value", it->toString() );
featureElement.appendChild( attributeElement );
}

//also append the wkt geometry as an attribute
QgsGeometry* geom = feature.geometry();
if ( geom )
{
QDomElement geometryElement = infoDocument.createElement( "Attribute" );
geometryElement.setAttribute( "name", "geometry" );
geometryElement.setAttribute( "value", geom->exportToWkt() );
featureElement.appendChild( geometryElement );
}
}


return 0;
}

Expand Down

0 comments on commit d7d8789

Please sign in to comment.