| pktools 2.6.7 Processing Kernel for geospatial data

Public Member Functions | Public Attributes | Static Public Attributes | List of all members
qgis.pkfilter_spectral.pkfilter_spectral Class Reference
Inheritance diagram for qgis.pkfilter_spectral.pkfilter_spectral:
[legend]
Collaboration diagram for qgis.pkfilter_spectral.pkfilter_spectral:
[legend]

## Public Member Functions
def | cliName (self)
def | defineCharacteristics (self)
def | processAlgorithm (self, progress)
Public Member Functions inherited from qgis.pktoolsAlgorithm.pktoolsAlgorithm
def | getIcon (self)
def | checkBeforeOpeningParametersDialog (self)
def | help (self)

## Public Attributes
| name
| group

## Static Public Attributes
string | INPUT = "INPUT"
string | OUTPUT = "OUTPUT"
list | METHOD_OPTIONS = ["none", "median", "var", "min", "max", "sum", "mean", "dilate", "erode", "close", "open", "smooth", "density", "smoothnodata values", "threshold local filtering", "stdev", "dwt", "dwti", "dwt_cut", "dwt_cut_from", "savgolay", "percentile"]
string | METHOD = "METHOD"
string | DZ = "DZ"
string | NODATA = "NODATA"
list | PADDING_OPTIONS = ["symmetric", "replicate", "circular", "zero"]
string | PADDING = "PADDING"
string | RTYPE = 'RTYPE'
list | TYPE = ['none', 'Byte','Int16','UInt16','UInt32','Int32','Float32','Float64','CInt16','CInt32','CFloat32','CFloat64']
string | EXTRA = 'EXTRA'

## Detailed Description

Definition at line 38 of file pkfilter_spectral.py.

## Member Function Documentation

## ◆ cliName()

def qgis.pkfilter_spectral.pkfilter_spectral.cliName | ( |  | self | ) |

Definition at line 52 of file pkfilter_spectral.py.

52 def cliName(self):
53 return "pkfilter"
54

## ◆ defineCharacteristics()

def qgis.pkfilter_spectral.pkfilter_spectral.defineCharacteristics | ( |  | self | ) |

Definition at line 55 of file pkfilter_spectral.py.

55 def defineCharacteristics(self):
56 self.name = "spectral/temporal filter"
57 self.group = "[pktools] filter"
58 self.addParameter(ParameterRaster(self.INPUT, 'Input layer raster data set',ParameterRaster))
59 self.addParameter(ParameterSelection(self.METHOD,"filter rule",self.METHOD_OPTIONS, 0))
60 self.addOutput(OutputRaster(self.OUTPUT, "Output raster data set"))
61 self.addParameter(ParameterSelection(self.RTYPE, 'Output raster type (leave as none to keep original type)', self.TYPE, 0))
62 self.addParameter(ParameterNumber(self.DZ, "Filter kernel size",0.0,None,1.0))
63 #for smooth nodata:
64 self.addParameter(ParameterString(self.NODATA, "nodata value to smooth(e.g., 0;255)","none"))
65 self.addParameter(ParameterSelection(self.PADDING,"Padding (edge effects)",self.PADDING_OPTIONS, 0))
66 self.addParameter(ParameterString(self.EXTRA,
67 'Additional parameters', '-of GTiff', optional=True))
68

## ◆ processAlgorithm()

def qgis.pkfilter_spectral.pkfilter_spectral.processAlgorithm | ( |  | self,
|  |  | progress
| ) |  |

Definition at line 69 of file pkfilter_spectral.py.

