Skip to content
Permalink
Browse files

Merge pull request #2365 from manisandro/geom_checker_fixes

Geometry checker fixes
  • Loading branch information
mhugent committed Oct 12, 2015
2 parents de8b045 + c1028ef commit 5f82f1b11ef4a0e7a5e2b5f955692fc611800e2a
@@ -6,11 +6,11 @@
***************************************************************************/

#include "qgsgeometryselfintersectioncheck.h"
#include "qgscurvepolygonv2.h"
#include "qgspolygonv2.h"
#include "qgslinestringv2.h"
#include "qgsgeometryengine.h"
#include "qgsmultipolygonv2.h"
#include "qgsmulticurvev2.h"
#include "qgsmultilinestringv2.h"
#include "qgsgeometryutils.h"
#include "../utils/qgsfeaturepool.h"

@@ -193,7 +193,8 @@ void QgsGeometrySelfIntersectionCheck::fixError( QgsGeometryCheckError* error, i
// If ring is exterior, build two polygons, and reassign interiors as necessary
poly->setExteriorRing( ringGeom1 );

QgsCurvePolygonV2* poly2 = new QgsCurvePolygonV2();
// If original feature was a linear polygon, also create the new part as a linear polygon
QgsCurvePolygonV2* poly2 = dynamic_cast<QgsPolygonV2*>( part ) ? new QgsPolygonV2() : new QgsCurvePolygonV2();
poly2->setExteriorRing( ringGeom2 );

// Reassing interiors as necessary
@@ -265,7 +266,7 @@ void QgsGeometrySelfIntersectionCheck::fixError( QgsGeometryCheckError* error, i
}
else
{
QgsMultiCurveV2* geomCollection = new QgsMultiCurveV2();
QgsMultiCurveV2* geomCollection = new QgsMultiLineStringV2();
geomCollection->addGeometry( ringGeom1 );
geomCollection->addGeometry( ringGeom2 );
feature.setGeometry( new QgsGeometry( geomCollection ) );
@@ -323,7 +323,7 @@ void QgsGeometryCheckerResultTab::highlightErrors( bool current )
if ( ui.checkBoxHighlight->isChecked() && geometry )
{
QgsRubberBand* featureRubberBand = new QgsRubberBand( mIface->mapCanvas() );
QgsGeometry geom( geometry );
QgsGeometry geom( geometry->clone() );
featureRubberBand->addGeometry( &geom, mFeaturePool->getLayer() );
featureRubberBand->setWidth( 5 );
featureRubberBand->setColor( Qt::yellow );

0 comments on commit 5f82f1b

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