def __init__(self):
     AlgorithmProvider.__init__(self)
     self.actions.append(CreateNewScriptAction('Create new script',
                         CreateNewScriptAction.SCRIPT_PYTHON))
     self.contextMenuActions = \
         [EditScriptAction(EditScriptAction.SCRIPT_PYTHON),
          DeleteScriptAction(DeleteScriptAction.SCRIPT_PYTHON)]
Esempio n. 2
0
 def unload(self):
     AlgorithmProvider.unload(self)
     ProcessingConfig.removeSetting(RUtils.RSCRIPTS_FOLDER)
     if isWindows():
         ProcessingConfig.removeSetting(RUtils.R_FOLDER)
         ProcessingConfig.removeSetting(RUtils.R_LIBS_USER)
         ProcessingConfig.removeSetting(RUtils.R_USE64)
 def unload(self):
     """Setting should be removed here, so they do not appear anymore
     when the plugin is unloaded.
     """
     AlgorithmProvider.unload(self)
     ProcessingConfig.removeSetting(
         Basis_nl_algorithm_provider.INPUT_FOLDER)
    def __init__(self):
        AlgorithmProvider.__init__(self)

        # Activate provider by default
        self.activate = True

        # Load algorithms
        self.alglist = [
            ImportRoadLayer(),
            SymbolizeRoadLayer(),
            StandardizeRoadLayer(),
            MakeRoadNetwork(),
            CalculateStress(),
            AddSymbolizedStressLayer(),
            GetCrossStreets(),
            ShortestPathFromLayer(),
            Meld(),
            TravelShed(),
            CalculateNetworkCostFromDistance(),
            CalculateNetworkCostFromTime(),
            AddTdgId(),
            CopyViaTDGId(),
            CopyRoadNetwork(),
            SymbolizeNetworkLinks(),
            RoadSlope(),
            # AddRoadSymbolFields(),
            StationDensity(),
            GridConnectivity(),
            AccessGrid()]
        for alg in self.alglist:
            alg.provider = self
Esempio n. 5
0
 def initializeSettings(self):
     AlgorithmProvider.initializeSettings(self)
     if isWindows() or isMac():
         ProcessingConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_FOLDER, "GRASS folder", GrassUtils.grassPath()))
         ProcessingConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_WIN_SHELL, "Msys folder", GrassUtils.grassWinShell()))
     ProcessingConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_LOG_COMMANDS, "Log execution commands", False))
     ProcessingConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_LOG_CONSOLE, "Log console output", False))
Esempio n. 6
0
 def initializeSettings(self):
     AlgorithmProvider.initializeSettings(self)
     ProcessingConfig.addSetting(
         Setting(
             self.getDescription(),
             OTBUtils.OTB_FOLDER,
             self.tr("OTB command line tools folder"),
             OTBUtils.findOtbPath(),
             valuetype=Setting.FOLDER))
     ProcessingConfig.addSetting(
         Setting(
             self.getDescription(),
             OTBUtils.OTB_LIB_FOLDER,
             self.tr("OTB applications folder"),
             OTBUtils.findOtbLibPath(),
             valuetype=Setting.FOLDER))
     ProcessingConfig.addSetting(
         Setting(
             self.getDescription(),
             OTBUtils.OTB_SRTM_FOLDER,
             self.tr("SRTM tiles folder"),
             OTBUtils.otbSRTMPath(),
             valuetype=Setting.FOLDER))
     ProcessingConfig.addSetting(
         Setting(
             self.getDescription(),
             OTBUtils.OTB_GEOID_FILE,
             self.tr("Geoid file"),
             OTBUtils.otbGeoidPath(),
             valuetype=Setting.FOLDER))
