def layerAdded(self, layer): if layer.type() == QgsMapLayer.VectorLayer: for param in self.alg.parameters: if param.hidden: continue if isinstance(param, ParameterVector): if dataobjects.canUseVectorLayer(layer, param.shapetype): widget = self.valueItems[param.name] if isinstance(widget, InputLayerSelectorPanel): widget = widget.cmbText widget.addItem(self.getExtendedLayerName(layer), layer) elif layer.type() == QgsMapLayer.RasterLayer and dataobjects.canUseRasterLayer(layer): for param in self.alg.parameters: if param.hidden: continue if isinstance(param, ParameterRaster): widget = self.valueItems[param.name].cmbText widget.addItem(self.getExtendedLayerName(layer), layer) self.updateMultipleInputs()
def layerAdded(self, layer): if layer.type() == QgsMapLayer.VectorLayer: for param in self.alg.parameters: if param.hidden: continue if isinstance(param, ParameterVector): if dataobjects.canUseVectorLayer(layer, param.datatype): widget = self.valueItems[param.name] if isinstance(widget, InputLayerSelectorPanel): widget = widget.cmbText widget.addItem(self.getExtendedLayerName(layer), layer) elif layer.type() == QgsMapLayer.RasterLayer and dataobjects.canUseRasterLayer(layer): for param in self.alg.parameters: if param.hidden: continue if isinstance(param, ParameterRaster): widget = self.valueItems[param.name].cmbText widget.addItem(self.getExtendedLayerName(layer), layer) self.updateMultipleInputs()
def hasGeometry(self): if self.base_layer is None: return True return dataobjects.canUseVectorLayer(self.base_layer, [-1])