Skip to content
Permalink
Browse files

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

…nced
  • Loading branch information
nyalldawson committed Dec 7, 2016
1 parent 5120659 commit 75f51bc16e60b15a4fccd64f30da4ca56e37368b
@@ -81,8 +81,10 @@ def defineCharacteristics(self):
self.tr('Radius (layer units)'),
0.0, 9999999999, 100.0))

self.addParameter(ParameterTableField(self.RADIUS_FIELD,
self.tr('Radius from field'), self.INPUT_LAYER, optional=True, datatype=ParameterTableField.DATA_TYPE_NUMBER))
radius_field_param = ParameterTableField(self.RADIUS_FIELD,
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):

@@ -99,15 +101,23 @@ def __init__(self, name='', description='', parent_layer=None, radius_param=None
minValue=0.0, maxValue=9999999999, default=0.1,
metadata={'widget_wrapper': HeatmapPixelSizeWidgetWrapper}))

self.addParameter(ParameterTableField(self.WEIGHT_FIELD,
self.tr('Weight from field'), self.INPUT_LAYER, optional=True, datatype=ParameterTableField.DATA_TYPE_NUMBER))
self.addParameter(ParameterSelection(self.KERNEL,
self.tr('Kernel shape'), self.KERNELS))
self.addParameter(ParameterNumber(self.DECAY,
self.tr('Decay ratio (Triangular kernels only)'),
-100.0, 100.0, 0.0))
self.addParameter(ParameterSelection(self.OUTPUT_VALUE,
self.tr('Output value scaling'), self.OUTPUT_VALUES))
weight_field_param = ParameterTableField(self.WEIGHT_FIELD,
self.tr('Weight from field'), self.INPUT_LAYER, optional=True, datatype=ParameterTableField.DATA_TYPE_NUMBER)
weight_field_param.isAdvanced = True
self.addParameter(weight_field_param)
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)'),
-100.0, 100.0, 0.0)
decay_ratio.isAdvanced = True
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.tr('Heatmap')))

@@ -168,7 +168,8 @@ def createWidget(self):
w.setMinimum(0)
w.setMaximum(99999999999)
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):
if self.dialogType != DIALOG_STANDARD:

0 comments on commit 75f51bc

Please sign in to comment.
You can’t perform that action at this time.