当前位置: 首页>>代码示例>>Python>>正文


Python ParameterSelection.isAdvanced方法代码示例

本文整理汇总了Python中processing.core.parameters.ParameterSelection.isAdvanced方法的典型用法代码示例。如果您正苦于以下问题:Python ParameterSelection.isAdvanced方法的具体用法?Python ParameterSelection.isAdvanced怎么用?Python ParameterSelection.isAdvanced使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在processing.core.parameters.ParameterSelection的用法示例。


在下文中一共展示了ParameterSelection.isAdvanced方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: defineCharacteristicsFromFile

# 需要导入模块: from processing.core.parameters import ParameterSelection [as 别名]
# 或者: from processing.core.parameters.ParameterSelection import isAdvanced [as 别名]
    def defineCharacteristicsFromFile(self):
        with open(self.descriptionFile) as lines:
            line = lines.readline().strip('\n').strip()
            self.name = line
            if '|' in self.name:
                tokens = self.name.split('|')
                self.name = tokens[0]
                #cmdname is the name of the algorithm in SAGA, that is, the name to use to call it in the console
                self.cmdname = tokens[1]

            else:
                self.cmdname = self.name
                self.i18n_name = QCoreApplication.translate("SAGAAlgorithm", str(self.name))
            #_commandLineName is the name used in processing to call the algorithm
            #Most of the time will be equal to the cmdname, but in same cases, several processing algorithms
            #call the same SAGA one
            self._commandLineName = self.createCommandLineName(self.name)
            self.name = decoratedAlgorithmName(self.name)
            self.i18n_name = QCoreApplication.translate("SAGAAlgorithm", str(self.name))
            line = lines.readline().strip('\n').strip()
            self.undecoratedGroup = line
            self.group = decoratedGroupName(self.undecoratedGroup)
            self.i18n_group = QCoreApplication.translate("SAGAAlgorithm", self.group)
            line = lines.readline().strip('\n').strip()
            while line != '':
                if line.startswith('Hardcoded'):
                    self.hardcodedStrings.append(line[len('Hardcoded|'):])
                elif line.startswith('Parameter'):
                    self.addParameter(getParameterFromString(line))
                elif line.startswith('AllowUnmatching'):
                    self.allowUnmatchingGridExtents = True
                elif line.startswith('NoResamplingChoice'):
                    self.noResamplingChoice = True
                elif line.startswith('Extent'):
                    # An extent parameter that wraps 4 SAGA numerical parameters
                    self.extentParamNames = line[6:].strip().split(' ')
                    self.addParameter(ParameterExtent(self.OUTPUT_EXTENT,
                                                      'Output extent'))
                else:
                    self.addOutput(getOutputFromString(line))
                line = lines.readline().strip('\n').strip()
            hasRaster = False
            for param in self.parameters:
                if (isinstance(param, ParameterRaster) or
                    (isinstance(param, ParameterMultipleInput)
                        and param.datatype == ParameterMultipleInput.TYPE_RASTER)):
                    hasRaster = True
                    break

            if (not self.noResamplingChoice and hasRaster):
                param = ParameterSelection(self.RESAMPLING, "Resampling method", ["Nearest Neighbour", "Bilinear Interpolation", "Bicubic Spline Interpolation", "B-Spline Interpolation"], 3)
                param.isAdvanced = True
                self.addParameter(param)
开发者ID:DHI-GRAS,项目名称:ESA_Processing,代码行数:55,代码来源:SagaAlgorithm.py


注:本文中的processing.core.parameters.ParameterSelection.isAdvanced方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。