-
-
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
[Bugfix] Fix MeasureTool when DestinationCRS changes (fixes #15182) #3262
Conversation
@ahuarte47 nice! There's already a test case for the measure dialog, do you mind adding a test fit this? |
Done! |
QgsPoint n0 = tool2->points()[0]; | ||
QgsPoint n1 = tool2->points()[1]; | ||
|
||
QVERIFY( qgsDoubleNear( p0.x(), n0.x(), 0.001 ) ); |
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.
There's now QGSCOMPARENEAR
which is nicer if it comes to debugging
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.
Thanks @m-kuhn !
1885ecf
to
5319202
Compare
|
||
Q_FOREACH ( const QgsPoint& previousPoint, points ) | ||
{ | ||
QgsPoint point = ct.transform( previousPoint ); |
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.
Sorry - one last thing. You should probably catch any QgsCsExceptions here and skip the point
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.
Thanks @nyalldawson !
5319202
to
70d2c9b
Compare
Good fix - thanks! One thing I noticed during testing is that the rubber band points/lines aren't redrawn if the measure points have been finished. So the dialog values are correctly updated, but the measured line isn't redrawn in the new projection. |
Hi @nyalldawson, you are right, I created another pull to fix it. Thanks to all for your advices! |
MeasureTool fails when the user changes the destination crs of the MapCanvas while the user is digitizing a measure.
The MeasureDialog shows wrong measures and the digitised geometries disappear of the map.
This pull fixes the issue https://hub.qgis.org/issues/15182