GDAL

gdalalg_raster_footprint.h
1/******************************************************************************
2 *
3 * Project: GDAL
4 * Purpose: gdal "raster footprint" subcommand
5 * Author: Even Rouault <even dot rouault at spatialys.com>
6 *
7 ******************************************************************************
8 * Copyright (c) 2025, Even Rouault <even dot rouault at spatialys.com>
9 *
10 * SPDX-License-Identifier: MIT
11 ****************************************************************************/
12
13#ifndef GDALALG_RASTER_FOOTPRINT_INCLUDED
14#define GDALALG_RASTER_FOOTPRINT_INCLUDED
15
16#include "gdalalg_abstract_pipeline.h"
17
19
20/************************************************************************/
21/* GDALRasterFootprintAlgorithm */
22/************************************************************************/
23
24 class GDALRasterFootprintAlgorithm /* non final */
25 : public GDALPipelineStepAlgorithm
26{
27 public:
28 static constexpr const char *NAME = "footprint";
29 static constexpr const char *DESCRIPTION =
30 "Compute the footprint of a raster dataset.";
31 static constexpr const char *HELP_URL =
32 "/programs/gdal_raster_footprint.html";
33
34 explicit GDALRasterFootprintAlgorithm(bool standaloneStep = false);
35
36 bool IsNativelyStreamingCompatible() const override
37 {
38 return false;
39 }
40
41 int GetInputType() const override
42 {
43 return GDAL_OF_RASTER;
44 }
45
46 int GetOutputType() const override
47 {
48 return GDAL_OF_VECTOR;
49 }
50
51 private:
52 bool RunStep(GDALPipelineStepRunContext &ctxt) override;
53 bool RunImpl(GDALProgressFunc pfnProgress, void *pProgressData) override;
54
55 std::vector<int> m_bands{};
56 std::string m_combineBands = "union";
57 int m_overview = -1;
58 std::vector<double> m_srcNoData{};
59 std::string m_coordinateSystem{};
60 std::string m_dstCrs{};
61 bool m_splitMultiPolygons = false;
62 bool m_convexHull = false;
63 double m_densifyVal = 0;
64 double m_simplifyVal = 0;
65 double m_minRingArea = 0;
66 std::string m_maxPoints = "100";
67 std::string m_locationField = "location";
68 bool m_noLocation = false;
69 bool m_writeAbsolutePaths = false;
70};
71
72/************************************************************************/
73/* GDALRasterFootprintAlgorithmStandalone */
74/************************************************************************/
75
76 class GDALRasterFootprintAlgorithmStandalone final
77 : public GDALRasterFootprintAlgorithm
78{
79 public:
80 GDALRasterFootprintAlgorithmStandalone()
81 : GDALRasterFootprintAlgorithm(/* standaloneStep = */ true)
82 {
83 }
84
85 ~GDALRasterFootprintAlgorithmStandalone() override;
86};
87
89
90#endif
GDAL_OF_RASTER
#define GDAL_OF_RASTER
Allow raster drivers to be used.
Definition gdal.h:1086
GDAL_OF_VECTOR
#define GDAL_OF_VECTOR
Allow vector drivers to be used.
Definition gdal.h:1091