Example #1
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
Example #2
0
 def loadAlgorithms(self):
     self.algs = []
     folders = ScriptUtils.scriptsFolders()
     for f in folders:
         self.algs.extend(ScriptUtils.loadFromFolder(f))
     self.algs.extend(self.folder_algorithms)
     for a in self.algs:
         self.addAlgorithm(a)
Example #3
0
 def addScripts(folder):
     Processing.initialize()
     provider = QgsApplication.processingRegistry().providerById("qgis")
     scripts = ScriptUtils.loadFromFolder(folder)
     # fix_print_with_import
     print(scripts)
     for script in scripts:
         script.allowEdit = False
         script._icon = provider._icon
     provider.externalAlgs.extend(scripts)
     provider.refreshAlgorithms()
Example #4
0
 def addScripts(folder):
     Processing.initialize()
     provider = Processing.getProviderFromName("qgis")
     scripts = ScriptUtils.loadFromFolder(folder)
     print scripts
     for script in scripts:
         script.allowEdit = False
         script._icon = provider._icon
         script.provider = provider
     provider.externalAlgs.extend(scripts)
     Processing.reloadProvider("qgis")
 def _loadAlgorithms(self):
     folder = ScriptUtils.scriptsFolder()
     self.algs = ScriptUtils.loadFromFolder(folder)
