Skip to content
Permalink
Browse files

Merge pull request #2985 from manisandro/geom_checker_fixes

Geom checker fixes
  • Loading branch information
nyalldawson committed Apr 8, 2016
2 parents d07bc18 + a0b9877 commit edee8768745dd215b56be866e1479cb76d72ddd1
@@ -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;
@@ -70,7 +70,10 @@ QgsAbstractGeometryV2 *QgsGeometryCheckError::geometry()
{
QgsFeature f;
if ( mCheck->getFeaturePool()->get( featureId(), f ) && f.geometry() )
return f.geometry()->geometry()->clone();
{
QgsAbstractGeometryV2* geom = f.geometry()->geometry();
return mVidx.part >= 0 ? QgsGeomUtils::getGeomPart( geom, mVidx.part )->clone() : geom->clone();
}
return nullptr;
}

0 comments on commit edee876

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