Skip to content

Commit

Permalink
Add AllNumeric value, QGIS 4.0 todo note
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 11, 2024
1 parent c03f550 commit 656eb4c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
9 changes: 7 additions & 2 deletions python/PyQt6/core/auto_additions/qgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10431,7 +10431,8 @@
Qgis.ZonalStatistic.Variance.__doc__ = "Variance of pixel values"
Qgis.ZonalStatistic.MinimumPoint.__doc__ = "Pixel centroid for minimum pixel value \n.. versionadded:: 3.42"
Qgis.ZonalStatistic.MaximumPoint.__doc__ = "Pixel centroid for maximum pixel value \n.. versionadded:: 3.42"
Qgis.ZonalStatistic.All.__doc__ = "All statistics, excluding MinimumPoint and MaximumPoint"
Qgis.ZonalStatistic.All.__doc__ = "All statistics. For QGIS 3.x this includes ONLY numeric statistics, but for 4.0 this will be extended to included non-numeric statistics. Consider using AllNumeric instead."
Qgis.ZonalStatistic.AllNumeric.__doc__ = "All numeric statistics \n.. versionadded:: 3.42"
Qgis.ZonalStatistic.Default.__doc__ = "Default statistics"
Qgis.ZonalStatistic.__doc__ = """Statistics to be calculated during a zonal statistics operation.

Expand All @@ -10457,7 +10458,11 @@

.. versionadded:: 3.42

* ``All``: All statistics, excluding MinimumPoint and MaximumPoint
* ``All``: All statistics. For QGIS 3.x this includes ONLY numeric statistics, but for 4.0 this will be extended to included non-numeric statistics. Consider using AllNumeric instead.
* ``AllNumeric``: All numeric statistics

.. versionadded:: 3.42

* ``Default``: Default statistics

"""
Expand Down
2 changes: 2 additions & 0 deletions python/PyQt6/core/auto_generated/qgis.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -3017,6 +3017,7 @@ The development version
Other,
};


enum class ZonalStatistic /BaseType=IntFlag/
{
Count,
Expand All @@ -3034,6 +3035,7 @@ The development version
MinimumPoint,
MaximumPoint,
All,
AllNumeric,
Default,
};

Expand Down
9 changes: 7 additions & 2 deletions python/core/auto_additions/qgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10347,7 +10347,8 @@
Qgis.ZonalStatistic.Variance.__doc__ = "Variance of pixel values"
Qgis.ZonalStatistic.MinimumPoint.__doc__ = "Pixel centroid for minimum pixel value \n.. versionadded:: 3.42"
Qgis.ZonalStatistic.MaximumPoint.__doc__ = "Pixel centroid for maximum pixel value \n.. versionadded:: 3.42"
Qgis.ZonalStatistic.All.__doc__ = "All statistics, excluding MinimumPoint and MaximumPoint"
Qgis.ZonalStatistic.All.__doc__ = "All statistics. For QGIS 3.x this includes ONLY numeric statistics, but for 4.0 this will be extended to included non-numeric statistics. Consider using AllNumeric instead."
Qgis.ZonalStatistic.AllNumeric.__doc__ = "All numeric statistics \n.. versionadded:: 3.42"
Qgis.ZonalStatistic.Default.__doc__ = "Default statistics"
Qgis.ZonalStatistic.__doc__ = """Statistics to be calculated during a zonal statistics operation.

Expand All @@ -10373,7 +10374,11 @@

.. versionadded:: 3.42

* ``All``: All statistics, excluding MinimumPoint and MaximumPoint
* ``All``: All statistics. For QGIS 3.x this includes ONLY numeric statistics, but for 4.0 this will be extended to included non-numeric statistics. Consider using AllNumeric instead.
* ``AllNumeric``: All numeric statistics

.. versionadded:: 3.42

* ``Default``: Default statistics

"""
Expand Down
2 changes: 2 additions & 0 deletions python/core/auto_generated/qgis.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -3017,6 +3017,7 @@ The development version
Other,
};


enum class ZonalStatistic
{
Count,
Expand All @@ -3034,6 +3035,7 @@ The development version
MinimumPoint,
MaximumPoint,
All,
AllNumeric,
Default,
};

Expand Down
6 changes: 5 additions & 1 deletion src/core/qgis.h
Original file line number Diff line number Diff line change
Expand Up @@ -5341,6 +5341,9 @@ class CORE_EXPORT Qgis
};
Q_ENUM( VsiHandlerType )

// TODO QGIS 4: make All include all values (we can't do this before 4.0, as we need to keep
// compatibility with code which expects all these statistics to give numeric results)

/**
* Statistics to be calculated during a zonal statistics operation.
*
Expand All @@ -5362,7 +5365,8 @@ class CORE_EXPORT Qgis
Variance = 1 << 11, //!< Variance of pixel values
MinimumPoint = 1 << 12, //!< Pixel centroid for minimum pixel value \since QGIS 3.42
MaximumPoint = 1 << 13, //!< Pixel centroid for maximum pixel value \since QGIS 3.42
All = Count | Sum | Mean | Median | StDev | Max | Min | Range | Minority | Majority | Variety | Variance, //!< All statistics, excluding MinimumPoint and MaximumPoint
All = Count | Sum | Mean | Median | StDev | Max | Min | Range | Minority | Majority | Variety | Variance, //!< All statistics. For QGIS 3.x this includes ONLY numeric statistics, but for 4.0 this will be extended to included non-numeric statistics. Consider using AllNumeric instead.
AllNumeric = Count | Sum | Mean | Median | StDev | Max | Min | Range | Minority | Majority | Variety | Variance, //!< All numeric statistics \since QGIS 3.42
Default = Count | Sum | Mean, //!< Default statistics
};
Q_ENUM( ZonalStatistic )
Expand Down

0 comments on commit 656eb4c

Please sign in to comment.