Skip to content

Commit

Permalink
Simplify definition of transform's target CRS parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Kröger committed Feb 3, 2025
1 parent 67288dc commit 7ebc977
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Discovery/discoveryplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,8 @@ def select_result(self, result_data):
geometry_text, src_epsg, suggestion_text, extra_data = result_data
location_geom = QgsGeometry.fromWkt(geometry_text)
canvas = self.iface.mapCanvas()
dst_srid = canvas.mapSettings().destinationCrs().authid()
transform = QgsCoordinateTransform(QgsCoordinateReferenceSystem.fromEpsgId(src_epsg),
QgsCoordinateReferenceSystem(dst_srid),
canvas.mapSettings().destinationCrs(),
canvas.mapSettings().transformContext())
# Ensure the geometry from the DB is reprojected to the same SRID as the map canvas
location_geom.transform(transform)
Expand Down

0 comments on commit 7ebc977

Please sign in to comment.