Skip to content

Commit fdc85ba

Browse files
committedOct 12, 2015
[Geometry checker] Make self intersection fix create a linear polygon if original feature was one
1 parent 01a7674 commit fdc85ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/plugins/geometry_checker/checks/qgsgeometryselfintersectioncheck.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
***************************************************************************/
77

88
#include "qgsgeometryselfintersectioncheck.h"
9-
#include "qgscurvepolygonv2.h"
9+
#include "qgspolygonv2.h"
1010
#include "qgslinestringv2.h"
1111
#include "qgsgeometryengine.h"
1212
#include "qgsmultipolygonv2.h"
@@ -193,7 +193,8 @@ void QgsGeometrySelfIntersectionCheck::fixError( QgsGeometryCheckError* error, i
193193
// If ring is exterior, build two polygons, and reassign interiors as necessary
194194
poly->setExteriorRing( ringGeom1 );
195195

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

199200
// Reassing interiors as necessary

0 commit comments

Comments
 (0)
Please sign in to comment.