Skip to content

Commit

Permalink
[processing] Regenerate primary key when running the dissolve algorit…
Browse files Browse the repository at this point in the history
…hm (fixes #55587)
  • Loading branch information
nirvn authored and nyalldawson committed Jan 24, 2024
1 parent b851e7c commit c3738ac
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,21 @@ tests:
geometry:
normalize: True

- algorithm: native:dissolve
name: Dissolve separate disjoint with geopackage input and output
params:
INPUT:
name: custom/pol.gpkg|layername=pol1
type: vector
SEPARATE_DISJOINT: true
results:
OUTPUT:
name: expected/dissolve_pol.gpkg
type: vector
compare:
geometry:
normalize: True

- algorithm: native:dissolve
name: Dissolve separate disjoint with classes
params:
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmdissolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ QVariantMap QgsCollectorAlgorithm::processCollection( const QVariantMap &paramet
throw QgsProcessingException( invalidSourceError( parameters, QStringLiteral( "INPUT" ) ) );

QString dest;
std::unique_ptr< QgsFeatureSink > sink( parameterAsSink( parameters, QStringLiteral( "OUTPUT" ), context, dest, source->fields(), QgsWkbTypes::multiType( source->wkbType() ), source->sourceCrs() ) );
std::unique_ptr< QgsFeatureSink > sink( parameterAsSink( parameters, QStringLiteral( "OUTPUT" ), context, dest, source->fields(), QgsWkbTypes::multiType( source->wkbType() ), source->sourceCrs(), QgsFeatureSink::RegeneratePrimaryKey ) );

if ( !sink )
throw QgsProcessingException( invalidSinkError( parameters, QStringLiteral( "OUTPUT" ) ) );
Expand Down

0 comments on commit c3738ac

Please sign in to comment.