예제 #1
0
    def getConsoleCommands(self):
        output = self.getOutputValue(self.OUTPUT_VECTOR)
        interval = str(self.getParameterValue(self.INTERVAL))
        fieldName = str(self.getParameterValue(self.FIELD_NAME))
        extra = self.getParameterValue(self.EXTRA)
        if extra is not None:
            extra = str(extra)

        arguments = []
        if len(fieldName) > 0:
            arguments.append('-a')
            arguments.append(fieldName)
        arguments.append('-i')
        arguments.append(interval)

        driver = GdalUtils.getVectorDriverFromFileName(output)
        arguments.append('-f')
        arguments.append(driver)

        if extra and len(extra) > 0:
            arguments.append(extra)

        arguments.append(self.getParameterValue(self.INPUT_RASTER))
        arguments.append(output)

        return ['gdal_contour', GdalUtils.escapeAndJoin(arguments)]
예제 #2
0
파일: contour.py 프로젝트: jascase901/QGIS
    def getConsoleCommands(self, parameters, context, feedback):
        output = self.getOutputValue(self.OUTPUT_VECTOR)
        interval = str(self.getParameterValue(self.INTERVAL))
        fieldName = str(self.getParameterValue(self.FIELD_NAME))
        extra = self.getParameterValue(self.EXTRA)
        if extra is not None:
            extra = str(extra)

        arguments = []
        if len(fieldName) > 0:
            arguments.append('-a')
            arguments.append(fieldName)
        arguments.append('-i')
        arguments.append(interval)

        driver = GdalUtils.getVectorDriverFromFileName(output)
        arguments.append('-f')
        arguments.append(driver)

        if extra and len(extra) > 0:
            arguments.append(extra)

        arguments.append(self.getParameterValue(self.INPUT_RASTER))
        arguments.append(output)

        return ['gdal_contour', GdalUtils.escapeAndJoin(arguments)]
예제 #3
0
파일: polygonize.py 프로젝트: rskelly/QGIS
    def getConsoleCommands(self, parameters):
        output = self.getOutputValue(polygonize.OUTPUT)

        arguments = []
        arguments.append(self.getParameterValue(polygonize.INPUT))
        arguments.append('-f')
        arguments.append(GdalUtils.getVectorDriverFromFileName(output))
        arguments.append(output)
        arguments.append(QFileInfo(output).baseName())
        arguments.append(self.getParameterValue(polygonize.FIELD))

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

        return commands