本文整理匯總了Python中qgis.gui.QgsGenericProjectionSelector.setSelectedAuthId方法的典型用法代碼示例。如果您正苦於以下問題:Python QgsGenericProjectionSelector.setSelectedAuthId方法的具體用法?Python QgsGenericProjectionSelector.setSelectedAuthId怎麽用?Python QgsGenericProjectionSelector.setSelectedAuthId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qgis.gui.QgsGenericProjectionSelector
的用法示例。
在下文中一共展示了QgsGenericProjectionSelector.setSelectedAuthId方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: browseCRS
# 需要導入模塊: from qgis.gui import QgsGenericProjectionSelector [as 別名]
# 或者: from qgis.gui.QgsGenericProjectionSelector import setSelectedAuthId [as 別名]
def browseCRS(self):
selector = QgsGenericProjectionSelector()
selector.setSelectedAuthId(self.crs)
if selector.exec_():
authId = selector.selectedAuthId()
if authId.upper().startswith("EPSG:"):
self.crs = authId
else:
proj = QgsCoordinateReferenceSystem()
proj.createFromSrsId(selector.selectedCrsId())
self.crs = proj.toProj4()
self.updateText()
示例2: CRSButton
# 需要導入模塊: from qgis.gui import QgsGenericProjectionSelector [as 別名]
# 或者: from qgis.gui.QgsGenericProjectionSelector import setSelectedAuthId [as 別名]
class CRSButton(QPushButton) :
def __init__(self) :
super(QPushButton, self).__init__()
self.crsDialog = QgsGenericProjectionSelector()
QObject.connect(self, SIGNAL("clicked()"), self.crsDialog.exec_)
QObject.connect(self, SIGNAL("clicked()"), self.update)
self._crs = None
def crs(self) :
return self._crs
def setCrs(self, cr) :
self._crs = cr
self.setText(cr.description())
self.crsDialog.setSelectedAuthId(cr.authid())
def update(self) :
self.setCrs(QgsCoordinateReferenceSystem(self.crsDialog.selectedAuthId()))
示例3: geomapfishCrsButtonClicked
# 需要導入模塊: from qgis.gui import QgsGenericProjectionSelector [as 別名]
# 或者: from qgis.gui.QgsGenericProjectionSelector import setSelectedAuthId [as 別名]
def geomapfishCrsButtonClicked(self):
dlg = QgsGenericProjectionSelector(self)
dlg.setMessage('Select GeoMapFish CRS')
dlg.setSelectedAuthId(self.geomapfishCrs.text())
if dlg.exec_():
self.geomapfishCrs.setText(dlg.selectedAuthId())