Esempio n. 7
0
 def initializeSettings(self):
     AlgorithmProvider.initializeSettings(self)
     ProcessingConfig.addSetting(
         Setting(
             self.getDescription(),
             LAStoolsUtils.LASTOOLS_FOLDER,
             self.tr("LAStools folder"),
             LAStoolsUtils.LAStoolsPath(),
             valuetype=Setting.FOLDER,
         )
     )
     ProcessingConfig.addSetting(
         Setting(
             self.getDescription(),
             FusionUtils.FUSION_FOLDER,
             self.tr("Fusion folder"),
             FusionUtils.FusionPath(),
             valuetype=Setting.FOLDER,
         )
     )
     if not isWindows():
         ProcessingConfig.addSetting(
             Setting(
                 self.getDescription(),
                 LAStoolsUtils.WINE_FOLDER,
                 self.tr("Wine folder"),
                 "",
                 valuetype=Setting.FOLDER,
             )
         )
Esempio n. 8
0
    def unload(self):
        AlgorithmProvider.unload(self)
        if isWindows():
            ProcessingConfig.removeSetting(SagaUtils.SAGA_FOLDER)

        ProcessingConfig.removeSetting(SagaUtils.SAGA_LOG_CONSOLE)
        ProcessingConfig.removeSetting(SagaUtils.SAGA_LOG_COMMANDS)
 def unload(self):
     AlgorithmProvider.unload(self)
     if isWindows() or isMac():
         ProcessingConfig.removeSetting(Grass7Utils.GRASS_FOLDER)
         ProcessingConfig.removeSetting(Grass7Utils.GRASS_WIN_SHELL)
     ProcessingConfig.removeSetting(Grass7Utils.GRASS_LOG_COMMANDS)
     ProcessingConfig.removeSetting(Grass7Utils.GRASS_LOG_CONSOLE)
Esempio n. 10
0
    def unload(self):
        AlgorithmProvider.unload(self)
        if (isWindows() or isMac()) and SagaUtils.findSagaFolder() is None:
            ProcessingConfig.removeSetting(SagaUtils.SAGA_FOLDER)

        ProcessingConfig.removeSetting(SagaUtils.SAGA_LOG_CONSOLE)
        ProcessingConfig.removeSetting(SagaUtils.SAGA_LOG_COMMANDS)
Esempio n. 11
0
 def unload(self):
     """Setting should be removed here, so they do not appear anymore
     when the plugin is unloaded.
     """
     AlgorithmProvider.unload(self)
     ProcessingConfig.removeSetting(
         ExampleAlgorithmProvider.MY_DUMMY_SETTING)
 def unload(self):
     """Setting should be removed here, so they do not appear anymore
     when the plugin is unloaded.
     """
     AlgorithmProvider.unload(self)
     ProcessingConfig.removeSetting(
         DifferentialPrivacyUtils.DIFFERENTIAL_EPSILON)
 def initializeSettings(self):
     AlgorithmProvider.initializeSettings(self)
     ProcessingConfig.addSetting(Setting(
         self.getDescription(),
         GdalUtils.GDAL_HELP_PATH,
         self.tr('Location of GDAL docs'),
         GdalUtils.gdalHelpPath()))
    def __init__(self):
        AlgorithmProvider.__init__(self)
        self.activate = False
        self.algsList = []
        if isWindows():
            lastools = [
                lasground(), lasheight(), lasclassify(), lasclip(), lastile(),
                lasgrid(), las2dem(), blast2dem(), las2iso(), blast2iso(),
                lasview(), lasboundary(), lasinfo(), lasprecision(),
                lasvalidate(), lasduplicate(), las2txt(), txt2las(), laszip(),
                lasindex(), lasthin(), lassort(), lascanopy(), lasmerge(),
                las2shp(), shp2las(), lasnoise(), lassplit(), las2las_filter(),
                las2las_transform(), lasoverage(), lasoverlap()
                ]
        else:
            lastools = [
                lasinfo(), lasprecision(), lasvalidate(), las2txt(), txt2las(),
                laszip(), lasindex(), lasmerge(), las2las_filter(),
                las2las_transform()
                ]
        for alg in lastools:
            alg.group = 'LAStools'
        self.algsList.extend(lastools)

        if isWindows():
            self.actions.append(OpenViewerAction())
            fusiontools = [
                CloudMetrics(), CanopyMaxima(), CanopyModel(), ClipData(),
                Cover(), FilterData(), GridMetrics(), GroundFilter(),
                GridSurfaceCreate(), MergeData()
                ]
            for alg in fusiontools:
                alg.group = 'Fusion'
            self.algsList.extend(fusiontools)
    def __init__(self):
        AlgorithmProvider.__init__(self)

        self.activate = False

        self.alglist = [mcp(), RandomHR(), RandomPath()]

        # Check scipy
        try:
            from scipy.stats.kde import gaussian_kde
            has_scipy = True
        except:
            has_scipy = False
        # Check statsmodels
        try:
            from statsmodels.nonparametric import kernel_density
            has_statsmodels = True
        except:
            has_statsmodels = False
        # Check gdal_contour
        try:
            subprocess.call('gdal_contour')
            has_gdal_contour = True
        except:
            has_gdal_contour = False

        if has_gdal_contour and (has_scipy or has_statsmodels):
            self.alglist.append(kernelDensity())

        for alg in self.alglist:
            alg.provider = self
    def initializeSettings(self):
        AlgorithmProvider.initializeSettings(self)

        ProcessingConfig.addSetting(Setting('AniMove',
            self.FIELD_SEPARATOR, 'CSV field separator', ','))
        ProcessingConfig.addSetting(Setting('AniMove',
            self.DECIMAL_SEPARATOR, 'CSV decimal separator', '.'))
