Skip to content
Permalink
Browse files

[Geometry checker] Fix crash in QgsGeometryAreaCheck::mergeWithNeighb…

…or due to incorrect code ordering
  • Loading branch information
manisandro committed Mar 24, 2016
1 parent d3e08da commit a0b9877b3d032d61cdcc1a7082f65dff450f24d9
Showing with 8 additions and 8 deletions.
  1. +8 −8 src/plugins/geometry_checker/checks/qgsgeometryareacheck.cpp
@@ -182,14 +182,6 @@ bool QgsGeometryAreaCheck::mergeWithNeighbor( QgsFeature& feature, int partIdx,
return method == MergeIdenticalAttribute ? true : false;
}


// Remove polygon from source geometry
deleteFeatureGeometryPart( feature, partIdx, changes );
if ( mergeFeature.id() == feature.id() && mergePartIdx > partIdx )
{
--mergePartIdx;
}

// Merge geometries
QgsAbstractGeometryV2* mergeGeom = mergeFeature.geometry()->geometry();
QgsGeometryEngine* geomEngine = QgsGeomUtils::createGeomEngine( QgsGeomUtils::getGeomPart( mergeGeom, mergePartIdx ), QgsGeometryCheckPrecision::tolerance() );
@@ -199,6 +191,14 @@ bool QgsGeometryAreaCheck::mergeWithNeighbor( QgsFeature& feature, int partIdx,
{
return false;
}

// Remove polygon from source geometry
deleteFeatureGeometryPart( feature, partIdx, changes );
if ( mergeFeature.id() == feature.id() && mergePartIdx > partIdx )
{
--mergePartIdx;
}
// Replace polygon in merge geometry
replaceFeatureGeometryPart( mergeFeature, mergePartIdx, combinedGeom, changes );

return true;

0 comments on commit a0b9877

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