Skip to content
Permalink
Browse files

[Geometry checker] Fix angle check possibly reporting end nodes of lines

  • Loading branch information
manisandro committed Oct 23, 2017
1 parent 57c348b commit 7a5186684ecfb1044cfcbdcee7cb54db8abd570b
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/plugins/geometry_checker/checks/qgsgeometryanglecheck.cpp
@@ -28,13 +28,14 @@ void QgsGeometryAngleCheck::collectErrors( QList<QgsGeometryCheckError *> &error
{
for ( int iRing = 0, nRings = geom->ringCount( iPart ); iRing < nRings; ++iRing )
{
int nVerts = QgsGeometryCheckerUtils::polyLineSize( geom, iPart, iRing );
bool closed = false;
int nVerts = QgsGeometryCheckerUtils::polyLineSize( geom, iPart, iRing, &closed );
// Less than three points, no angles to check
if ( nVerts < 3 )
{
continue;
}
for ( int iVert = 0; iVert < nVerts; ++iVert )
for ( int iVert = !closed; iVert < nVerts - !closed; ++iVert )
{
const QgsPoint &p1 = geom->vertexAt( QgsVertexId( iPart, iRing, ( iVert - 1 + nVerts ) % nVerts ) );
const QgsPoint &p2 = geom->vertexAt( QgsVertexId( iPart, iRing, iVert ) );

0 comments on commit 7a51866

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