Exemplo n.º 1
0
    def select_input_crs(self):

        projSelector = QgsGenericProjectionSelector()
        projSelector.exec_()
        self.input_epsg = projSelector.selectedAuthId()
        self.dockwidget.epsgLabel.setText("Input " + projSelector.selectedAuthId())
        self.dockwidget.munLineEdit.clear()
Exemplo n.º 2
0
 def edit():
     selector = QgsProjectionSelectionDialog()
     selector.setCrs(value);
     if selector.exec_():
         crs = selector.crs()
         if crs.upper().startswith("EPSG:"):
             self.lineEdit.setText(crs)
 def selectCrs(self):
     projSelector = QgsGenericProjectionSelector()
     ret = projSelector.exec_()
     if ret == 1:  #QMessageBox.Ok:
         crsId = projSelector.selectedCrsId()
         crsAuthId = projSelector.selectedAuthId()
         self.crsLineEdit.setText(self.crsAuthId)
         self.crs.createFromUserInput(self.crsAuthId)
Exemplo n.º 4
0
    def crs_selector(self):

        # Request CRS for layers
        proj_selector = QgsGenericProjectionSelector()
        proj_selector.exec_()
        proj_id = proj_selector.selectedAuthId()
        crs = QgsCoordinateReferenceSystem(proj_id)
        self.params.crs = crs
Exemplo n.º 5
0
 def selectCrs(self):
     crsDiag = QgsGenericProjectionSelector()
     crsDiag.exec_()
     crsId = crsDiag.selectedCrsId()
     if crsId:
         crsType = QgsCoordinateReferenceSystem.InternalCrsId
         self.systemCRS = QgsCoordinateReferenceSystem(crsId, crsType)
         self.settings.setValue('crs', self.systemCRS.postgisSrid())
Exemplo n.º 6
0
    def selectProjection(self):
        dialog = QgsGenericProjectionSelector(self.widget)
        current_crs = QgsCoordinateReferenceSystem(self.combo.currentText())
        if current_crs.isValid():
            dialog.setSelectedCrsId(current_crs.srsid())

        if dialog.exec_():
            self.setValue(dialog.selectedAuthId())
Exemplo n.º 7
0
    def select_crs(self):
        """
            Open Qgis CRS selector
        """
        proj_selector = QgsGenericProjectionSelector()
        proj_selector.exec_()
        proj = proj_selector.selectedAuthId()

        self.gui.crsValue.setText(proj)
Exemplo n.º 8
0
    def projection_selector(self):
        """
        Opens the QGIS projection selector
        """
        projection_selector = QgsGenericProjectionSelector(self)

        if projection_selector.exec_() == QDialog.Accepted:
            #Remove 'EPSG:' part
            self._srid = projection_selector.selectedAuthId()[5:]
            self.btnCoord.setText(projection_selector.selectedAuthId())
Exemplo n.º 9
0
    def projection_selector(self):
        """
        Opens the QGIS projection selector
        """
        projection_selector = QgsGenericProjectionSelector(self)

        if projection_selector.exec_() == QDialog.Accepted:
            #Remove 'EPSG:' part
            self._srid = projection_selector.selectedAuthId()[5:]
            self.btnCoord.setText(projection_selector.selectedAuthId())
Exemplo n.º 10
0
 def openSystem(self):
     projSelector = QgsGenericProjectionSelector()
     projSelector.exec_()
     a = projSelector.selectedCrsId()
     b = projSelector.selectedAuthId()
     if b == '':
         QMessageBox.information(None,  self.tr("Warning"), self.tr("Attention no Reference System selected"))
     else:
         self.numEPGS = int(str(b).split(':')[1])
         self.setSistemaRiferimento()
         self.label_sr.setText(self.tr("Reference System Loaded:  ") + b)
         self.label_sr.show()
