Skip to content
Permalink
Browse files

Use CRS in json geometry

  • Loading branch information
pblottiere committed Jan 24, 2019
1 parent aa55beb commit 130be380ecd1c8cda401a58e936f595c1180546e
Showing with 22 additions and 1 deletion.
  1. +22 −1 src/server/services/wms/qgswmsrenderer.cpp
@@ -2319,7 +2319,28 @@ namespace QgsWms
{
const QDomElement featureNode = featuresNode.at( j ).toElement();
const QgsFeatureId fid = featureNode.attribute( QStringLiteral( "id" ) ).toLongLong();
const QgsFeature feature = vl->getFeature( fid );
QgsFeature feature = QgsFeature( vl->getFeature( fid ) );

QString wkt;
if ( withGeometry )
{
const QDomNodeList attrs = featureNode.elementsByTagName( "Attribute" );
for ( int k = 0; k < attrs.count(); k++ )
{
const QDomElement elm = attrs.at( k ).toElement();
if ( elm.attribute( QStringLiteral( "name" ) ).compare( "geometry" ) == 0 )
{
wkt = elm.attribute( "value" );
break;
}
}

if ( ! wkt.isEmpty() )
{
// CRS in WMS parameters may be different from the layer
feature.setGeometry( QgsGeometry::fromWkt( wkt ) );
}
}
features << feature;

// search attributes to export (one time only)

0 comments on commit 130be38

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