2

According to the C++ code in qgsgeorefmainwindow.cpp I tried to retrieve the Georeferencer target CRS with PyQGIS using QgsSettings().value("/Plugin-GeoReferencer/targetsrs") but unfortunately this failed (QGIS 3.40.1 Windows).

QgsSettings settings;
// default to last used target CRS
QString targetCRSString = settings.value( QStringLiteral( "/Plugin-GeoReferencer/targetsrs" ) ).toString();
mTargetCrs = QgsCoordinateReferenceSystem( targetCRSString );

How can I obtain the correct value here?

1 Answer 1

2

It looks like bug: such setting is never saved in the QGIS.ini file.

Please create an issue report at https://github.com/qgis/QGIS/issues.

3
  • That's exactly what I found out too, just needed a confirmation. Do you know if there is a workaround to get the data directly from QgsTransformSettingsDialog?
    – christoph
    Commented yesterday
  • 1
    I've submitted a fix for such issue: github.com/qgis/QGIS/pull/59903. Commented yesterday
  • many thanks for the quick help!
    – christoph
    Commented 16 hours ago

Not the answer you're looking for? Browse other questions tagged or ask your own question.