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


Python GdalUtils.escapeAndJoin方法代码示例

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


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

示例1: processAlgorithm

# 需要导入模块: from sextante.gdal.GdalUtils import GdalUtils [as 别名]
# 或者: from sextante.gdal.GdalUtils.GdalUtils import escapeAndJoin [as 别名]
    def processAlgorithm(self, progress):
        arguments = []
        arguments.append("-n")
        arguments.append(str(self.getParameterValue(rgb2pct.NCOLORS)))
        arguments.append("-of")
        out = self.getOutputValue(rgb2pct.OUTPUT)
        arguments.append(GdalUtils.getFormatShortNameFromFilename(out))
        arguments.append(self.getParameterValue(rgb2pct.INPUT))
        arguments.append(out)

        if SextanteUtils.isWindows():
            commands = ["cmd.exe", "/C ", "rgb2pct.bat", GdalUtils.escapeAndJoin(arguments)]
        else:
            commands = ["rgb2pct.py", GdalUtils.escapeAndJoin(arguments)]

        GdalUtils.runGdal(commands, progress)
开发者ID:Adam-Brown,项目名称:Quantum-GIS,代码行数:18,代码来源:rgb2pct.py

示例2: processAlgorithm

# 需要导入模块: from sextante.gdal.GdalUtils import GdalUtils [as 别名]
# 或者: from sextante.gdal.GdalUtils.GdalUtils import escapeAndJoin [as 别名]
    def processAlgorithm(self, progress):
        arguments = []
        inFile = self.getParameterValue(gdaladdo.INPUT)
        arguments.append(inFile)
        arguments.extend(self.getParameterValue(gdaladdo.LEVELS).split(" "))
        self.setOutputValue(gdaladdo.OUTPUT, inFile)

        GdalUtils.runGdal(["gdaladdo", GdalUtils.escapeAndJoin(arguments)], progress)
开发者ID:Adam-Brown,项目名称:Quantum-GIS,代码行数:10,代码来源:gdaladdo.py

示例3: processAlgorithm

# 需要导入模块: from sextante.gdal.GdalUtils import GdalUtils [as 别名]
# 或者: from sextante.gdal.GdalUtils.GdalUtils import escapeAndJoin [as 别名]
    def processAlgorithm(self, progress):
        arguments = []
        arguments.append(self.getParameterValue(polygonize.INPUT))
        arguments.append('-f')
        arguments.append('"ESRI Shapefile"')
        output = self.getOutputValue(polygonize.OUTPUT)
        arguments.append(output)
        arguments.append(QtCore.QFileInfo(output).baseName())
        arguments.append(self.getParameterValue(polygonize.FIELD))

        commands = []
        if SextanteUtils.isWindows():
            commands = ["cmd.exe", "/C ", "gdal_polygonize.bat", GdalUtils.escapeAndJoin(arguments)]
        else:
            commands = ["gdal_polygonize.py", GdalUtils.escapeAndJoin(arguments)]

        GdalUtils.runGdal(commands, progress)
开发者ID:Adam-Brown,项目名称:Quantum-GIS,代码行数:19,代码来源:polygonize.py

示例4: processAlgorithm

# 需要导入模块: from sextante.gdal.GdalUtils import GdalUtils [as 别名]
# 或者: from sextante.gdal.GdalUtils.GdalUtils import escapeAndJoin [as 别名]
 def processAlgorithm(self, progress):
     arguments = []
     arguments.append("-o")
     arguments.append(self.getOutputValue(nearblack.OUTPUT))
     arguments.append("-near")
     arguments.append(str(self.getParameterValue(nearblack.NEAR)))
     if self.getParameterValue(nearblack.WHITE):
         arguments.append("-white")
     arguments.append(self.getParameterValue(nearblack.INPUT))
     GdalUtils.runGdal(["nearblack", GdalUtils.escapeAndJoin(arguments)], progress)
开发者ID:Adam-Brown,项目名称:Quantum-GIS,代码行数:12,代码来源:nearblack.py

示例5: processAlgorithm

# 需要导入模块: from sextante.gdal.GdalUtils import GdalUtils [as 别名]
# 或者: from sextante.gdal.GdalUtils.GdalUtils import escapeAndJoin [as 别名]
    def processAlgorithm(self, progress):
        arguments = []
        if self.getParameterValue(merge.SEPARATE):
            arguments.append("-separate")
        if self.getParameterValue(merge.PCT):
            arguments.append("-pct")
        arguments.append("-o")
        out = self.getOutputValue(merge.OUTPUT)
        arguments.append(out)
        arguments.append("-of")
        arguments.append(GdalUtils.getFormatShortNameFromFilename(out))
        arguments.append(self.getParameterValue(merge.INPUT).replace(";", " "))

        commands = []
        if SextanteUtils.isWindows():
            commands = ["cmd.exe", "/C ", "gdal_merge.bat", GdalUtils.escapeAndJoin(arguments)]
        else:
            commands = ["gdal_merge.py", GdalUtils.escapeAndJoin(arguments)]

        GdalUtils.runGdal(commands, progress)