Esempio n. 17
0
    def __init__(self):
        AlgorithmProvider.__init__(self)
        self.alglist = [SumLines(), PointsInPolygon(),
                        PointsInPolygonWeighted(), PointsInPolygonUnique(),
                        BasicStatisticsStrings(), BasicStatisticsNumbers(),
                        NearestNeighbourAnalysis(), MeanCoords(),
                        LinesIntersection(), UniqueValues(), PointDistance(),
                        ReprojectLayer(), ExportGeometryInfo(), Centroids(),
                        Delaunay(), VoronoiPolygons(), SimplifyGeometries(),
                        DensifyGeometries(), DensifyGeometriesInterval(),
                        MultipartToSingleparts(), SinglePartsToMultiparts(),
                        PolygonsToLines(), LinesToPolygons(), ExtractNodes(),
                        Eliminate(), ConvexHull(), FixedDistanceBuffer(),
                        VariableDistanceBuffer(), Dissolve(), Difference(),
                        Intersection(), Union(), Clip(), ExtentFromLayer(),
                        RandomSelection(), RandomSelectionWithinSubsets(),
                        SelectByLocation(), RandomExtract(),
                        RandomExtractWithinSubsets(), ExtractByLocation(),
                        SpatialJoin(),
                        # ------ mmqgisx ------
                        mmqgisx_delete_columns_algorithm(),
                        mmqgisx_delete_duplicate_geometries_algorithm(),
                        mmqgisx_geometry_convert_algorithm(),
                        mmqgisx_grid_algorithm(),
                        mmqgisx_gridify_algorithm(),
                        mmqgisx_hub_distance_algorithm(),
                        mmqgisx_hub_lines_algorithm(),
                        mmqgisx_merge_algorithm(),
                        mmqgisx_select_algorithm(),
                        mmqgisx_extract_algorithm(),
                        mmqgisx_text_to_float_algorithm(),
                        # ------ native algs ------
                        AddTableField(), FieldsCalculator(),
                        SaveSelectedFeatures(), JoinAttributes(),
                        AutoincrementalField(), Explode(), FieldsPyculator(),
                        EquivalentNumField(), PointsLayerFromTable(),
                        StatisticsByCategories(), ConcaveHull(), Polygonize(),
                        RasterLayerStatistics(), PointsDisplacement(),
                        ZonalStatistics(), PointsFromPolygons(),
                        PointsFromLines(), RandomPointsExtent(),
                        RandomPointsLayer(), RandomPointsPolygonsFixed(),
                        RandomPointsPolygonsVariable(),
                        RandomPointsAlongLines(), PointsToPaths(),
                        PostGISExecuteSQL(), ImportIntoPostGIS(),
                        SetVectorStyle(), SetRasterStyle(), SelectByExpression()
                        # ------ raster ------
                        # CreateConstantRaster(),
                        # ------ graphics ------
                        # VectorLayerHistogram(), VectorLayerScatterplot(),
                        # RasterLayerHistogram(), MeanAndStdDevPlot(),
                        # BarPlot(), PolarPlot()
                       ]

        folder = os.path.join(os.path.dirname(__file__), 'scripts')
        scripts = ScriptUtils.loadFromFolder(folder)
        for script in scripts:
            script.allowEdit = False
        self.alglist.extend(scripts)
        for alg in self.alglist:
            alg._icon = self._icon
