Skip to content
Permalink
Browse files

Server WFST: use srsName when needed

Fixes #39371
  • Loading branch information
elpaso committed Oct 14, 2020
1 parent a3d6965 commit c1e8eb4d1fca9e5ca6c1ae39130a4b6456b2c1cf
@@ -711,7 +711,7 @@ namespace QgsWfs
QgsFeatureList featureList;
try
{
featureList = featuresFromGML( action.featureNodeList, provider );
featureList = featuresFromGML( action.featureNodeList, vlayer );
}
catch ( QgsOgcServiceException &ex )
{
@@ -786,11 +786,13 @@ namespace QgsWfs
filterRestorer.reset();
}

QgsFeatureList featuresFromGML( QDomNodeList featureNodeList, QgsVectorDataProvider *provider )
QgsFeatureList featuresFromGML( QDomNodeList featureNodeList, QgsVectorLayer *layer )
{
// Store the inserted features
QgsFeatureList featList;

const QgsVectorDataProvider *provider { layer->dataProvider() };

// Get Layer Field Information
QgsFields fields = provider->fields();
const QMap<QString, int> fieldMap = provider->fieldNameMap();
@@ -839,7 +841,8 @@ namespace QgsWfs
}
else //a geometry attribute
{
QgsGeometry g = QgsOgcUtils::geometryFromGML( currentAttributeElement );
const QgsOgcUtils::Context context { layer, provider->transformContext() };
QgsGeometry g = QgsOgcUtils::geometryFromGML( currentAttributeElement, context );
if ( g.isNull() )
{
throw QgsRequestNotWellFormedException( QStringLiteral( "Geometry from GML error on layer insert" ) );
@@ -112,7 +112,7 @@ namespace QgsWfs
/**
* Transform GML feature nodes to features
*/
QgsFeatureList featuresFromGML( QDomNodeList featureNodeList, QgsVectorDataProvider *provider );
QgsFeatureList featuresFromGML( QDomNodeList featureNodeList, QgsVectorLayer *layer );

/**
* Perform the transaction
@@ -461,7 +461,9 @@ namespace QgsWfs

if ( !geometryElem.isNull() )
{
QgsGeometry g = QgsOgcUtils::geometryFromGML( geometryElem );
const QgsOgcUtils::Context context { vlayer, provider->transformContext() };
QgsGeometry g = QgsOgcUtils::geometryFromGML( geometryElem, context );

if ( g.isNull() )
{
action.error = true;

0 comments on commit c1e8eb4

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