-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Médéric RIBREUX
committed
Feb 14, 2016
1 parent
61fc094
commit 6d39ad9
Showing
5 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
python/plugins/processing/algs/grass7/description/r.mask.rast.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
r.mask | ||
r.mask.rast - Creates a MASK for limiting raster operation. | ||
Raster (r.*) | ||
ParameterRaster|raster|Name of raster map to use as mask|False | ||
ParameterRaster|input|Name of raster map to which apply the mask|False | ||
ParameterString|maskcats|Raster values to use for mask. Format: 1 2 3 thru 7 *|*|False|True | ||
*ParameterBoolean|-i|Create inverse mask|False|True | ||
OutputRaster|output|Masked |
9 changes: 9 additions & 0 deletions
9
python/plugins/processing/algs/grass7/description/r.mask.vect.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
r.mask | ||
r.mask.vect - Creates a MASK for limiting raster operation with a vector layer. | ||
Raster (r.*) | ||
ParameterVector|vector|Name of vector map to use as mask|1,2|False | ||
ParameterRaster|input|Name of raster map to which apply the mask|False | ||
*ParameterString|cats|Category values. Example: 1,3,7-9,13|None|False|True | ||
*ParameterString|where|WHERE conditions of SQL statement without 'where' keyword|None|True|True | ||
*ParameterBoolean|-i|Create inverse mask|False|True | ||
OutputRaster|output|Masked |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
*************************************************************************** | ||
r_mask.py | ||
--------- | ||
Date : February 2016 | ||
Copyright : (C) 2016 by Médéric Ribreux | ||
Email : medspx at medspx dot fr | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
*************************************************************************** | ||
""" | ||
|
||
__author__ = 'Médéric Ribreux' | ||
__date__ = 'February 2016' | ||
__copyright__ = '(C) 2016, Médéric Ribreux' | ||
|
||
# This will get replaced with a git SHA1 when you do a git archive | ||
|
||
__revision__ = '$Format:%H$' | ||
|
||
|
||
def processCommand(alg): | ||
# Remove output and input | ||
clipped = alg.getParameterFromName('input') | ||
out = alg.getOutputFromName('output') | ||
alg.exportedLayers[out.value] = alg.exportedLayers[clipped.value] | ||
alg.removeOutputFromName('output') | ||
alg.parameters.remove(clipped) | ||
|
||
alg.processCommand() | ||
|
||
# Re-add the output ! | ||
alg.addOutput(out) | ||
|
||
|
||
def processOutputs(alg): | ||
out = alg.getOutputValue('output') | ||
inputRaster = alg.exportedLayers[out] | ||
command = u"r.out.gdal --overwrite -c createopt=\"TFW=YES,COMPRESS=LZW\" input={} output=\"{}\"".format( | ||
inputRaster, out) | ||
alg.commands.append(command) | ||
alg.outputCommands.append(command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
*************************************************************************** | ||
r_mask_rast.py | ||
-------------- | ||
Date : February 2016 | ||
Copyright : (C) 2016 by Médéric Ribreux | ||
Email : medspx at medspx dot fr | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
*************************************************************************** | ||
""" | ||
|
||
__author__ = 'Médéric Ribreux' | ||
__date__ = 'February 2016' | ||
__copyright__ = '(C) 2016, Médéric Ribreux' | ||
|
||
# This will get replaced with a git SHA1 when you do a git archive | ||
|
||
__revision__ = '$Format:%H$' | ||
|
||
import r_mask | ||
|
||
|
||
def processCommand(alg): | ||
r_mask.processCommand(alg) | ||
|
||
|
||
def processOutputs(alg): | ||
r_mask.processOutputs(alg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
*************************************************************************** | ||
r_mask_vect.py | ||
-------------- | ||
Date : February 2016 | ||
Copyright : (C) 2016 by Médéric Ribreux | ||
Email : medspx at medspx dot fr | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
*************************************************************************** | ||
""" | ||
|
||
__author__ = 'Médéric Ribreux' | ||
__date__ = 'February 2016' | ||
__copyright__ = '(C) 2016, Médéric Ribreux' | ||
|
||
# This will get replaced with a git SHA1 when you do a git archive | ||
|
||
__revision__ = '$Format:%H$' | ||
|
||
import r_mask | ||
|
||
|
||
def processCommand(alg): | ||
r_mask.processCommand(alg) | ||
|
||
|
||
def processOutputs(alg): | ||
r_mask.processOutputs(alg) |