Skip to content

Commit d7d8789

Browse files
author
mhugent
committedSep 23, 2010
[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@14275 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent f13cebe commit d7d8789

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎src/mapserver/qgswmsserver.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "qgsconfigparser.h"
1919
#include "qgsepsgcache.h"
2020
#include "qgsfield.h"
21+
#include "qgsgeometry.h"
2122
#include "qgsmaplayer.h"
2223
#include "qgsmaplayerregistry.h"
2324
#include "qgsmaprenderer.h"
@@ -953,7 +954,19 @@ int QgsWMSServer::featureInfoFromVectorLayer( QgsVectorLayer* layer, const QgsPo
953954
attributeElement.setAttribute( "value", it->toString() );
954955
featureElement.appendChild( attributeElement );
955956
}
957+
958+
//also append the wkt geometry as an attribute
959+
QgsGeometry* geom = feature.geometry();
960+
if ( geom )
961+
{
962+
QDomElement geometryElement = infoDocument.createElement( "Attribute" );
963+
geometryElement.setAttribute( "name", "geometry" );
964+
geometryElement.setAttribute( "value", geom->exportToWkt() );
965+
featureElement.appendChild( geometryElement );
966+
}
956967
}
968+
969+
957970
return 0;
958971
}
959972

0 commit comments

Comments
 (0)
Please sign in to comment.