2

I am trying to create a dialog that allows the user to select a coordinate system from either the recently used projections or a general list of all available projections. This would basically offer the same functionality as the standard dialog that pops up when you load in a shapefile with no known CRS.

Is there a way to call the "Coordinate Reference System Selector"-dialog from within a plugin? I know it is possible to query the recently used projections and all available projections, but it seems like a lot of overhead to recreate something that is already there in QGIS.

1 Answer 1

2

You should try something like that :

from qgis.gui import QgsGenericProjectionSelector

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

http://qgis.org/api/classQgsGenericProjectionSelector.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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