Skip to content
Permalink
Browse files

vector file writer: scan shape file geometries instead of just assumi…

…ng multi geometry types (followup 528c4ca, refs #10584, fixes #11542, fixes #11597)
  • Loading branch information
jef-n committed Nov 18, 2014
1 parent a6650e4 commit 881e25ba4795a14ac5aa3e9421097f2e2f3e703a
Showing with 14 additions and 1 deletion.
  1. +14 −1 src/core/qgsvectorfilewriter.cpp
@@ -1869,7 +1869,20 @@ QgsVectorFileWriter::WriterError QgsVectorFileWriter::writeAsVectorFormat( QgsVe
// Shapefiles might contain multi types although wkbType() only reports singles
if ( layer->storageType() == "ESRI Shapefile" )
{
wkbType = QGis::multiType( wkbType );
const QgsFeatureIds &ids = layer->selectedFeaturesIds();
QgsFeatureIterator fit = layer->getFeatures();
QgsFeature fet;
while ( fit.nextFeature( fet ) )
{
if ( onlySelected && !ids.contains( fet.id() ) )
continue;

if ( fet.geometry() && fet.geometry()->wkbType() == QGis::multiType( wkbType ) )
{
wkbType = QGis::multiType( wkbType );
break;
}
}
}
}

0 comments on commit 881e25b

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