Esempio n. 18
0
 def __init__(self):
     AlgorithmProvider.__init__(self)
     self.activate = False
     #self.actions.append(CreateNewScriptAction("Create new R script", CreateNewScriptAction.SCRIPT_R))
     self.contextMenuActions = [EditScriptAction(EditScriptAction.SCRIPT_R),
                                DeleteScriptAction(DeleteScriptAction.SCRIPT_R)
                               ]
    def __init__(self):
        AlgorithmProvider.__init__(self)

        self.alglist = [BufferByFixedPercentageAlgorithm(),
            BufferByVariablePercentageAlgorithm()]
        for alg in self.alglist:
            alg.provider = self
Esempio n. 20
0
 def initializeSettings(self):
     AlgorithmProvider.initializeSettings(self)
     ProcessingConfig.addSetting(
         Setting(
             self.getDescription(),
             RUtils.RSCRIPTS_FOLDER,
             self.tr("R Scripts folder"),
             RUtils.defaultRScriptsFolder(),
             valuetype=Setting.MULTIPLE_FOLDERS,
         )
     )
     if isWindows():
         ProcessingConfig.addSetting(
             Setting(
                 self.getDescription(),
                 RUtils.R_FOLDER,
                 self.tr("R folder"),
                 RUtils.RFolder(),
                 valuetype=Setting.FOLDER,
             )
         )
         ProcessingConfig.addSetting(
             Setting(
                 self.getDescription(),
                 RUtils.R_LIBS_USER,
                 self.tr("R user library folder"),
                 RUtils.RLibs(),
                 valuetype=Setting.FOLDER,
             )
         )
         ProcessingConfig.addSetting(
             Setting(self.getDescription(), RUtils.R_USE64, self.tr("Use 64 bit version"), False)
         )
    def __init__(self):
        AlgorithmProvider.__init__(self)
        self.alglist = [mcp()]

        # Check scipy
        try:
            from scipy.stats.kde import gaussian_kde
            has_scipy = True
        except:
            has_scipy = False
        # Check statsmodels
        try:
            from statsmodels.nonparametric import kernel_density
            has_statsmodels = True
        except:
            has_statsmodels = False
        # Check gdal_contour
        try:
            subprocess.call('gdal_contour')
            has_gdal_contour = True
        except:
            has_gdal_contour = False

        ProcessingLog.addToLog(ProcessingLog.LOG_INFO,
                    "Scipy found: " + str(has_scipy))
        ProcessingLog.addToLog(ProcessingLog.LOG_INFO,
                    "Statsmodels found: " + str(has_statsmodels))
        ProcessingLog.addToLog(ProcessingLog.LOG_INFO,
                    "gdal_contour found: " + str(has_gdal_contour))

        if has_gdal_contour and (has_scipy or has_statsmodels):
            self.alglist.append(kernelDensity())
 def initializeSettings(self):
     AlgorithmProvider.initializeSettings(self)
     ProcessingConfig.addSetting(Setting(self.getDescription(),
             LAStoolsUtils.LASTOOLS_FOLDER,
             'LAStools folder', LAStoolsUtils.LAStoolsPath()))
     ProcessingConfig.addSetting(Setting(self.getDescription(),
             FusionUtils.FUSION_FOLDER,
             'Fusion folder', FusionUtils.FusionPath()))