Example #6
0
 def _loadAlgorithms(self):
     folders = ScriptUtils.scriptsFolders()
     self.algs = []
     for f in folders:
         self.algs.extend(ScriptUtils.loadFromFolder(f))
    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(), DeleteHoles(),
                        RandomExtractWithinSubsets(), ExtractByLocation(),
                        SpatialJoin(), RegularPoints(), SymmetricalDifference(),
                        VectorSplit(), VectorGrid(), DeleteColumn(),
                        DeleteDuplicateGeometries(), TextToFloat(),
                        ExtractByAttribute(), SelectByAttribute(), Grid(),
                        Gridify(), HubDistance(), HubLines(), Merge(),
                        GeometryConvert(), 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(), HypsometricCurves(),
                        SplitLinesWithLines(), CreateConstantRaster(),
                        FieldsMapper(), SelectByAttributeSum(), Datasources2Vrt(),
                        CheckValidity()
                        ]

        if hasMatplotlib:
            from VectorLayerHistogram import VectorLayerHistogram
            from RasterLayerHistogram import RasterLayerHistogram
            from VectorLayerScatterplot import VectorLayerScatterplot
            from MeanAndStdDevPlot import MeanAndStdDevPlot
            from BarPlot import BarPlot
            from PolarPlot import PolarPlot

            self.alglist.extend([
                VectorLayerHistogram(), RasterLayerHistogram(),
                VectorLayerScatterplot(), 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
Example #8
0
    def __init__(self):
        AlgorithmProvider.__init__(self)
        self._icon = QIcon(os.path.join(pluginPath, 'images', 'qgis.svg'))

        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(), DeleteHoles(),
                        RandomExtractWithinSubsets(), ExtractByLocation(),
                        SpatialJoin(), RegularPoints(), SymmetricalDifference(),
                        VectorSplit(), VectorGridLines(), VectorGridPolygons(),
                        DeleteColumn(), DeleteDuplicateGeometries(), TextToFloat(),
                        ExtractByAttribute(), SelectByAttribute(), GridPolygon(),
                        GridLine(), Gridify(), HubDistancePoints(),
                        HubDistanceLines(), HubLines(), Merge(),
                        GeometryConvert(), AddTableField(), FieldsCalculator(),
                        SaveSelectedFeatures(), JoinAttributes(),
                        AutoincrementalField(), Explode(), FieldsPyculator(),
                        EquivalentNumField(), PointsLayerFromTable(),
                        StatisticsByCategories(), ConcaveHull(),
                        RasterLayerStatistics(), PointsDisplacement(),
                        ZonalStatistics(), PointsFromPolygons(),
                        PointsFromLines(), RandomPointsExtent(),
                        RandomPointsLayer(), RandomPointsPolygonsFixed(),
                        RandomPointsPolygonsVariable(),
                        RandomPointsAlongLines(), PointsToPaths(),
                        SpatialiteExecuteSQL(), ImportIntoSpatialite(),
                        PostGISExecuteSQL(), ImportIntoPostGIS(),
                        SetVectorStyle(), SetRasterStyle(),
                        SelectByExpression(), HypsometricCurves(),
                        SplitLinesWithLines(), CreateConstantRaster(),
                        FieldsMapper(), SelectByAttributeSum(), Datasources2Vrt(),
                        CheckValidity(), OrientedMinimumBoundingBox(), Smooth(),
                        ReverseLineDirection(), SpatialIndex(), DefineProjection(),
                        RectanglesOvalsDiamondsVariable(),
                        RectanglesOvalsDiamondsFixed(), MergeLines(),
                        BoundingBox(), Boundary(), PointOnSurface(),
                        OffsetLine(), PolygonCentroids(), Translate(),
                        SingleSidedBuffer(), PointsAlongGeometry(),
                        Aspect(), Slope(), Ruggedness(), Hillshade(),
                        ReliefAuto(), ZonalStatisticsQgis(),
                        IdwInterpolationZValue(), IdwInterpolationAttribute(),
                        TinInterpolationZValue(), TinInterpolationAttribute(),
                        RemoveNullGeometry(), ExtractByExpression(), ExtendLines(),
                        ExtractSpecificNodes()
                        ]

        if hasMatplotlib:
            from .VectorLayerHistogram import VectorLayerHistogram
            from .RasterLayerHistogram import RasterLayerHistogram
            from .VectorLayerScatterplot import VectorLayerScatterplot
            from .MeanAndStdDevPlot import MeanAndStdDevPlot
            from .BarPlot import BarPlot
            from .PolarPlot import PolarPlot

            self.alglist.extend([
                VectorLayerHistogram(), RasterLayerHistogram(),
                VectorLayerScatterplot(), MeanAndStdDevPlot(), BarPlot(),
                PolarPlot(),
            ])

        if hasShapely:
            from .Polygonize import Polygonize
            self.alglist.extend([Polygonize()])

        if Qgis.QGIS_VERSION_INT >= 21300:
            from .ExecuteSQL import ExecuteSQL
            self.alglist.extend([ExecuteSQL()])

        self.externalAlgs = []  # to store algs added by 3rd party plugins as scripts

        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
Example #9
0
 def _loadAlgorithms(self):
     folders = ScriptUtils.scriptsFolders()
     self.algs = []
     for f in folders:
         self.algs.extend(ScriptUtils.loadFromFolder(f))
Example #10
0
 def addAlgorithmsFromFolder(self, folder):
     self.algs.extend(ScriptUtils.loadFromFolder(folder))
Example #11
0
 def _loadAlgorithms(self):
     folder = ScriptUtils.scriptsFolder()
     self.algs = ScriptUtils.loadFromFolder(folder)
    def __init__(self):
        AlgorithmProvider.__init__(self)
        self._icon = QIcon(os.path.join(pluginPath, 'images', 'qgis.svg'))

        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(),
            DeleteHoles(),
            RandomExtractWithinSubsets(),
            ExtractByLocation(),
            SpatialJoin(),
            RegularPoints(),
            SymmetricalDifference(),
            VectorSplit(),
            VectorGridLines(),
            VectorGridPolygons(),
            DeleteColumn(),
            DeleteDuplicateGeometries(),
            TextToFloat(),
            ExtractByAttribute(),
            SelectByAttribute(),
            GridPolygon(),
            GridLine(),
            Gridify(),
            HubDistancePoints(),
            HubDistanceLines(),
            HubLines(),
            Merge(),
            GeometryConvert(),
            AddTableField(),
            FieldsCalculator(),
            SaveSelectedFeatures(),
            JoinAttributes(),
            AutoincrementalField(),
            Explode(),
            FieldsPyculator(),
            EquivalentNumField(),
            PointsLayerFromTable(),
            StatisticsByCategories(),
            ConcaveHull(),
            RasterLayerStatistics(),
            PointsDisplacement(),
            ZonalStatistics(),
            PointsFromPolygons(),
            PointsFromLines(),
            RandomPointsExtent(),
            RandomPointsLayer(),
            RandomPointsPolygonsFixed(),
            RandomPointsPolygonsVariable(),
            RandomPointsAlongLines(),
            PointsToPaths(),
            SpatialiteExecuteSQL(),
            ImportIntoSpatialite(),
            PostGISExecuteSQL(),
            ImportIntoPostGIS(),
            SetVectorStyle(),
            SetRasterStyle(),
            SelectByExpression(),
            HypsometricCurves(),
            SplitWithLines(),
            SplitLinesWithLines(),
            CreateConstantRaster(),
            FieldsMapper(),
            SelectByAttributeSum(),
            Datasources2Vrt(),
            CheckValidity(),
            OrientedMinimumBoundingBox(),
            Smooth(),
            ReverseLineDirection(),
            SpatialIndex(),
            DefineProjection(),
            RectanglesOvalsDiamondsVariable(),
            RectanglesOvalsDiamondsFixed(),
            MergeLines(),
            BoundingBox(),
            Boundary(),
            PointOnSurface(),
            OffsetLine(),
            PolygonCentroids(),
            Translate(),
            SingleSidedBuffer(),
            PointsAlongGeometry(),
            Aspect(),
            Slope(),
            Ruggedness(),
            Hillshade(),
            Relief(),
            ZonalStatisticsQgis(),
            IdwInterpolation(),
            TinInterpolation(),
            RemoveNullGeometry(),
            ExtractByExpression(),
            ExtendLines(),
            ExtractSpecificNodes(),
            GeometryByExpression(),
            SnapGeometriesToLayer(),
            PoleOfInaccessibility(),
            CreateAttributeIndex(),
            DropGeometry(),
            BasicStatisticsForField(),
            RasterCalculator(),
            Heatmap(),
            Orthogonalize(),
            ShortestPathPointToPoint(),
            ShortestPathPointToLayer(),
            ShortestPathLayerToPoint(),
            ServiceAreaFromPoint(),
            ServiceAreaFromLayer(),
            TruncateTable()
        ]

        if hasMatplotlib:
            from .VectorLayerHistogram import VectorLayerHistogram
            from .RasterLayerHistogram import RasterLayerHistogram
            from .VectorLayerScatterplot import VectorLayerScatterplot
            from .MeanAndStdDevPlot import MeanAndStdDevPlot
            from .BarPlot import BarPlot
            from .PolarPlot import PolarPlot

            self.alglist.extend([
                VectorLayerHistogram(),
                RasterLayerHistogram(),
                VectorLayerScatterplot(),
                MeanAndStdDevPlot(),
                BarPlot(),
                PolarPlot(),
            ])

        if hasShapely:
            from .Polygonize import Polygonize
            self.alglist.extend([Polygonize()])

        if Qgis.QGIS_VERSION_INT >= 21300:
            from .ExecuteSQL import ExecuteSQL
            self.alglist.extend([ExecuteSQL()])

        self.externalAlgs = [
        ]  # to store algs added by 3rd party plugins as scripts

        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
