Skip to content
Permalink
Browse files

Fix crash and missing closest vertex in WMS identify

... in "feature" mode.

Fixes #29443
  • Loading branch information
elpaso authored and nyalldawson committed Jun 12, 2020
1 parent d8b3ada commit 3ef7d89a354fbc48e06ab8458a35a9a47cd26d1f
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/gui/qgsmaptoolidentify.cpp
@@ -578,6 +578,13 @@ bool QgsMapToolIdentify::identifyVectorLayer( QList<QgsMapToolIdentify::Identify

void QgsMapToolIdentify::closestVertexAttributes( const QgsAbstractGeometry &geometry, QgsVertexId vId, QgsMapLayer *layer, QMap< QString, QString > &derivedAttributes )
{
if ( ! vId.isValid( ) )
{
// We should not get here ...
QgsDebugMsg( "Invalid vertex id!" );
return;
}

QString str = QLocale().toString( vId.vertex + 1 );
derivedAttributes.insert( tr( "Closest vertex number" ), str );

@@ -673,6 +680,8 @@ QMap< QString, QString > QgsMapToolIdentify::featureDerivedAttributes( const Qgs
closestPoint = QgsGeometryUtils::closestVertex( *feature.geometry().constGet(), QgsPoint( layerPoint ), vId );
}



if ( QgsWkbTypes::isMultiType( wkbType ) )
{
QString str = QLocale().toString( static_cast<const QgsGeometryCollection *>( feature.geometry().constGet() )->numGeometries() );
@@ -982,7 +991,7 @@ bool QgsMapToolIdentify::identifyRasterLayer( QList<IdentifyResult> *results, Qg
}

QMap< QString, QString > derAttributes = derivedAttributes;
derAttributes.unite( featureDerivedAttributes( feature, layer ) );
derAttributes.unite( featureDerivedAttributes( feature, layer, toLayerCoordinates( layer, point ) ) );

IdentifyResult identifyResult( qobject_cast<QgsMapLayer *>( layer ), labels.join( QStringLiteral( " / " ) ), featureStore.fields(), feature, derAttributes );

0 comments on commit 3ef7d89

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