Skip to content
Permalink
Browse files

Fix for problem with features that cannot be exported to shape

git-svn-id: http://svn.osgeo.org/qgis/trunk@10867 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed May 31, 2009
1 parent 63a5d29 commit 0862fd1b83c5eb10bd23ce1c79a42e88922e3b2d
Showing with 15 additions and 1 deletion.
  1. +15 −1 src/providers/wfs/qgswfsdata.cpp
@@ -313,10 +313,24 @@ void QgsWFSData::endElement( const XML_Char* el )
}
else if ( elementName == GML_NAMESPACE + NS_SEPARATOR + "featureMember" )
{
//MH090531: Check if all feature attributes are initialised, sometimes attribute values are missing.
//We fill the not initialized ones with empty strings, otherwise the feature cannot be exported to shp later
QgsAttributeMap currentFeatureAttributes = mCurrentFeature->attributeMap();
QMap<QString, QPair<int, QgsField> >::const_iterator att_it = mThematicAttributes.constBegin();
for(; att_it != mThematicAttributes.constEnd(); ++att_it)
{
int attIndex = att_it.value().first;
QgsAttributeMap::const_iterator findIt = currentFeatureAttributes.find(attIndex);
if(findIt == currentFeatureAttributes.constEnd())
{
mCurrentFeature->addAttribute(attIndex, QVariant(""));
}
}


mCurrentFeature->setGeometryAndOwnership( mCurrentWKB, mCurrentWKBSize );
mFeatures << mCurrentFeature;
++mFeatureCount;
//qWarning("Removing featureMember from stack");
mParseModeStack.pop();
}
else if ( elementName == GML_NAMESPACE + NS_SEPARATOR + "Point" )

0 comments on commit 0862fd1

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