Skip to content

Commit 3888192

Browse files
committedOct 25, 2017
Fix geometry checker relying on corrupting geometries to fix them
Geometry checker was editing geometries in place, which potentially was corrupting other implicitly shared copies of these geometries.
1 parent 837c1c5 commit 3888192

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎src/analysis/vector/geometry_checker/qgsgeometryselfintersectioncheck.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ void QgsGeometrySelfIntersectionCheck::fixError( QgsGeometryCheckError *error, i
244244
QgsFeature newFeature;
245245
newFeature.setAttributes( feature.attributes() );
246246
newFeature.setGeometry( QgsGeometry( poly2 ) );
247+
feature.setGeometry( featureGeom );
247248
featurePool->updateFeature( feature );
248249
featurePool->addFeature( newFeature );
249250
changes[error->layerId()][feature.id()].append( Change( ChangeRing, ChangeChanged, QgsVertexId( vidx.part, vidx.ring ) ) );
@@ -261,6 +262,7 @@ void QgsGeometrySelfIntersectionCheck::fixError( QgsGeometryCheckError *error, i
261262
geomCollection->removeGeometry( vidx.part );
262263
geomCollection->addGeometry( ringGeom1 );
263264
geomCollection->addGeometry( ringGeom2 );
265+
feature.setGeometry( featureGeom );
264266
featurePool->updateFeature( feature );
265267
changes[error->layerId()][feature.id()].append( Change( ChangePart, ChangeRemoved, QgsVertexId( vidx.part ) ) );
266268
changes[error->layerId()][feature.id()].append( Change( ChangePart, ChangeAdded, QgsVertexId( geomCollection->partCount() - 2 ) ) );

0 commit comments

Comments
 (0)
Please sign in to comment.