Skip to content

Commit af48246

Browse files
author
Médéric RIBREUX
committed
Add r.resamp.filter.txt algorithm
1 parent 4b63ab0 commit af48246

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
r.resamp.filter
2+
Resamples raster map layers using an analytic kernel.
3+
Raster (r.*)
4+
ParameterRaster|input|Input raster layer|False
5+
ParameterString|filter|Filter kernel(s) (comma separated list if multiple). Options: box, bartlett, gauss, normal, hermite, sinc, lanczos1, lanczos2, lanczos3, hann, hamming, blackman|None|False
6+
ParameterString|radius|Filter radius for each filter (comma separated list of float if multiple)|None|False|True
7+
ParameterString|x_radius|Filter radius (horizontal) for each filter (comma separated list of float if multiple)|None|False|True
8+
ParameterString|y_radius|Filter radius (vertical) for each filter (comma separated list of float if multiple)|None|False|True
9+
*ParameterBoolean|-n|Propagate NULLs|False|True
10+
OutputRaster|output|Resampled Filter
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# -*- coding: utf-8 -*-
2+
3+
"""
4+
***************************************************************************
5+
r_resamp_filter.py
6+
------------------
7+
Date : February 2016
8+
Copyright : (C) 2016 by Médéric Ribreux
9+
Email : medspx at medspx dot fr
10+
***************************************************************************
11+
* *
12+
* This program is free software; you can redistribute it and/or modify *
13+
* it under the terms of the GNU General Public License as published by *
14+
* the Free Software Foundation; either version 2 of the License, or *
15+
* (at your option) any later version. *
16+
* *
17+
***************************************************************************
18+
"""
19+
20+
__author__ = 'Médéric Ribreux'
21+
__date__ = 'February 2016'
22+
__copyright__ = '(C) 2016, Médéric Ribreux'
23+
24+
# This will get replaced with a git SHA1 when you do a git archive
25+
26+
__revision__ = '$Format:%H$'
27+
28+
29+
def checkParameterValuesBeforeExecuting(alg):
30+
""" Verify if we have the right parameters """
31+
radius = alg.getParameterValue(u'radius')
32+
x_radius = alg.getParameterValue(u'x_radius')
33+
y_radius = alg.getParameterValue(u'y_radius')
34+
35+
if (not radius and not x_radius and not y_radius) or (radius and (x_radius or y_radius)):
36+
return alg.tr("You need to set either radius or x_radius and y_radius !")
37+
elif (x_radius and not y_radius) or (y_radius and not x_radius):
38+
return alg.tr("You need to set x_radius and y_radius !")
39+
return None

0 commit comments

Comments
 (0)