Skip to content
Permalink
Browse files

[Geometry checker] Ignore zero-length edges when searching for shared…

… edges
  • Loading branch information
manisandro committed Jul 14, 2016
1 parent 13da9f5 commit 046386e1dc804feaad165a37605b1dcd018a2c13
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/plugins/geometry_checker/utils/qgsgeometrycheckerutils.cpp
@@ -75,7 +75,16 @@ namespace QgsGeometryCheckerUtils
QgsPointV2 p2 = geom1->vertexAt( QgsVertexId( iPart1, iRing1, jVert1 ) );
double lambdap1 = 0.;
double lambdap2 = qSqrt( QgsGeometryUtils::sqrDistance2D( p1, p2 ) );
QgsVector d = QgsVector( p2.x() - p1.x(), p2.y() - p1.y() ).normalized();
QgsVector d;
try
{
d = QgsVector( p2.x() - p1.x(), p2.y() - p1.y() ).normalized();
}
catch ( const QgsException& )
{
// Edge has zero length, skip
continue;
}

for ( int iPart2 = 0, nParts2 = geom2->partCount(); iPart2 < nParts2; ++iPart2 )
{

0 comments on commit 046386e

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