Esempio n. 23
0
 def __init__(self):
     AlgorithmProvider.__init__(self)
     self.actions.extend([CreateNewScriptAction('Create new script',
                         CreateNewScriptAction.SCRIPT_PYTHON),
                         AddScriptFromFileAction()])
     self.contextMenuActions = \
         [EditScriptAction(EditScriptAction.SCRIPT_PYTHON),
          DeleteScriptAction(DeleteScriptAction.SCRIPT_PYTHON)]
Esempio n. 24
0
 def initializeSettings(self):
     '''In this method we add settings needed to configure our provider.
     Do not forget to call the parent method, since it takes care or
     automatically adding a setting for activating or deactivating the
     algorithms in the provider'''
     AlgorithmProvider.initializeSettings(self)
     #SextanteConfig.addSetting(Setting(self.getDescription(), LecoSAlgorithmsProv.tmpdir, "Temporary Directory", tmpdir))
     '''To get the parameter of a setting parameter, use SextanteConfig.getSetting(name_of_parameter)'''
Esempio n. 25
0
 def __init__(self):
     AlgorithmProvider.__init__(self)
     # deactivate provider by default
     self.activate = False
     # load algorithms
     self.alglist = [ExampleAlgorithm()]
     for alg in self.alglist:
         alg.provider = self
    def __init__(self):
        AlgorithmProvider.__init__(self)

        self.activate = False

        self.alglist = [Pairwise(), OneToAll(), Advanced()]
        for alg in self.alglist:
            alg.provider = self
    def __init__(self):
        AlgorithmProvider.__init__(self)

        self.activate = False

        self.alglist = [LocalMoran()]
        for alg in self.alglist:
            alg.provider = self
Esempio n. 28
0
    def __init__(self):
        AlgorithmProvider.__init__(self)

        self.activate = True

        self.alglist = [NodeIndexing(), ArcUpstreamDownstream(), StrahlerOrder(), BifurcationRatios()]
        for alg in self.alglist:
            alg.provider = self
    def unload(self):
        """Setting should be removed here, so they do not appear anymore
        when the plugin is unloaded.

        """
        AlgorithmProvider.unload(self)
        ProcessingConfig.removeSetting(
            PolygonsParallelToLineProvider.MY_SETTING)
 def unload(self):
     """
     Setting should be removed here, so they do not appear anymore
     when the plugin is unloaded.
     """
     AlgorithmProvider.unload(self)
     ProcessingConfig.removeSetting(
         GISCloudUtils.GISCloud_character)
Esempio n. 31
0
 def __init__(self):
     AlgorithmProvider.__init__(self)
     self.activate = True
     self.createAlgsList()  #preloading algorithms to speed up
Esempio n. 32
0
 def unload(self):
     AlgorithmProvider.unload(self)
Esempio n. 33
0
 def initializeSettings(self):
     AlgorithmProvider.initializeSettings(self)
Esempio n. 34
0
 def __init__(self):
     AlgorithmProvider.__init__(self)
     self.activate = True
Esempio n. 35
0
 def icon(self):
     """We return the default icon.
     """
     return AlgorithmProvider.icon(self)
Esempio n. 36
0
 def unload(self):
     AlgorithmProvider.unload(self)
     ProcessingConfig.addSetting(ScriptUtils.SCRIPTS_FOLDER)