开发者ID:Hardysong,项目名称:Quantum-GIS,代码行数:22,代码来源:merge.py

示例6: processAlgorithm

# 需要导入模块: from sextante.gdal.GdalUtils import GdalUtils [as 别名]
# 或者: from sextante.gdal.GdalUtils.GdalUtils import escapeAndJoin [as 别名]
 def processAlgorithm(self, progress):
     arguments = []
     if self.getParameterValue(information.NOGCP):
         arguments.append("-nogcp")
     if self.getParameterValue(information.NOMETADATA):
         arguments.append("-nomd")
     arguments.append(self.getParameterValue(information.INPUT))
     GdalUtils.runGdal(["gdalinfo", GdalUtils.escapeAndJoin(arguments)], progress)
     output = self.getOutputValue(information.OUTPUT)
     f = open(output, "w")
     for s in GdalUtils.getConsoleOutput()[1:]:
         f.write("<p>" + str(s) + "</p>")
     f.close()
开发者ID:Adam-Brown,项目名称:Quantum-GIS,代码行数:15,代码来源:information.py

示例7: processAlgorithm

# 需要导入模块: from sextante.gdal.GdalUtils import GdalUtils [as 别名]
# 或者: from sextante.gdal.GdalUtils.GdalUtils import escapeAndJoin [as 别名]
    def processAlgorithm(self, progress):
        out = self.getOutputValue(translate.OUTPUT)
        outsize = str(self.getParameterValue(translate.OUTSIZE))
        outsizePerc = str(self.getParameterValue(translate.OUTSIZE_PERC))
        noData = str(self.getParameterValue(translate.NO_DATA))
        expand = str(self.getParameterFromName(translate.EXPAND).options[self.getParameterValue(translate.EXPAND)])
        projwin = str(self.getParameterValue(translate.PROJWIN))
        crsId = self.getParameterValue(translate.SRS)
        sds = self.getParameterValue(translate.SDS)
        extra = str(self.getParameterValue(translate.EXTRA))

        arguments = []
        arguments.append("-of")
        arguments.append(GdalUtils.getFormatShortNameFromFilename(out))
        if outsizePerc == "True":
            arguments.append("-outsize")
            arguments.append(outsize + "%")
            arguments.append(outsize + "%")
        else:
            arguments.append("-outsize")
            arguments.append(outsize)
            arguments.append(outsize)
        arguments.append("-a_nodata")
        arguments.append(noData)
        if expand != "none":
            arguments.append("-expand")
            arguments.append(expand)
        regionCoords = projwin.split(",")
        arguments.append("-projwin")
        arguments.append(regionCoords[0])
        arguments.append(regionCoords[3])
        arguments.append(regionCoords[1])
        arguments.append(regionCoords[2])
        if crsId is not None:
            arguments.append("-a_srs")
            arguments.append(str(crsId))
            self.crs = QgsCoordinateReferenceSystem(crsId)
        if sds:
            arguments.append("-sds")
        if len(extra) > 0:
            arguments.append(extra)
        arguments.append(self.getParameterValue(translate.INPUT))
        arguments.append(out)

        GdalUtils.runGdal(["gdal_translate", GdalUtils.escapeAndJoin(arguments)], progress)
开发者ID:Adam-Brown,项目名称:Quantum-GIS,代码行数:47,代码来源:translate.py

示例8: processAlgorithm

# 需要导入模块: from sextante.gdal.GdalUtils import GdalUtils [as 别名]
# 或者: from sextante.gdal.GdalUtils.GdalUtils import escapeAndJoin [as 别名]
    def processAlgorithm(self, progress):
        arguments = []
        arguments.append("-s_srs")
        arguments.append(str(self.getParameterValue(warp.SOURCE_SRS)))
        arguments.append("-t_srs")
        crsId = self.getParameterValue(warp.DEST_SRS)
        self.crs = QgsCoordinateReferenceSystem(crsId)
        arguments.append(str(crsId))
        arguments.append("-r")
        arguments.append(warp.METHOD_OPTIONS[self.getParameterValue(warp.METHOD)])
        arguments.append("-of")
        out = self.getOutputValue(warp.OUTPUT)
        arguments.append(GdalUtils.getFormatShortNameFromFilename(out))
        if self.getParameterValue(warp.TR) != 0:
            arguments.append("-tr")
            arguments.append(str(self.getParameterValue(warp.TR)))
            arguments.append(str(self.getParameterValue(warp.TR)))
        extra = str(self.getParameterValue(warp.EXTRA))
        if len(extra) > 0:
            arguments.append(extra)
        arguments.append(self.getParameterValue(warp.INPUT))
        arguments.append(out)

        GdalUtils.runGdal(["gdalwarp", GdalUtils.escapeAndJoin(arguments)], progress)
开发者ID:Adam-Brown,项目名称:Quantum-GIS,代码行数:26,代码来源:warp.py


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