Skip to content
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

Query project crs every time the centroid tool is used #187

Merged

Conversation

merydian
Copy link
Collaborator

@merydian merydian commented Oct 31, 2023

And not just once during plugin Initiation.

And not just once during plugin Initiation.
@merydian merydian linked an issue Oct 31, 2023 that may be closed by this pull request
@@ -446,7 +446,7 @@ def _linetool_annotate_point(self, point, idx):
annotation.setFrameSizeMm(QSizeF(7, 5))
annotation.setFrameOffsetFromReferencePointMm(QPointF(1.3, 1.3))
annotation.setMapPosition(point)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the point also be transformed like in the _on_linetool_map_click function?

transformer = transform.transformToWGS(map_crs)
point_wgs = transformer.transform(point)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point is passed from _on_linetool_map_click to _linetool_annotate_point, and it is already transformed, isn't it? Maybe the crs should also be passed and not retrieved again. Or do I still not understand what you mean?

Copy link
Member

@MichaelsJP MichaelsJP Nov 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. Wasn't aware of the sequence the functions are called. If no coordinates reach _linetool_annotate_point without being transformed, forget my comment ;).

Will give you a go

Copy link
Member

@MichaelsJP MichaelsJP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more convenient conversions of point epsg to 4326
2 participants