def addLayerAttributes(self, comboIndex):
        """get list layer attributes and fill the combo boxes"""

        layerId = self.layerIds[comboIndex]
        fieldmap = qgs.getLayerAttributes(layerId)
        if fieldmap is None:
            return
        self.addLayerDialog.comboBoxStart.clear()
        self.addLayerDialog.comboBoxEnd.clear()
        self.addLayerDialog.comboBoxEnd.addItem(
            '')  # this box is optional, so we add an empty item
        for attr in fieldmap:
            self.addLayerDialog.comboBoxStart.addItem(attr.name())
            self.addLayerDialog.comboBoxEnd.addItem(attr.name())
예제 #2
0
 def add_layer_attributes(self, idx):
     """get list layer attributes, fill the combo boxes"""
     layerId = self.tempLayerIndexToId[self.dialog.comboBoxLayers.currentIndex()]
     fieldmap = qgs.getLayerAttributes(layerId)
     if fieldmap is None:
         return
     self.dialog.comboBoxStart.clear()
     self.dialog.comboBoxEnd.clear()
     self.dialog.comboBoxID.clear()
     self.dialog.comboBoxEnd.addItem('') # this box is optional, so we add an empty item
     self.dialog.comboBoxID.addItem(conf.NO_ID_TEXT)
     for attr in fieldmap: 
         self.dialog.comboBoxStart.addItem(attr.name())
         self.dialog.comboBoxEnd.addItem(attr.name())
         self.dialog.comboBoxID.addItem(attr.name())
예제 #3
0
 def add_layer_attributes(self, idx):
     """get list layer attributes, fill the combo boxes"""
     layerId = self.tempLayerIndexToId[self.dialog.comboBoxLayers.currentIndex()]
     fieldmap = qgs.getLayerAttributes(layerId)
     if fieldmap is None:
         return
     self.dialog.comboBoxStart.clear()
     self.dialog.comboBoxEnd.clear()
     self.dialog.comboBoxID.clear()
     self.dialog.comboBoxEnd.addItem('Same as start')
     self.dialog.comboBoxEnd.addItem('No end time - accumulate features')
     self.dialog.comboBoxID.addItem(conf.NO_ID_TEXT)
     for attr in fieldmap: 
         self.dialog.comboBoxStart.addItem(attr.name())
         self.dialog.comboBoxEnd.addItem(attr.name())
         self.dialog.comboBoxID.addItem(attr.name())
예제 #4
0
 def addLayerAttributes(self, idx):
     """Get layer attributes and fill the combo boxes"""
     if not self.tempLayerIndexToId:
         return
     layerId = self.tempLayerIndexToId[
         self.dialog.comboBoxLayers.currentIndex()]
     fieldmap = qgs.getLayerAttributes(layerId)
     if fieldmap is None:
         return
     self.dialog.comboBoxStart.clear()
     self.dialog.comboBoxEnd.clear()
     self.dialog.comboBoxID.clear()
     self.dialog.comboBoxEnd.addItem('Same as start')
     self.dialog.comboBoxEnd.addItem('No end time - accumulate features')
     self.dialog.comboBoxID.addItem(conf.NO_ID_TEXT)
     for attr in fieldmap:
         self.dialog.comboBoxStart.addItem(attr.name())
         self.dialog.comboBoxEnd.addItem(attr.name())
         self.dialog.comboBoxID.addItem(attr.name())