Exemplo n.º 11
0
    def selectKBS(self):
        """KBS auswählen. Setzt das KBS für die weiteren Funktionen

        :returns: void
        """
        projSelector = QgsGenericProjectionSelector()
        projSelector.exec_()
        erg = projSelector.selectedAuthId()
        if len(erg.split(':')) == 2:
            self.dlg.tf_epsg.setText(erg.split(':')[1])
        else:
            self.dlg.tf_epsg.setText(erg)
Exemplo n.º 12
0
    def setGeoRef(self):
        generic_projection_selector = QgsGenericProjectionSelector()
        generic_projection_selector.exec_()

        crsId = generic_projection_selector.selectedCrsId()
        if crsId:
            crsType = QgsCoordinateReferenceSystem.InternalCrsId
            self.kmlCrs = QgsCoordinateReferenceSystem(crsId, crsType)
            self.settings.setValue('kmlCrs', crsId)

            for i in range(0, self.dlg.conLayerList.count()):
                item = self.dlg.conLayerList.item(i)
                item.crs = self.kmlCrs
Exemplo n.º 13
0
 def outProjFile(self):
     header = "Define layer CRS:"
     sentence1 = self.tr(
         "Please select the projection system that defines the current layer."
     )
     sentence2 = self.tr(
         "Layer CRS information will be updated to the selected CRS.")
     projSelector = QgsGenericProjectionSelector(self)
     projSelector.setMessage("<h2>%s</h2>%s <br/> %s" %
                             (header, sentence1, sentence2))
     if projSelector.exec_():
         self.crs = QgsCoordinateReferenceSystem(
             projSelector.selectedCrsId(),
             QgsCoordinateReferenceSystem.InternalCrsId)
         print "AUTHID", projSelector.selectedAuthId()
         if len(projSelector.selectedAuthId()) == 0:
             QMessageBox.information(self,
                                     self.tr("Export to new projection"),
                                     self.tr("No Valid CRS selected"))
             return
         else:
             self.txtProjection.clear()
             self.txtProjection.insert(self.crs.authid() + " - " +
                                       self.crs.description())
     else:
         return
Exemplo n.º 14
0
 def on_srsButton_clicked(self):
     '''
     Opens the dialog to select CRS
     '''
     projSelector = QgsGenericProjectionSelector()
     message = self.tr('Select the Spatial Reference System!')
     projSelector.setMessage(theMessage=message)
     if not projSelector.exec_():
         QMessageBox.warning(self, self.tr("Warning!"), message)
         return
     else:
         self.epsg = int(projSelector.selectedAuthId().split(':')[-1])
     srs = QgsCoordinateReferenceSystem(self.epsg, QgsCoordinateReferenceSystem.EpsgCrsId)
     self.srLineEdit.setText(srs.description())
Exemplo n.º 15
0
 def select_CRS(self):
     projSelector = QgsGenericProjectionSelector()
     projSelector.exec_()
     try:
         authid = projSelector.selectedAuthId()
         self.crs = QgsCoordinateReferenceSystem()
         success = self.crs.createFromString(authid)
         if not success:
             self.crs = None
         else:
             self.crsDesc.setText(self.crs.description())
             self.form_crsID.setText(authid)
     except:
         self.crs = None
Exemplo n.º 16
0
    def crsChange(self):
        projectionDlg = QgsGenericProjectionSelector(self)
        projectionDlg.exec_()
#         print projectionDlg.selectedCrsId()
        srs = QgsCoordinateReferenceSystem(projectionDlg.selectedCrsId(), QgsCoordinateReferenceSystem.InternalCrsId)
        self.mCRS = srs.srsid()
        self.crs = QgsCoordinateReferenceSystem()
        self.crs.createFromId(self.mCRS, QgsCoordinateReferenceSystem.InternalCrsId )
