Skip to content
Permalink
Browse files

[processing] improve rasterize dialog UI, add help (#5008)

  • Loading branch information
nirvn committed Aug 11, 2017
1 parent 5336a0d commit 1053823369bff99ba5ae16232b299d904104886c
Showing with 33 additions and 24 deletions.
  1. +11 −0 python/plugins/processing/algs/help/qgis.yaml
  2. +22 −24 python/plugins/processing/algs/qgis/Rasterize.py
@@ -473,6 +473,17 @@ qgis:rasterlayerhistogram: >
qgis:rasterlayerstatistics: >
This algorithm computes basic statistics from the values in a given band of the raster layer.

qgis:rasterize: >
This algorithm rasterizes map canvas content.

A map theme can be selected to render a predetermined set of layers with a defined style for each layer.

Alternatively, a single layer can be selected if not map theme is set.

This comment has been minimized.

Copy link
@DelazJ

DelazJ Aug 11, 2017

Contributor

@nirvn typo: if no map theme is set, right?


If neither map theme nor the layer is set, the current map content will be rendered.

The minimum extent entered will internally be extended to be a multiple of the tile size.

qgis:refactorfields: >
This algorithm allows editing the structure of the attributes table of a vector layer. Fields can be modified in their type and name, using a fields mapping.

@@ -84,31 +84,10 @@ def initAlgorithm(self, config=None):
with some other properties.
"""
# The parameters
map_theme_param = QgsProcessingParameterString(
self.MAP_THEME,
description=self.tr(
'Map theme to render.'),
defaultValue=None, optional=True)

map_theme_param.setMetadata(
{'widget_wrapper': {
'class':
'processing.gui.wrappers_map_theme.MapThemeWrapper'}})
self.addParameter(map_theme_param)

self.addParameter(
QgsProcessingParameterMapLayer(
self.LAYER,
description=self.tr(
'Layer to render. Will only be used if the map theme '
'is not set. '
'If both, map theme and layer are not '
'set, the current map content will be rendered.'),
optional=True))
self.addParameter(
QgsProcessingParameterExtent(self.EXTENT, description=self.tr(
'The minimum extent to render. Will internally be extended to '
'be a multiple of the tile sizes.')))
'Minimum extent to render')))

self.addParameter(
QgsProcessingParameterNumber(
self.TILE_SIZE,
@@ -125,6 +104,25 @@ def initAlgorithm(self, config=None):
type=QgsProcessingParameterNumber.Double
))

map_theme_param = QgsProcessingParameterString(
self.MAP_THEME,
description=self.tr(
'Map theme to render'),
defaultValue=None, optional=True)

map_theme_param.setMetadata(
{'widget_wrapper': {
'class':
'processing.gui.wrappers_map_theme.MapThemeWrapper'}})
self.addParameter(map_theme_param)

self.addParameter(
QgsProcessingParameterMapLayer(
self.LAYER,
description=self.tr(
'Single layer to render'),
optional=True))

# We add a raster layer as output
self.addParameter(QgsProcessingParameterRasterDestination(
self.OUTPUT,
@@ -133,7 +131,7 @@ def initAlgorithm(self, config=None):

def name(self):
# Unique (non-user visible) name of algorithm
return 'Rasterize'
return 'rasterize'

def displayName(self):
# The name that the user will see in the toolbox

3 comments on commit 1053823

@nyalldawson

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson replied Aug 11, 2017

@nirvn @m-kuhn do you mind if we rename this alg from "rasterize" to "render"? To me "Rasterize" is a specific operation which takes a vector layer and converts to raster (i.e. taking the raster values directly from an attribute in the vector layer). It'd be nice to keep the "rasterize" name free for a future algorithm which does this operation.

@m-kuhn

This comment has been minimized.

Copy link
Member

@m-kuhn m-kuhn replied Aug 11, 2017

No objections, CC @marioba

@nirvn

This comment has been minimized.

Copy link
Contributor Author

@nirvn nirvn replied Aug 11, 2017

No objections.

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