Skip to content
Permalink
Browse files
[FEATURE]: append the feature geometry to the feature info (probably …
…make that optionally in the future with a new request parameter)

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14275 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Sep 23, 2010
1 parent a918b88 commit 2639de65109b7d2350aea31a52cb961418e54347
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/mapserver/qgswmsserver.cpp
@@ -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"
@@ -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;
}

0 comments on commit 2639de6

Please sign in to comment.