Example #13
0
    def getAlgs(self):
        algs = [
            AddTableField(),
            Aggregate(),
            Aspect(),
            BasicStatisticsForField(),
            CheckValidity(),
            ConcaveHull(),
            CreateAttributeIndex(),
            CreateConstantRaster(),
            Datasources2Vrt(),
            DefineProjection(),
            Delaunay(),
            DeleteColumn(),
            DeleteDuplicateGeometries(),
            DeleteHoles(),
            DensifyGeometries(),
            DensifyGeometriesInterval(),
            Difference(),
            EliminateSelection(),
            EquivalentNumField(),
            ExecuteSQL(),
            Explode(),
            ExportGeometryInfo(),
            ExtendLines(),
            ExtentFromLayer(),
            ExtractNodes(),
            ExtractSpecificNodes(),
            FieldsCalculator(),
            FieldsMapper(),
            FieldsPyculator(),
            FindProjection(),
            FixedDistanceBuffer(),
            GeometryByExpression(),
            GeometryConvert(),
            Gridify(),
            GridLine(),
            GridPolygon(),
            Heatmap(),
            Hillshade(),
            HubDistanceLines(),
            HubDistancePoints(),
            HypsometricCurves(),
            IdwInterpolation(),
            ImportIntoPostGIS(),
            ImportIntoSpatialite(),
            Intersection(),
            LinesToPolygons(),
            Merge(),
            MinimumBoundingGeometry(),
            NearestNeighbourAnalysis(),
            OffsetLine(),
            Orthogonalize(),
            PointDistance(),
            PointOnSurface(),
            PointsAlongGeometry(),
            PointsDisplacement(),
            PointsFromLines(),
            PointsFromPolygons(),
            PointsInPolygon(),
            PointsLayerFromTable(),
            PointsToPaths(),
            PoleOfInaccessibility(),
            Polygonize(),
            PolygonsToLines(),
            PostGISExecuteSQL(),
            RandomExtract(),
            RandomExtractWithinSubsets(),
            RandomPointsAlongLines(),
            RandomPointsExtent(),
            RandomPointsLayer(),
            RandomPointsPolygons(),
            RandomSelection(),
            RandomSelectionWithinSubsets(),
            RasterCalculator(),
            RasterizeAlgorithm(),
            RasterLayerStatistics(),
            RectanglesOvalsDiamondsFixed(),
            RectanglesOvalsDiamondsVariable(),
            RegularPoints(),
            Relief(),
            ReverseLineDirection(),
            Ruggedness(),
            SelectByAttribute(),
            SelectByExpression(),
            ServiceAreaFromLayer(),
            ServiceAreaFromPoint(),
            SetMValue(),
            SetRasterStyle(),
            SetVectorStyle(),
            SetZValue(),
            ShortestPathLayerToPoint(),
            ShortestPathPointToLayer(),
            ShortestPathPointToPoint(),
            SingleSidedBuffer(),
            Slope(),
            SnapGeometriesToLayer(),
            SpatialiteExecuteSQL(),
            SpatialIndex(),
            SpatialJoin(),
            SpatialJoinSummary(),
            StatisticsByCategories(),
            SumLines(),
            SymmetricalDifference(),
            TextToFloat(),
            TinInterpolation(),
            TopoColor(),
            Translate(),
            TruncateTable(),
            Union(),
            UniqueValues(),
            VariableDistanceBuffer(),
            VectorSplit(),
            VoronoiPolygons(),
            ZonalStatistics()
        ]

        if hasPlotly:
            from .BarPlot import BarPlot
            from .BoxPlot import BoxPlot
            from .MeanAndStdDevPlot import MeanAndStdDevPlot
            from .PolarPlot import PolarPlot
            from .RasterLayerHistogram import RasterLayerHistogram
            from .VectorLayerHistogram import VectorLayerHistogram
            from .VectorLayerScatterplot import VectorLayerScatterplot
            from .VectorLayerScatterplot3D import VectorLayerScatterplot3D

            algs.extend([
                BarPlot(),
                BoxPlot(),
                MeanAndStdDevPlot(),
                PolarPlot(),
                RasterLayerHistogram(),
                VectorLayerHistogram(),
                VectorLayerScatterplot(),
                VectorLayerScatterplot3D()
            ])

        # to store algs added by 3rd party plugins as scripts
        folder = os.path.join(os.path.dirname(__file__), 'scripts')
        scripts = ScriptUtils.loadFromFolder(folder)
        for script in scripts:
            script.allowEdit = False
        algs.extend(scripts)

        return algs
