Skip to content

Commit

Permalink
Show curve point radius in infotool and fix bug in geometryutils
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed May 27, 2016
1 parent 33977d1 commit 64e05ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/core/geometry/qgsgeometryutils.cpp
Expand Up @@ -83,6 +83,7 @@ QgsPointV2 QgsGeometryUtils::closestVertex( const QgsAbstractGeometryV2& geom, c
id.part = vertexId.part;
id.ring = vertexId.ring;
id.vertex = vertexId.vertex;
id.type = vertexId.type;
}
}

Expand Down
12 changes: 12 additions & 0 deletions src/gui/qgsmaptoolidentify.cpp
Expand Up @@ -310,6 +310,18 @@ void QgsMapToolIdentify::closestVertexAttributes( const QgsAbstractGeometryV2& g
str = QLocale::system().toString( closestPoint.m(), 'g', 10 );
derivedAttributes.insert( "Closest vertex M", str );
}

if ( vId.type == QgsVertexId::CurveVertex )
{
double radius, centerX, centerY;
QgsVertexId vIdBefore = vId;
--vIdBefore.vertex;
QgsVertexId vIdAfter = vId;
++vIdAfter.vertex;
QgsGeometryUtils::circleCenterRadius( geometry.vertexAt( vIdBefore ), geometry.vertexAt( vId ),
geometry.vertexAt( vIdAfter ), radius, centerX, centerY );
derivedAttributes.insert( "Closest vertex radius", QLocale::system().toString( radius ) );
}
}

QString QgsMapToolIdentify::formatCoordinate( const QgsPoint& canvasPoint ) const
Expand Down

0 comments on commit 64e05ff

Please sign in to comment.