Skip to content

Commit

Permalink
[Geometry checker] Ignore zero-length edges when searching for shared…
Browse files Browse the repository at this point in the history
… edges
  • Loading branch information
manisandro committed Jul 14, 2016
1 parent 13da9f5 commit 046386e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/plugins/geometry_checker/utils/qgsgeometrycheckerutils.cpp
Expand Up @@ -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 )
{
Expand Down

0 comments on commit 046386e

Please sign in to comment.