#         authId = projectionDlg.selectedAuthId()
#         crsId = projectionDlg.selectedCrsId()
#         if authId != "":
#             if authId[:4] != "EPSG":
#                 self.crs = QgsCoordinateReferenceSystem(crsId, QgsCoordinateReferenceSystem.InternalCrsId)
#             else:
#                 self.crs = QgsCoordinateReferenceSystem(crsId, QgsCoordinateReferenceSystem.EpsgCrsId)
        self.ui.cmbCrs.setCurrentIndex(2)
        self.ui.txtCrs.setText(self.crs.description())
Exemplo n.º 17
0
 def selectCRS(self):
     projSelector = QgsGenericProjectionSelector()
     if projSelector.exec_():
         crsId = projSelector.crs().srsid()
         if not crsId == 0:
             self.crs = QgsCoordinateReferenceSystem()
             self.crs.createFromId(crsId, QgsCoordinateReferenceSystem.InternalCrsId)
             self.tbCRS.setText(self.crs.description())
Exemplo n.º 18
0
    def onSpecifyCRS(self):

        selector = QgsGenericProjectionSelector(self)
        selector.setMessage("Specify CRS of the mesh file")
        selector.setSelectedCrsId(self.layer.crs().srsid())
        if selector.exec_():
            self.crs = QgsCoordinateReferenceSystem(
                selector.selectedCrsId(),
                QgsCoordinateReferenceSystem.InternalCrsId)
            self.updateEditCRS()
    def on_cmdOutCRS_clicked(self):
        dlg = QgsGenericProjectionSelector(self)
        dlg.setMessage(self.tr('Select coordinate system'))
        if dlg.exec_():
            if dlg.selectedAuthId() != '':
                self.outQgsCRS = QgsCoordinateReferenceSystem(
                    dlg.selectedAuthId())

                if self.outQgsCRS.geographicFlag():
                    self.outQgsCRS = None
                    self.send_to_messagebar(unicode(
                        self.
                        tr("Geographic coordinate systems are not allowed. Resetting to default.."
                           )),
                                            level=QgsMessageBar.WARNING,
                                            duration=5)
            else:
                self.outQgsCRS = None

            if self.outQgsCRS is None:
                self.autoSetCoordinateSystem()

            self.lblOutCRSTitle.setStyleSheet('color:black')
            self.lblOutCRS.setStyleSheet('color:black')
            self.lblOutCRS.setText(
                self.tr('{}  -  {}'.format(self.outQgsCRS.description(),
                                           self.outQgsCRS.authid())))
    def setSrc(self):
        projSelector = QgsGenericProjectionSelector()
        projSelector.setMessage(theMessage='Por favor, selecione um sistema de coordenada !')
        projSelector.exec_()
        if projSelector.selectedAuthId():
            epsg = int(projSelector.selectedAuthId().split(':')[-1])
#             test = QgsCoordinateReferenceSystem(epsg, QgsCoordinateReferenceSystem.EpsgCrsId)
            self.SRCLineEdit.setText(str(epsg))
            self.epsg = epsg
        else:
            self.msg(u"Selecione SRC para criar Banco !")
    def onSpecifyCRS(self):

        selector = QgsGenericProjectionSelector(self)
        selector.setMessage("Specify CRS of the mesh file")
        selector.setSelectedCrsId(self.layer.crs().srsid())
        if selector.exec_():
          self.crs = QgsCoordinateReferenceSystem(selector.selectedCrsId(), QgsCoordinateReferenceSystem.InternalCrsId)
          self.updateEditCRS()
Exemplo n.º 22
0
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()))
    def on_pbnCrs_pressed(self):
        selector = QgsGenericProjectionSelector(self)
        selector.setMessage();
        if self.layerCrs.description():
            selector.setSelectedCrsId( self.layerCrs.srsid() );
        elif self.selectedCrs.description():
            selector.setSelectedCrsId( self.selectedCrs.srsid() );
        if selector.exec_():
            self.selectedCrs.createFromId( selector.selectedCrsId(), QgsCoordinateReferenceSystem.InternalCrsId );
            self.ui.cboCrs.setCurrentIndex(2)

        if self.selectedCrs.description():
            self.ui.cboCrs.setItemText(2, 
                                       self.tr( "Selected" ) + " (%s, %s)" % (self.selectedCrs.description(), self.selectedCrs.authid()) )
        else:
            self.ui.cboCrs.setItemText(2, self.tr("Selected (None)"))
