[processing][heatmap] Fix alg in batch mode, mark some params as advanced

This commit is contained in:
Nyall Dawson 2016-12-07 13:50:12 +10:00
parent 51206590c9
commit 75f51bc16e
2 changed files with 23 additions and 12 deletions

View File

@ -81,8 +81,10 @@ class Heatmap(GeoAlgorithm):
self.tr('Radius (layer units)'), self.tr('Radius (layer units)'),
0.0, 9999999999, 100.0)) 0.0, 9999999999, 100.0))
self.addParameter(ParameterTableField(self.RADIUS_FIELD, radius_field_param = ParameterTableField(self.RADIUS_FIELD,
self.tr('Radius from field'), self.INPUT_LAYER, optional=True, datatype=ParameterTableField.DATA_TYPE_NUMBER)) self.tr('Radius from field'), self.INPUT_LAYER, optional=True, datatype=ParameterTableField.DATA_TYPE_NUMBER)
radius_field_param.isAdvanced = True
self.addParameter(radius_field_param)
class ParameterHeatmapPixelSize(ParameterNumber): class ParameterHeatmapPixelSize(ParameterNumber):
@ -99,15 +101,23 @@ class Heatmap(GeoAlgorithm):
minValue=0.0, maxValue=9999999999, default=0.1, minValue=0.0, maxValue=9999999999, default=0.1,
metadata={'widget_wrapper': HeatmapPixelSizeWidgetWrapper})) metadata={'widget_wrapper': HeatmapPixelSizeWidgetWrapper}))
self.addParameter(ParameterTableField(self.WEIGHT_FIELD, weight_field_param = ParameterTableField(self.WEIGHT_FIELD,
self.tr('Weight from field'), self.INPUT_LAYER, optional=True, datatype=ParameterTableField.DATA_TYPE_NUMBER)) self.tr('Weight from field'), self.INPUT_LAYER, optional=True, datatype=ParameterTableField.DATA_TYPE_NUMBER)
self.addParameter(ParameterSelection(self.KERNEL, weight_field_param.isAdvanced = True
self.tr('Kernel shape'), self.KERNELS)) self.addParameter(weight_field_param)
self.addParameter(ParameterNumber(self.DECAY, kernel_shape_param = ParameterSelection(self.KERNEL,
self.tr('Kernel shape'), self.KERNELS)
kernel_shape_param.isAdvanced = True
self.addParameter(kernel_shape_param)
decay_ratio = ParameterNumber(self.DECAY,
self.tr('Decay ratio (Triangular kernels only)'), self.tr('Decay ratio (Triangular kernels only)'),
-100.0, 100.0, 0.0)) -100.0, 100.0, 0.0)
self.addParameter(ParameterSelection(self.OUTPUT_VALUE, decay_ratio.isAdvanced = True
self.tr('Output value scaling'), self.OUTPUT_VALUES)) self.addParameter(decay_ratio)
output_scaling = ParameterSelection(self.OUTPUT_VALUE,
self.tr('Output value scaling'), self.OUTPUT_VALUES)
output_scaling.isAdvanced = True
self.addParameter(output_scaling)
self.addOutput(OutputRaster(self.OUTPUT_LAYER, self.addOutput(OutputRaster(self.OUTPUT_LAYER,
self.tr('Heatmap'))) self.tr('Heatmap')))

View File

@ -168,7 +168,8 @@ class HeatmapPixelSizeWidgetWrapper(WidgetWrapper):
w.setMinimum(0) w.setMinimum(0)
w.setMaximum(99999999999) w.setMaximum(99999999999)
w.setDecimals(6) w.setDecimals(6)
w.setTooltip(self.tr('Resolution of each pixel in output raster, in layer units')) w.setToolTip(self.tr('Resolution of each pixel in output raster, in layer units'))
return w
def postInitialize(self, wrappers): def postInitialize(self, wrappers):
if self.dialogType != DIALOG_STANDARD: if self.dialogType != DIALOG_STANDARD: