pktools 2.6.7
Processing Kernel for geospatial data
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
qgis.pkfilter_spatial.pkfilter_spatial Class Reference
Inheritance diagram for qgis.pkfilter_spatial.pkfilter_spatial:
Inheritance graph
[legend]
Collaboration diagram for qgis.pkfilter_spatial.pkfilter_spatial:
Collaboration graph
[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", "homog ", "heterog ", "sobelx ", "sobely ", "sobelxy ", "sobelyx" , "smooth", "countid", "smoothnodata values", "threshold local filtering", "ismin", "ismax", "order", "mode", "stdev", "mrf", "dwt", "dwti", "dwt_cut", "scramble", "shift", "savgolay", "percentile"]
 
string METHOD = "METHOD"
 
string DIM = "DIM"
 
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_spatial.py.

Member Function Documentation

◆ cliName()

def qgis.pkfilter_spatial.pkfilter_spatial.cliName (   self)

Definition at line 54 of file pkfilter_spatial.py.

54 def cliName(self):
55 return "pkfilter"
56

◆ defineCharacteristics()

def qgis.pkfilter_spatial.pkfilter_spatial.defineCharacteristics (   self)

Definition at line 57 of file pkfilter_spatial.py.

57 def defineCharacteristics(self):
58 self.name = "spatial filter"
59 self.group = "[pktools] filter"
60
61 self.addParameter(ParameterRaster(self.INPUT, 'Input layer raster data set',ParameterRaster))
62 self.addParameter(ParameterSelection(self.METHOD,"filter rule",self.METHOD_OPTIONS, 0))
63 self.addOutput(OutputRaster(self.OUTPUT, "Output raster data set"))
64 self.addParameter(ParameterSelection(self.RTYPE, 'Output raster type (leave as none to keep original type)', self.TYPE, 0))
65 self.addParameter(ParameterNumber(self.DIM, "Filter kernel size (odd value)",0.0,None,3.0))
66 #for smooth nodata:
67 self.addParameter(ParameterString(self.NODATA, "invalid value(s) for input raster dataset (e.g., 0;255)","none"))
68 self.addParameter(ParameterSelection(self.PADDING,"Padding (edge effects)",self.PADDING_OPTIONS, 0))
69# self.addParameter(ParameterSelection(self.RESAMPLE,"resampling method",self.RESAMPLE_OPTIONS, 0))
70 self.addParameter(ParameterString(self.EXTRA,
71 'Additional parameters', '-of GTiff', optional=True))
72

◆ processAlgorithm()

def qgis.pkfilter_spatial.pkfilter_spatial.processAlgorithm (   self,
  progress 
)

Definition at line 73 of file pkfilter_spatial.py.

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

Member Data Documentation

◆ DIM

string qgis.pkfilter_spatial.pkfilter_spatial.DIM = "DIM"
static

Definition at line 46 of file pkfilter_spatial.py.

◆ EXTRA

string qgis.pkfilter_spatial.pkfilter_spatial.EXTRA = 'EXTRA'
static

Definition at line 52 of file pkfilter_spatial.py.

◆ group

qgis.pkfilter_spatial.pkfilter_spatial.group

Definition at line 59 of file pkfilter_spatial.py.

◆ INPUT

string qgis.pkfilter_spatial.pkfilter_spatial.INPUT = "INPUT"
static

Definition at line 40 of file pkfilter_spatial.py.

◆ METHOD

string qgis.pkfilter_spatial.pkfilter_spatial.METHOD = "METHOD"
static

Definition at line 43 of file pkfilter_spatial.py.

◆ METHOD_OPTIONS

list qgis.pkfilter_spatial.pkfilter_spatial.METHOD_OPTIONS = ["none", "median", "var", "min", "max", "sum", "mean", "dilate", "erode", "close", "open", "homog ", "heterog ", "sobelx ", "sobely ", "sobelxy ", "sobelyx" , "smooth", "countid", "smoothnodata values", "threshold local filtering", "ismin", "ismax", "order", "mode", "stdev", "mrf", "dwt", "dwti", "dwt_cut", "scramble", "shift", "savgolay", "percentile"]
static

Definition at line 42 of file pkfilter_spatial.py.

◆ name

qgis.pkfilter_spatial.pkfilter_spatial.name

Definition at line 58 of file pkfilter_spatial.py.

◆ NODATA

string qgis.pkfilter_spatial.pkfilter_spatial.NODATA = "NODATA"
static

Definition at line 47 of file pkfilter_spatial.py.

◆ OUTPUT

string qgis.pkfilter_spatial.pkfilter_spatial.OUTPUT = "OUTPUT"
static

Definition at line 41 of file pkfilter_spatial.py.

◆ PADDING

string qgis.pkfilter_spatial.pkfilter_spatial.PADDING = "PADDING"
static

Definition at line 49 of file pkfilter_spatial.py.

◆ PADDING_OPTIONS

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

Definition at line 48 of file pkfilter_spatial.py.

◆ RTYPE

string qgis.pkfilter_spatial.pkfilter_spatial.RTYPE = 'RTYPE'
static

Definition at line 50 of file pkfilter_spatial.py.

◆ TYPE

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

Definition at line 51 of file pkfilter_spatial.py.


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