Exemplo n.º 24
0
    def on_pbnCrs_pressed(self):
        selector = QgsGenericProjectionSelector(self)
        selector.setMessage()
        if self.layerCrs.description():
            selector.setSelectedCrsId(self.layerCrs.srsid())
        elif self.selectedCrs.description():
            selector.setSelectedCrsId(self.selectedCrs.srsid())
        if selector.exec_():
            self.selectedCrs.createFromId(
                selector.selectedCrsId(),
                QgsCoordinateReferenceSystem.InternalCrsId)
            self.ui.cboCrs.setCurrentIndex(2)

        if self.selectedCrs.description():
            self.ui.cboCrs.setItemText(
                2,
                self.tr("Selected") + " (%s, %s)" %
                (self.selectedCrs.description(), self.selectedCrs.authid()))
        else:
            self.ui.cboCrs.setItemText(2, self.tr("Selected (None)"))
Exemplo n.º 25
0
 def on_cmdInCRS_clicked(self):
     dlg = QgsGenericProjectionSelector(self)
     dlg.setMessage('Select coordinate system for the input file geometry')
     if self.vesper_qgscrs is not None:
         dlg.setSelectedAuthId(self.vesper_qgscrs.authid())
     if dlg.exec_():
         if dlg.selectedAuthId() != '':  # ie clicked ok without selecting a projection
             crs = QgsCoordinateReferenceSystem(dlg.selectedAuthId())
             if crs == 'Unspecified' or crs == '':
                 self.vesper_qgscrs = None
                 self.lneInCRS.setText('Unspecified')
             else:
                 self.vesper_qgscrs = QgsCoordinateReferenceSystem(crs)
                 self.vesper_qgscrs.validate()
                 self.lneInCRS.setText(
                     '{}  -  {}'.format(self.vesper_qgscrs.description(), self.vesper_qgscrs.authid()))
                 self.lneInCRS.setStyleSheet('color:black;background:transparent;')
                 self.lblInCRSTitle.setStyleSheet('color:black')
Exemplo n.º 26
0
    def selectProjection(self):
        dialog = QgsGenericProjectionSelector(self.widget)
        current_crs = QgsCoordinateReferenceSystem(self.combo.currentText())
        if current_crs.isValid():
            dialog.setSelectedCrsId(current_crs.srsid())

        if dialog.exec_():
            self.setValue(dialog.selectedAuthId())
Exemplo n.º 27
0
 def _crs_authority_id():
     """
     Returns selected coordinate
     reference system (CRS) authority ID
     :return auth_id: CRS authority ID
     :return auth_id: String
     """
     proj_selector = QgsGenericProjectionSelector()
     proj_selector.setOgcWmsCrsFilter(NAM_CRS)
     proj_selector.exec_()
     auth_id = proj_selector.selectedAuthId()
     return auth_id
Exemplo n.º 28
0
 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()
Exemplo n.º 29
0
 def selectCrs(self):
     projectionDlg = QgsGenericProjectionSelector(self)
     projectionDlg.setSelectedAuthId(self.mCrs.authid())
     if projectionDlg.exec_():
         self.mCrs = QgsCoordinateReferenceSystem(
             projectionDlg.selectedCrsId(),
             QgsCoordinateReferenceSystem.InternalCrsId)
         self.ui.txtCrs.setText(self.mCrs.authid() + " - " +
                                self.mCrs.description())
