13#ifndef GDALALG_RASTER_ZONAL_STATS_INCLUDED
14#define GDALALG_RASTER_ZONAL_STATS_INCLUDED
16#include "gdalalg_abstract_pipeline.h"
24class GDALRasterZonalStatsAlgorithm
25 :
public GDALPipelineStepAlgorithm
28 static constexpr const char *NAME =
"zonal-stats";
29 static constexpr const char *DESCRIPTION =
30 "Calculate raster zonal statistics";
31 static constexpr const char *HELP_URL =
32 "/programs/gdal_raster_zonal_stats.html";
34 explicit GDALRasterZonalStatsAlgorithm(
bool bStandalone =
false);
36 int GetInputType()
const override
41 int GetOutputType()
const override
47 bool RunStep(GDALPipelineStepRunContext &ctxt)
override;
48 bool RunImpl(GDALProgressFunc pfnProgress,
void *pProgressData)
override;
52 std::string m_zonesLayer{};
54 std::vector<int> m_bands{};
55 std::vector<std::string> m_stats{};
56 std::vector<std::string> m_includeFields{};
57 bool m_includeZoneGeom{
false};
58 std::string m_strategy{};
59 std::string m_memoryStr{
"5%"};
60 std::string m_pixels{
"default"};
63 static_cast<size_t>(100) * 1024 *
71class GDALRasterZonalStatsAlgorithmStandalone final
72 :
public GDALRasterZonalStatsAlgorithm
75 GDALRasterZonalStatsAlgorithmStandalone()
76 : GDALRasterZonalStatsAlgorithm( true)
80 ~GDALRasterZonalStatsAlgorithmStandalone()
override;
Value for an argument that points to a GDALDataset.
Definition gdalalgorithm_cpp.h:163
#define GDAL_OF_RASTER
Allow raster drivers to be used.
Definition gdal.h:1125
#define GDAL_OF_VECTOR
Allow vector drivers to be used.
Definition gdal.h:1130