Discard fid columns when exporting features for geopdf documents

Otherwise we run into issues with duplicate fids or incompatible
fid field types due to the geopackage format used as a temporary
store of the rendered features.

Fixes failure to create GeoPDF documents in some circumstances.
This commit is contained in:
Nyall Dawson 2019-09-26 15:17:55 +10:00
parent fdb9b97f4e
commit 3610620fe7

View File

@ -162,7 +162,7 @@ bool QgsAbstractGeoPdfExporter::saveTemporaryLayers()
// write out features to disk
const QgsFeatureList features = it.value();
QString layerName;
QgsVectorFileWriter writer( filePath, QString(), features.first().fields(), features.first().geometry().wkbType(), QgsCoordinateReferenceSystem(), QStringLiteral( "GPKG" ), QStringList(), QStringList(), nullptr, QgsVectorFileWriter::NoSymbology, nullptr, &layerName );
QgsVectorFileWriter writer( filePath, QString(), features.first().fields(), features.first().geometry().wkbType(), QgsCoordinateReferenceSystem(), QStringLiteral( "GPKG" ), QStringList(), QStringList(), nullptr, QgsVectorFileWriter::NoSymbology, QgsFeatureSink::RegeneratePrimaryKey, &layerName );
if ( writer.hasError() )
{
mErrorMessage = writer.errorMessage();