69 def processAlgorithm(self, progress):
70 cliPath = '"' + os.path.join(pktoolsUtils.pktoolsPath(), self.cliName()) + '"'
71 commands = [cliPath]
72
73 input=self.getParameterValue(self.INPUT)
74 if input != "":
75 commands.append('-i')
76 commands.append('"' + input + '"')
77
78 method=self.METHOD_OPTIONS[self.getParameterValue(self.METHOD)]
79 if method != "none":
80 commands.append("-f")
81 commands.append(method)
82 commands.append("-pad")
83 commands.append(self.PADDING_OPTIONS[self.getParameterValue(self.PADDING)])
84
85 if self.TYPE[self.getParameterValue(self.RTYPE)] != "none":
86 commands.append('-ot')
87 commands.append(self.TYPE[self.getParameterValue(self.RTYPE)])
88 output=self.getOutputValue(self.OUTPUT)
89 if output != "":
90 commands.append("-o")
91 commands.append('"' + output + '"')
92
93 if self.getParameterValue(self.DZ) != 0:
94 commands.append("-dz")
95 commands.append(str(self.getParameterValue(self.DZ)))
96 nodata=self.getParameterValue(self.NODATA)
97 if nodata != "none":
98 nodataValues = nodata.split(';')
99 for nodataValue in nodataValues:
100 commands.append('-nodata')
101 commands.append(nodataValue)
102 extra = str(self.getParameterValue(self.EXTRA))
103 if len(extra) > 0:
104 commands.append(extra)
105
106 pktoolsUtils.runpktools(commands, progress)

## Member Data Documentation

## ◆ DZ

string qgis.pkfilter_spectral.pkfilter_spectral.DZ = "DZ"
| static

Definition at line 44 of file pkfilter_spectral.py.

## ◆ EXTRA

string qgis.pkfilter_spectral.pkfilter_spectral.EXTRA = 'EXTRA'
| static

Definition at line 50 of file pkfilter_spectral.py.

## ◆ group

qgis.pkfilter_spectral.pkfilter_spectral.group

Definition at line 57 of file pkfilter_spectral.py.

## ◆ INPUT

string qgis.pkfilter_spectral.pkfilter_spectral.INPUT = "INPUT"
| static

Definition at line 40 of file pkfilter_spectral.py.

## ◆ METHOD

string qgis.pkfilter_spectral.pkfilter_spectral.METHOD = "METHOD"
| static

Definition at line 43 of file pkfilter_spectral.py.

## ◆ METHOD_OPTIONS

list qgis.pkfilter_spectral.pkfilter_spectral.METHOD_OPTIONS = ["none", "median", "var", "min", "max", "sum", "mean", "dilate", "erode", "close", "open", "smooth", "density", "smoothnodata values", "threshold local filtering", "stdev", "dwt", "dwti", "dwt_cut", "dwt_cut_from", "savgolay", "percentile"]
| static

Definition at line 42 of file pkfilter_spectral.py.

## ◆ name

qgis.pkfilter_spectral.pkfilter_spectral.name

Definition at line 56 of file pkfilter_spectral.py.

## ◆ NODATA

string qgis.pkfilter_spectral.pkfilter_spectral.NODATA = "NODATA"
| static

Definition at line 45 of file pkfilter_spectral.py.

## ◆ OUTPUT

string qgis.pkfilter_spectral.pkfilter_spectral.OUTPUT = "OUTPUT"
| static

Definition at line 41 of file pkfilter_spectral.py.

## ◆ PADDING

string qgis.pkfilter_spectral.pkfilter_spectral.PADDING = "PADDING"
| static

Definition at line 47 of file pkfilter_spectral.py.

## ◆ PADDING_OPTIONS

list qgis.pkfilter_spectral.pkfilter_spectral.PADDING_OPTIONS = ["symmetric", "replicate", "circular", "zero"]
| static

Definition at line 46 of file pkfilter_spectral.py.

## ◆ RTYPE

string qgis.pkfilter_spectral.pkfilter_spectral.RTYPE = 'RTYPE'
| static

Definition at line 48 of file pkfilter_spectral.py.

## ◆ TYPE

list qgis.pkfilter_spectral.pkfilter_spectral.TYPE = ['none', 'Byte','Int16','UInt16','UInt32','Int32','Float32','Float64','CInt16','CInt32','CFloat32','CFloat64']
| static

Definition at line 49 of file pkfilter_spectral.py.

The documentation for this class was generated from the following file:

- /tmp/slackdce/slackrepo.NvCr9x/build_pktools/PKTOOLS-2.6.7.6/qgis/pkfilter_spectral.py