Example #14
0
    def getAlgs(self):
        # algs = [SumLines(), PointsInPolygon(),
        #         PointsInPolygonWeighted(), PointsInPolygonUnique(),
        #         BasicStatisticsStrings(), BasicStatisticsNumbers(),
        #         NearestNeighbourAnalysis(), MeanCoords(),
        #         LinesIntersection(), UniqueValues(), PointDistance(),
        #         ReprojectLayer(), ExportGeometryInfo(), Centroids(),
        #         Delaunay(), VoronoiPolygons(), SimplifyGeometries(),
        #         DensifyGeometries(), DensifyGeometriesInterval(),
        #         MultipartToSingleparts(), SinglePartsToMultiparts(),
        #         PolygonsToLines(), LinesToPolygons(), ExtractNodes(),
        #         ConvexHull(), FixedDistanceBuffer(),
        #         VariableDistanceBuffer(), Dissolve(), Difference(),
        #         Intersection(), Union(),
        #         RandomSelection(), RandomSelectionWithinSubsets(),
        #         SelectByLocation(), RandomExtract(), DeleteHoles(),
        #         RandomExtractWithinSubsets(), ExtractByLocation(),
        #         SpatialJoin(), RegularPoints(), SymmetricalDifference(),
        #         VectorSplit(), VectorGridLines(), VectorGridPolygons(),
        #         DeleteDuplicateGeometries(), TextToFloat(),
        #         ExtractByAttribute(), SelectByAttribute(),
        #         GridLine(), Gridify(), HubDistancePoints(),
        #         HubDistanceLines(), HubLines(),
        #         GeometryConvert(), FieldsCalculator(),
        #         SaveSelectedFeatures(), JoinAttributes(),
        #         Explode(), FieldsPyculator(),
        #         EquivalentNumField(), PointsLayerFromTable(),
        #         StatisticsByCategories(), ConcaveHull(),
        #         RasterLayerStatistics(), PointsDisplacement(),
        #         ZonalStatistics(), PointsFromPolygons(),
        #         PointsFromLines(), RandomPointsExtent(),
        #         RandomPointsLayer(), RandomPointsPolygonsFixed(),
        #         RandomPointsPolygonsVariable(),
        #         RandomPointsAlongLines(), PointsToPaths(),
        #         SpatialiteExecuteSQL(), ImportIntoSpatialite(),
        #         PostGISExecuteSQL(), ImportIntoPostGIS(),
        #         SetVectorStyle(), SetRasterStyle(),
        #         SelectByExpression(), HypsometricCurves(),
        #         SplitWithLines(), SplitLinesWithLines(), CreateConstantRaster(),
        #         FieldsMapper(), SelectByAttributeSum(), Datasources2Vrt(),
        #         OrientedMinimumBoundingBox(), Smooth(),
        #         ReverseLineDirection(), SpatialIndex(), DefineProjection(),
        #         RectanglesOvalsDiamondsVariable(),
        #         RectanglesOvalsDiamondsFixed(), MergeLines(),
        #         PointOnSurface(),
        #         OffsetLine(), PolygonCentroids(), Translate(),
        #         SingleSidedBuffer(), PointsAlongGeometry(),
        #          Slope(), Ruggedness(), Hillshade(),
        #         Relief(), ZonalStatisticsQgis(),
        #         IdwInterpolation(), TinInterpolation(),
        #         RemoveNullGeometry(),
        #         ExtendLines(), ExtractSpecificNodes(),
        #         GeometryByExpression(), SnapGeometriesToLayer(),
        #         PoleOfInaccessibility(), CreateAttributeIndex(),
        #         DropGeometry(),
        #         RasterCalculator(), Heatmap(), Orthogonalize(),
        #         ShortestPathPointToPoint(), ShortestPathPointToLayer(),
        #         ShortestPathLayerToPoint(), ServiceAreaFromPoint(),
        #         ServiceAreaFromLayer(), TruncateTable(), Polygonize(),
        #         FixGeometry(), ExecuteSQL(), FindProjection(),
        #         TopoColor(), EliminateSelection()
        #         ]
        algs = [AddTableField(),
                Aspect(),
                AutoincrementalField(),
                BasicStatisticsForField(),
                Boundary(),
                BoundingBox(),
                CheckValidity(),
                Clip(),
                DeleteColumn(),
                ExtentFromLayer(),
                ExtractByExpression(),
                GridPolygon(),
                Merge()
                ]

        if hasPlotly:
            #     from .VectorLayerHistogram import VectorLayerHistogram
            #     from .RasterLayerHistogram import RasterLayerHistogram
            #     from .VectorLayerScatterplot import VectorLayerScatterplot
            #     from .MeanAndStdDevPlot import MeanAndStdDevPlot
            from .BarPlot import BarPlot
        #     from .PolarPlot import PolarPlot
        #     from .BoxPlot import BoxPlot
        #     from .VectorLayerScatterplot3D import VectorLayerScatterplot3D
        #
            algs.extend([BarPlot()])
            #[VectorLayerHistogram(), RasterLayerHistogram(),
        #                  VectorLayerScatterplot(), MeanAndStdDevPlot(),
        #                  BarPlot(), PolarPlot(), BoxPlot(),
        #                  VectorLayerScatterplot3D()])

        # to store algs added by 3rd party plugins as scripts
        folder = os.path.join(os.path.dirname(__file__), 'scripts')
        scripts = ScriptUtils.loadFromFolder(folder)
        for script in scripts:
            script.allowEdit = False
        #algs.extend(scripts)

        return algs
 def addAlgorithmsFromFolder(self, folder):
     self.algs.extend(ScriptUtils.loadFromFolder(folder))
