コード例 #1
0
    def createAlgsList(self):
        #First we populate the list of algorithms with those created extending
        #GeoAlgorithm directly (those that execute GDAL using the console)

        self.preloadedAlgs = [
            nearblack(),
            information(),
            warp(),
            translate(),
            rgb2pct(),
            pct2rgb(),
            merge(),
            polygonize(),
            gdaladdo(),
            OgrInfo(),
            Ogr2Ogr(),
            OgrSql()
        ]

        #And then we add those that are created as python scripts
        folder = self.scriptsFolder()
        for descriptionFile in os.listdir(folder):
            if descriptionFile.endswith("py"):
                try:
                    fullpath = os.path.join(self.scriptsFolder(),
                                            descriptionFile)
                    alg = GdalAlgorithm(fullpath)
                    self.preloadedAlgs.append(alg)
                except WrongScriptException, e:
                    ProcessingLog.addToLog(ProcessingLog.LOG_ERROR, e.msg)
コード例 #2
0
    def createAlgsList(self):
        # First we populate the list of algorithms with those created
        # extending GeoAlgorithm directly (those that execute GDAL
        # using the console)
        self.preloadedAlgs = [nearblack(), information(), warp(), translate(),
            rgb2pct(), pct2rgb(), merge(), polygonize(), gdaladdo(),
            ClipByExtent(), ClipByMask(), contour(), rasterize(), proximity(),
            sieve(), fillnodata(), ExtractProjection(), gdal2xyz(),
            hillshade(), slope(), aspect(), tri(), tpi(), roughness(),
            ColorRelief(), GridInvDist(), GridAverage(), GridNearest(),
            GridDataMetrics(),
            # ----- OGR tools -----
            OgrInfo(), Ogr2Ogr(), OgrSql(),
            ]

        # And then we add those that are created as python scripts
        folder = self.scriptsFolder()
        if os.path.exists(folder):
            for descriptionFile in os.listdir(folder):
                if descriptionFile.endswith('py'):
                    try:
                        fullpath = os.path.join(self.scriptsFolder(),
                                descriptionFile)
                        alg = GdalAlgorithm(fullpath)
                        self.preloadedAlgs.append(alg)
                    except WrongScriptException, e:
                        ProcessingLog.addToLog(ProcessingLog.LOG_ERROR, e.msg)
コード例 #3
0
    def createAlgsList(self):
        # First we populate the list of algorithms with those created
        # extending GeoAlgorithm directly (those that execute GDAL
        # using the console)
        self.preloadedAlgs = [
            nearblack(),
            information(),
            warp(),
            translate(),
            rgb2pct(),
            pct2rgb(),
            merge(),
            polygonize(),
            gdaladdo(),
            ClipByExtent(),
            ClipByMask(),
            contour(),
            rasterize(),
            proximity(),
            sieve(),
            fillnodata(),
            ExtractProjection(),
            gdal2xyz(),
            hillshade(),
            slope(),
            aspect(),
            tri(),
            tpi(),
            roughness(),
            ColorRelief(),
            GridInvDist(),
            GridAverage(),
            GridNearest(),
            GridDataMetrics(),
            # ----- OGR tools -----
            OgrInfo(),
            Ogr2Ogr(),
            OgrSql(),
        ]

        # And then we add those that are created as python scripts
        folder = self.scriptsFolder()
        if os.path.exists(folder):
            for descriptionFile in os.listdir(folder):
                if descriptionFile.endswith('py'):
                    try:
                        fullpath = os.path.join(self.scriptsFolder(),
                                                descriptionFile)
                        alg = GdalAlgorithm(fullpath)
                        self.preloadedAlgs.append(alg)
                    except WrongScriptException, e:
                        ProcessingLog.addToLog(ProcessingLog.LOG_ERROR, e.msg)
コード例 #4
0
    def createAlgsList(self):
        #First we populate the list of algorithms with those created extending
        #GeoAlgorithm directly (those that execute GDAL using the console)

        self.preloadedAlgs = [nearblack(), information(), warp(), translate(),
                              rgb2pct(), pct2rgb(), merge(), polygonize(), gdaladdo(),
                              OgrInfo(), Ogr2Ogr(), OgrSql()]

        #And then we add those that are created as python scripts
        folder = self.scriptsFolder()
        for descriptionFile in os.listdir(folder):
            if descriptionFile.endswith("py"):
                try:
                    fullpath = os.path.join(self.scriptsFolder(), descriptionFile)
                    alg = GdalAlgorithm(fullpath)
                    self.preloadedAlgs.append(alg)
                except WrongScriptException,e:
                    ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,e.msg)