Exemplo n.º 30
0
 def setaSistCoordCriaSpatialite(self):
     projSelector = QgsGenericProjectionSelector()
     projSelector.setMessage(theMessage=self.tr('Please, select the coordinate system'))
     projSelector.exec_()
     try:
         self.epsgCriaSpatialite = int(projSelector.selectedAuthId().split(':')[-1])
         self.srsCriaSpatialite = QgsCoordinateReferenceSystem(self.epsgCriaSpatialite, QgsCoordinateReferenceSystem.EpsgCrsId)
         if self.srsCriaSpatialite <> "":
             self.coordSysDefinido = True
             self.coordSysCriaSpatialiteLineEdit.setText(self.srsCriaSpatialite.description())
     except:
         self.bar.pushMessage("", self.tr('Please, select the coordinate system'), level=QgsMessageBar.WARNING)
         pass
 def on_crsButton_clicked(self):
     projSelector = QgsGenericProjectionSelector()
     message = 'Select the Spatial Reference System!'
     projSelector.setMessage(theMessage=message)
     projSelector.exec_()
     try:
         epsg = int(projSelector.selectedAuthId().split(':')[-1])
         self.crs = QgsCoordinateReferenceSystem(
             epsg, QgsCoordinateReferenceSystem.EpsgCrsId)
         if self.crs:
             self.crsLineEdit.setText(self.crs.description())
     except:
         QMessageBox.warning(self, self.tr("Warning!"), self.tr(message))
Exemplo n.º 32
0
 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()
 def on_crsButton_clicked(self):
     projSelector = QgsGenericProjectionSelector()
     message = 'Select the Spatial Reference System!'
     projSelector.setMessage(theMessage=message)
     projSelector.exec_()
     try:
         epsg = int(projSelector.selectedAuthId().split(':')[-1])
         self.crs = QgsCoordinateReferenceSystem(epsg, QgsCoordinateReferenceSystem.EpsgCrsId)
         if self.crs:
             self.crsLineEdit.setText(self.crs.description())
     except:
         QMessageBox.warning(self, self.tr("Warning!"), self.tr(message))
Exemplo n.º 34
0
 def on_srsButton_clicked(self):
     projSelector = QgsGenericProjectionSelector()
     message = self.tr('Select the Spatial Reference System!')
     projSelector.setMessage(theMessage=message)
     if not projSelector.exec_():
         QMessageBox.warning(self, self.tr("Warning!"), message)
         return
     else:
         self.epsg = int(projSelector.selectedAuthId().split(':')[-1])
     srs = QgsCoordinateReferenceSystem(
         self.epsg, QgsCoordinateReferenceSystem.EpsgCrsId)
     self.srLineEdit.setText(srs.description())
 def on_browse_input_crs_pressed(self):
     """
     define input crs
     :return:
     """
     crs_selector = QgsGenericProjectionSelector()
     crs_selector.show()
     crs_selector.exec_()
     self.input_authid = str(crs_selector.selectedAuthId())
     selected_crs = QgsCoordinateReferenceSystem()
     selected_crs.createFromString(self.input_authid)
     self.input_crs.setText(selected_crs.description() + "    (" + self.input_authid+")")
Exemplo n.º 36
0
 def setaSistCoordCriaSpatialite(self):
     projSelector = QgsGenericProjectionSelector()
     projSelector.setMessage(theMessage=self.tr('Please, select the coordinate system'))
     projSelector.exec_()
     try:
         self.epsgCriaSpatialite = int(projSelector.selectedAuthId().split(':')[-1])
         self.srsCriaSpatialite = QgsCoordinateReferenceSystem(self.epsgCriaSpatialite, QgsCoordinateReferenceSystem.EpsgCrsId)
         if self.srsCriaSpatialite <> "":
             self.coordSysDefinido = True
             self.coordSysCriaSpatialiteLineEdit.setText(self.srsCriaSpatialite.description())
     except:
         self.bar.pushMessage("", self.tr('Please, select the coordinate system'), level=QgsMessageBar.WARNING)
         pass
