Skip to content

Commit 64e05ff

Browse files
committed
Show curve point radius in infotool and fix bug in geometryutils
1 parent 33977d1 commit 64e05ff

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/core/geometry/qgsgeometryutils.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ QgsPointV2 QgsGeometryUtils::closestVertex( const QgsAbstractGeometryV2& geom, c
8383
id.part = vertexId.part;
8484
id.ring = vertexId.ring;
8585
id.vertex = vertexId.vertex;
86+
id.type = vertexId.type;
8687
}
8788
}
8889

src/gui/qgsmaptoolidentify.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,18 @@ void QgsMapToolIdentify::closestVertexAttributes( const QgsAbstractGeometryV2& g
310310
str = QLocale::system().toString( closestPoint.m(), 'g', 10 );
311311
derivedAttributes.insert( "Closest vertex M", str );
312312
}
313+
314+
if ( vId.type == QgsVertexId::CurveVertex )
315+
{
316+
double radius, centerX, centerY;
317+
QgsVertexId vIdBefore = vId;
318+
--vIdBefore.vertex;
319+
QgsVertexId vIdAfter = vId;
320+
++vIdAfter.vertex;
321+
QgsGeometryUtils::circleCenterRadius( geometry.vertexAt( vIdBefore ), geometry.vertexAt( vId ),
322+
geometry.vertexAt( vIdAfter ), radius, centerX, centerY );
323+
derivedAttributes.insert( "Closest vertex radius", QLocale::system().toString( radius ) );
324+
}
313325
}
314326

315327
QString QgsMapToolIdentify::formatCoordinate( const QgsPoint& canvasPoint ) const

0 commit comments

Comments
 (0)