Skip to main content
added 29 characters in body
Source Link
Taras
  • 34.1k
  • 4
  • 73
  • 148

Instead of AuthId, you could use the CrsId in this way:

from qgis.gui import QgsGenericProjectionSelector

projSelector = QgsGenericProjectionSelector()
projSelector.exec_()
crsId = projSelector.selectedCrsId()

target_crs = QgsCoordinateReferenceSystem()
target_crs.createFromId( crsId, QgsCoordinateReferenceSystem.InternalCrsId )
iface.mapCanvas().setDestinationCrs( target_crs )
from qgis.gui import QgsGenericProjectionSelector

projSelector = QgsGenericProjectionSelector()
projSelector.exec_()
crsId = projSelector.selectedCrsId()

target_crs = QgsCoordinateReferenceSystem()
target_crs.createFromId( crsId, QgsCoordinateReferenceSystem.InternalCrsId )
iface.mapCanvas().setDestinationCrs( target_crs )

Instead of AuthId, you could use the CrsId in this way:

from qgis.gui import QgsGenericProjectionSelector

projSelector = QgsGenericProjectionSelector()
projSelector.exec_()
crsId = projSelector.selectedCrsId()

target_crs = QgsCoordinateReferenceSystem()
target_crs.createFromId( crsId, QgsCoordinateReferenceSystem.InternalCrsId )
iface.mapCanvas().setDestinationCrs( target_crs )

Instead of AuthId, you could use the CrsId in this way:

from qgis.gui import QgsGenericProjectionSelector

projSelector = QgsGenericProjectionSelector()
projSelector.exec_()
crsId = projSelector.selectedCrsId()

target_crs = QgsCoordinateReferenceSystem()
target_crs.createFromId( crsId, QgsCoordinateReferenceSystem.InternalCrsId )
iface.mapCanvas().setDestinationCrs( target_crs )
Source Link
Germán Carrillo
  • 37k
  • 5
  • 125
  • 180

Instead of AuthId, you could use the CrsId in this way:

from qgis.gui import QgsGenericProjectionSelector

projSelector = QgsGenericProjectionSelector()
projSelector.exec_()
crsId = projSelector.selectedCrsId()

target_crs = QgsCoordinateReferenceSystem()
target_crs.createFromId( crsId, QgsCoordinateReferenceSystem.InternalCrsId )
iface.mapCanvas().setDestinationCrs( target_crs )