Exemplo n.º 37
0
 def outProjFile(self):
     header = "Define layer CRS:"
     sentence1 = self.tr("Please select the projection system that defines the current layer.")
     sentence2 = self.tr("Layer CRS information will be updated to the selected CRS.")
     projSelector = QgsGenericProjectionSelector(self)
     projSelector.setMessage("<h2>%s</h2>%s <br/> %s" % (header, sentence1, sentence2))
     if projSelector.exec_():
         self.crs = QgsCoordinateReferenceSystem(projSelector.selectedCrsId(), QgsCoordinateReferenceSystem.InternalCrsId)
         print "AUTHID", projSelector.selectedAuthId()
         if len(projSelector.selectedAuthId()) == 0:
             QMessageBox.information(self, self.tr("Export to new projection"), self.tr("No Valid CRS selected"))
             return
         else:
             self.txtProjection.clear()
             self.txtProjection.insert(self.crs.authid() + " - " + self.crs.description())
     else:
         return
Exemplo n.º 38
0
 def openSystem(self):
     projSelector = QgsGenericProjectionSelector()
     projSelector.exec_()
     a = projSelector.selectedCrsId()
     b = projSelector.selectedAuthId()
     if b == '':
         QMessageBox.information(
             None, self.tr("Warning"),
             self.tr("Attention no Reference System selected"))
     else:
         self.numEPGS = int(str(b).split(':')[1])
         self.setSistemaRiferimento()
         self.label_sr.setText(self.tr("Reference System Loaded:  ") + b)
         self.label_sr.show()
Exemplo n.º 39
0
 def on_srsButton_clicked(self):
     """
     Opens the CRS selector dialog
     """
     projSelector = QgsGenericProjectionSelector()
     message = 'Select the Spatial Reference System!'
     projSelector.setMessage(theMessage=message)
     projSelector.exec_()
     try:
         self.epsg = int(projSelector.selectedAuthId().split(':')[-1])
         srs = QgsCoordinateReferenceSystem(
             self.epsg, QgsCoordinateReferenceSystem.EpsgCrsId)
         if srs:
             self.srsEdit.setText(srs.description())
         else:
             self.epsg = 4326
     except:
         QMessageBox.warning(self, self.tr("Warning!"), message)
Exemplo n.º 40
0
    def on_cmdInCRS_clicked(self):
        self.messageBar.clearWidgets()

        dlg = QgsGenericProjectionSelector(self)
        dlg.setMessage('Select coordinate system for the Vesper raster files')
        if dlg.exec_():
            if dlg.selectedAuthId() != '':
                self.in_qgscrs = QgsCoordinateReferenceSystem(dlg.selectedAuthId())
                if self.in_qgscrs == 'Unspecified' or self.in_qgscrs == '':
                    self.lblInCRS.setText('Unspecified')
                    self.lblOutCRS.setText('Unspecified')
                else:
                    self.lblInCRS.setText('{}  -  {}'.format(self.in_qgscrs.description(),
                                                             self.in_qgscrs.authid()))
                    self.lblInCRS.setStyleSheet('color:black;background:transparent;')
                    self.lblInCRSTitle.setStyleSheet('color:black')

        self.cleanMessageBars(self)
Exemplo n.º 41
0
 def on_srsButton_clicked(self):
     """
     Opens the CRS selector dialog
     """
     projSelector = QgsGenericProjectionSelector()
     message = 'Select the Spatial Reference System!'
     projSelector.setMessage(theMessage=message)
     projSelector.exec_()
     try:
         self.epsg = int(projSelector.selectedAuthId().split(':')[-1])
         srs = QgsCoordinateReferenceSystem(self.epsg, QgsCoordinateReferenceSystem.EpsgCrsId)
         if srs:
             self.srsEdit.setText(srs.description())
         else:
             self.epsg = 4326
     except:
         QMessageBox.warning(self, self.tr("Warning!"), message)
Exemplo n.º 42
0
 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