Example #16
0
    def getAlgs(self):
        algs = [AddTableField(),
                Aggregate(),
                Aspect(),
                BasicStatisticsForField(),
                CheckValidity(),
                ConcaveHull(),
                CreateAttributeIndex(),
                CreateConstantRaster(),
                Datasources2Vrt(),
                DefineProjection(),
                Delaunay(),
                DeleteColumn(),
                DeleteDuplicateGeometries(),
                DeleteHoles(),
                DensifyGeometries(),
                DensifyGeometriesInterval(),
                Difference(),
                EliminateSelection(),
                EquivalentNumField(),
                ExecuteSQL(),
                Explode(),
                ExportGeometryInfo(),
                ExtendLines(),
                ExtentFromLayer(),
                ExtractSpecificNodes(),
                FieldsCalculator(),
                FieldsMapper(),
                FieldsPyculator(),
                FindProjection(),
                FixedDistanceBuffer(),
                GeometryByExpression(),
                GeometryConvert(),
                GridLine(),
                GridPolygon(),
                Heatmap(),
                Hillshade(),
                HubDistanceLines(),
                HubDistancePoints(),
                HypsometricCurves(),
                IdwInterpolation(),
                ImportIntoPostGIS(),
                ImportIntoSpatialite(),
                Intersection(),
                LinesToPolygons(),
                Merge(),
                MinimumBoundingGeometry(),
                NearestNeighbourAnalysis(),
                OffsetLine(),
                Orthogonalize(),
                PointDistance(),
                PointOnSurface(),
                PointsAlongGeometry(),
                PointsDisplacement(),
                PointsFromLines(),
                PointsFromPolygons(),
                PointsInPolygon(),
                PointsLayerFromTable(),
                PointsToPaths(),
                PoleOfInaccessibility(),
                Polygonize(),
                PolygonsToLines(),
                PostGISExecuteSQL(),
                RandomExtract(),
                RandomExtractWithinSubsets(),
                RandomPointsAlongLines(),
                RandomPointsExtent(),
                RandomPointsLayer(),
                RandomPointsPolygons(),
                RandomSelection(),
                RandomSelectionWithinSubsets(),
                RasterCalculator(),
                RasterizeAlgorithm(),
                RasterLayerStatistics(),
                RectanglesOvalsDiamondsFixed(),
                RectanglesOvalsDiamondsVariable(),
                RegularPoints(),
                Relief(),
                ReverseLineDirection(),
                Ruggedness(),
                SelectByAttribute(),
                SelectByExpression(),
                ServiceAreaFromLayer(),
                ServiceAreaFromPoint(),
                SetMValue(),
                SetRasterStyle(),
                SetVectorStyle(),
                SetZValue(),
                ShortestPathLayerToPoint(),
                ShortestPathPointToLayer(),
                ShortestPathPointToPoint(),
                SingleSidedBuffer(),
                Slope(),
                SnapGeometriesToLayer(),
                SpatialiteExecuteSQL(),
                SpatialIndex(),
                SpatialJoin(),
                SpatialJoinSummary(),
                StatisticsByCategories(),
                SumLines(),
                SymmetricalDifference(),
                TextToFloat(),
                TinInterpolation(),
                TopoColor(),
                Translate(),
                TruncateTable(),
                Union(),
                UniqueValues(),
                VariableDistanceBuffer(),
                VectorSplit(),
                VoronoiPolygons(),
                ZonalStatistics()
                ]

        if hasPlotly:
            from .BarPlot import BarPlot
            from .BoxPlot import BoxPlot
            from .MeanAndStdDevPlot import MeanAndStdDevPlot
            from .PolarPlot import PolarPlot
            from .RasterLayerHistogram import RasterLayerHistogram
            from .VectorLayerHistogram import VectorLayerHistogram
            from .VectorLayerScatterplot import VectorLayerScatterplot
            from .VectorLayerScatterplot3D import VectorLayerScatterplot3D

            algs.extend([BarPlot(),
                         BoxPlot(),
                         MeanAndStdDevPlot(),
                         PolarPlot(),
                         RasterLayerHistogram(),
                         VectorLayerHistogram(),
                         VectorLayerScatterplot(),
                         VectorLayerScatterplot3D()])

        # to store algs added by 3rd party plugins as scripts
        folder = os.path.join(os.path.dirname(__file__), 'scripts')
        scripts = ScriptUtils.loadFromFolder(folder)
        for script in scripts:
            script.allowEdit = False
        algs.extend(scripts)

        return algs
