Bug report #20320

QgsMapCanvas setDestinationCrs doesn't work as expected

Added by Matthew Jurewicz over 5 years ago. Updated over 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Map Canvas
Affected QGIS version:3.2.3 Regression?:No
Operating System:Windows 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:28141

Description

The following Python code shows how the destination CRS isn't set the 2nd time:

crs = QgsCoordinateReferenceSystem()
crs.createFromProj4('+proj=tmerc +ellps=WGS84 +datum=WGS84 +no_defs')
iface.mapCanvas().setDestinationCrs(crs)
iface.mapCanvas().mapSettings().destinationCrs().toProj4()

crs = QgsCoordinateReferenceSystem()
crs.createFromProj4('+proj=tmerc +ellps=WGS84 +datum=WGS84 +no_defs +lon_0=1 +lat_0=1')
iface.mapCanvas().setDestinationCrs(crs)
iface.mapCanvas().mapSettings().destinationCrs().toProj4()

History

#1 Updated by Matthew Jurewicz over 5 years ago

It looks like the issue is a naive QgsCoordinateReferenceSystem == operator.

#2 Updated by Matthew Jurewicz over 5 years ago

Matthew Jurewicz wrote:

It looks like the issue is a naive QgsCoordinateReferenceSystem == operator.

I'll try to create a patch.

#3 Updated by Matthew Jurewicz over 5 years ago

Matthew Jurewicz wrote:

Matthew Jurewicz wrote:

It looks like the issue is a naive QgsCoordinateReferenceSystem == operator.

I'll try to create a patch.

Nevermind, I should be create a custom QGIS CRS with a unique QGIS CRS id. Can someone please cancel this?

#4 Updated by Giovanni Manghi over 5 years ago

  • Resolution set to invalid
  • Status changed from Open to Closed

Also available in: Atom PDF