-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resurrect display of interpolated z/m in identify results #7607
Conversation
add closest point x/y (closest point on geometry) Add tests Fixes qgis#19403
src/gui/qgsmaptoolidentify.cpp
Outdated
@@ -374,6 +374,25 @@ void QgsMapToolIdentify::closestVertexAttributes( const QgsAbstractGeometry &geo | |||
} | |||
} | |||
|
|||
void QgsMapToolIdentify::closestPointAttributes( const QgsAbstractGeometry &geometry, const QgsPointXY &layerPoint, QMap<QString, QString> &derivedAttributes ) | |||
{ | |||
QgsPoint closestPoint = QgsGeometryUtils::closestPoint( geometry, QgsPoint( layerPoint.x(), layerPoint.y() ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have a QgsPoint::toPointXY
method and vice versa.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually there's already QgsPointXY( const QgsPoint &point )
, I'll just use that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we just want to remove the explicit part there for the direction QgsPointXY -> QgsPoint (and leave it for the other one)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implicit conversions scare me 😨
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just look at it as upcasting ;)
QgsMapLayer* l = myVectorLayer; // ok
QgsVectorLayer* l = myMapLayer; // not gonna be that easy
Fixes https://issues.qgis.org/issues/19403, and adds tests