Skip to content
Permalink
Browse files

Fix for simple geometries insert error in WFS-T

Fixes #14139 Error inserting feature in WFS-T server
  • Loading branch information
elpaso committed Mar 30, 2016
1 parent dccd731 commit 768416340fdf233f8f5ce8945636d8df8b2e4f48
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/providers/wfs/qgswfsprovider.cpp
@@ -347,7 +347,14 @@ bool QgsWFSProvider::addFeatures( QgsFeatureList &flist )

//add geometry column (as gml)
QDomElement geomElem = transactionDoc.createElementNS( mWfsNamespace, mGeometryAttribute );
QDomElement gmlElem = QgsOgcUtils::geometryToGML( featureIt->constGeometry(), transactionDoc );

QgsGeometry the_geom( *featureIt->constGeometry() );
// convert to multi if the layer geom type is multi and the geom is not
if ( QGis::isMultiType( this->geometryType( ) ) && ! the_geom.isMultipart( ) )
{
the_geom.convertToMultiType();
}
QDomElement gmlElem = QgsOgcUtils::geometryToGML( &the_geom, transactionDoc );
if ( !gmlElem.isNull() )
{
gmlElem.setAttribute( "srsName", crs().authid() );
@@ -1409,6 +1416,7 @@ bool QgsWFSProvider::sendTransactionDocument( const QDomDocument& doc, QDomDocum

request.setHeader( QNetworkRequest::ContentTypeHeader, "text/xml" );
QNetworkReply* reply = QgsNetworkAccessManager::instance()->post( request, doc.toByteArray( -1 ) );
QgsDebugMsg( "WFS transaction: " + doc.toByteArray( ) );

connect( reply, SIGNAL( finished() ), this, SLOT( networkRequestFinished() ) );
while ( !mNetworkRequestFinished )

0 comments on commit 7684163

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