Example #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(), DeleteHoles(),
                        RandomExtractWithinSubsets(), ExtractByLocation(),
                        SpatialJoin(), RegularPoints(), SymmetricalDifference(),
                        VectorSplit(), VectorGrid(), DeleteColumn(),
                        DeleteDuplicateGeometries(), TextToFloat(),
                        ExtractByAttribute(), SelectByAttribute(), Grid(),
                        Gridify(), HubDistance(), HubLines(), Merge(),
                        GeometryConvert(), 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(), HypsometricCurves(),
                        SplitLinesWithLines(), CreateConstantRaster(),
                        FieldsMapper(), SelectByAttributeSum(), Datasources2Vrt(),
                        CheckValidity(), OrientedMinimumBoundingBox(), Smooth(),
                        ReverseLineDirection()
                        ]

        if hasMatplotlib:
            from VectorLayerHistogram import VectorLayerHistogram
            from RasterLayerHistogram import RasterLayerHistogram
            from VectorLayerScatterplot import VectorLayerScatterplot
            from MeanAndStdDevPlot import MeanAndStdDevPlot
            from BarPlot import BarPlot
            from PolarPlot import PolarPlot

            self.alglist.extend([
                VectorLayerHistogram(), RasterLayerHistogram(),
                VectorLayerScatterplot(), 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