Skip to content

Commit

Permalink
port Basic statistics for fields algorithm to C++
Browse files Browse the repository at this point in the history
Also add new optional output a table containing calculated statistics
similar to the Statistics by categories algorithm (fix qgis#46241)
  • Loading branch information
alexbruy committed Jul 2, 2024
1 parent 47f7b3a commit f441f08
Show file tree
Hide file tree
Showing 20 changed files with 1,147 additions and 299 deletions.
7 changes: 0 additions & 7 deletions python/plugins/processing/algs/help/qgis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ qgis:advancedpythonfieldcalculator: >
qgis:barplot: >
This algorithm creates a bar plot from a category and a layer field.

qgis:basicstatisticsforfields: >
This algorithm generates basic statistics from the analysis of a values in a field in the attribute table of a vector layer. Numeric, date, time and string fields are supported.

The statistics returned will depend on the field type.

Statistics are generated as an HTML file.

qgis:boxplot: >
This algorithm creates a box plot from a category and a layer field.

Expand Down
284 changes: 0 additions & 284 deletions python/plugins/processing/algs/qgis/BasicStatistics.py

This file was deleted.

2 changes: 0 additions & 2 deletions python/plugins/processing/algs/qgis/QgisAlgorithmProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from qgis.PyQt.QtCore import QCoreApplication

from .BarPlot import BarPlot
from .BasicStatistics import BasicStatisticsForField
from .BoxPlot import BoxPlot
from .CheckValidity import CheckValidity
from .Climb import Climb
Expand Down Expand Up @@ -89,7 +88,6 @@ def __init__(self):

def getAlgs(self):
algs = [BarPlot(),
BasicStatisticsForField(),
BoxPlot(),
CheckValidity(),
Climb(),
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/menus.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def initMenusAndToolbars():
'native:sumlinelengths': analysisToolsMenu,
'native:countpointsinpolygon': analysisToolsMenu,
'qgis:listuniquevalues': analysisToolsMenu,
'qgis:basicstatisticsforfields': analysisToolsMenu,
'native:basicstatisticsforfields': analysisToolsMenu,
'native:nearestneighbouranalysis': analysisToolsMenu,
'native:meancoordinates': analysisToolsMenu,
'native:lineintersections': analysisToolsMenu})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
gml:id="aFeatureCollection"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ statistics_date.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml/3.2">
<gml:boundedBy><gml:Null /></gml:boundedBy>

<ogr:featureMember>
<ogr:statistics_date gml:id="statistics_date.0">
<ogr:count>4</ogr:count>
<ogr:unique>4</ogr:unique>
<ogr:empty>1</ogr:empty>
<ogr:filled>3</ogr:filled>
<ogr:min>2014-11-30</ogr:min>
<ogr:max>2016-11-30</ogr:max>
<ogr:range>63158400</ogr:range>
</ogr:statistics_date>
</ogr:featureMember>
</ogr:FeatureCollection>
Loading

0 comments on commit f441f08

Please sign in to comment.