# coding: utf-8
from qgis.gui import QgsGenericProjectionSelector

generic_projection_selector = QgsGenericProjectionSelector()
generic_projection_selector.show()
Exemplo n.º 44
0
 def geomapfishCrsButtonClicked(self):
     dlg = QgsGenericProjectionSelector(self)
     dlg.setMessage('Select GeoMapFish CRS')
     dlg.setSelectedAuthId(self.geomapfishCrs.text())
     if dlg.exec_():
         self.geomapfishCrs.setText(dlg.selectedAuthId())
Exemplo n.º 45
0
 def loadAvailableSystems(self):
     coordSys = ""
     crsDlg = QgsGenericProjectionSelector(self.parent)
     if crsDlg.exec_() == QDialog.Accepted:
         coordSys = str(crsDlg.selectedAuthId())
     return coordSys
 def browseForSRS(self):
   srsSelector = QgsGenericProjectionSelector(self)
   srsSelector.setSelectedCrsName(self.leSRS.text())
   if srsSelector.exec_():
     self.dlg.ui.leSRS.clear()
     self.dlg.ui.leSRS.insert(srsSelector.selectedProj4String())
Exemplo n.º 47
0
 def geomapfishCrsButtonClicked(self):
     dlg = QgsGenericProjectionSelector(self)
     dlg.setMessage('Select GeoMapFish CRS')
     dlg.setSelectedAuthId(self.geomapfishCrs.text())
     if dlg.exec_():
         self.geomapfishCrs.setText(dlg.selectedAuthId())
Exemplo n.º 48
0
 def selectcrs(self):
     # Select a new CRS
     s = QSettings()
     previousselectedcrs=s.value("quickcrs/crs", 0)
     #if previousselectedcrs=="" or previousselectedcrs==0 or previousselectedcrs is None:
         #self.nocrsselected()
     global selectedcrs
     try:
         projSelector = QgsGenericProjectionSelector()
         projSelector.exec_()
         projSelector.selectedCrsId()
         selectedcrs=projSelector.selectedCrsId()
     except:
         projSelector = QgsProjectionSelectionDialog()
         projSelector.exec_()
         selectedcrsdef = projSelector.crs()
         selectedcrs=selectedcrsdef.srsid()
     if (selectedcrs=="" or selectedcrs==0 or self.CrsId2AuthID(selectedcrs)=="" or selectedcrs is None):
         #selectedcrs=previousselectedcrs
         pass
     if (selectedcrs=="" or selectedcrs==0 or self.CrsId2AuthID(selectedcrs)=="" or selectedcrs is None) and (previousselectedcrs=="" or previousselectedcrs==0 or previousselectedcrs is None):
         #self.nocrsselected()
         pass
     else:
         #self.dlg.labelselectedcrs.setText(self.CrsId2AuthID(selectedcrs))
         src=self.CrsId2AuthID(selectedcrs).replace('\n','')
         if(not self.buscarEnArchivo(src, "src.txt")):
             this_folder = os.path.dirname(os.path.abspath(__file__))
             file = open(this_folder+"/src.txt", mode='a')
             file.write('\n'+src)
             file.close()
             self.file2Combo("src.txt", self.dlg.combo_src,'')
         self.dlg.combo_src.setCurrentText(src)
     self.dlg.show()
Exemplo n.º 49
0
 def loadAvailableSystems(self):
     coordSys=""
     crsDlg=QgsGenericProjectionSelector(self.parent)
     if crsDlg.exec_()==QDialog.Accepted:
         coordSys=str(crsDlg.selectedAuthId())
     return coordSys
Exemplo n.º 50
0
 def selectCrs(self):
     crsDiag = QgsGenericProjectionSelector()
     crsDiag.exec_()
     crsId = crsDiag.selectedCrsId()
     crsType = QgsCoordinateReferenceSystem.InternalCrsId
     self.crs = QgsCoordinateReferenceSystem(crsId, crsType)