/src/gdal/apps/gdalalg_raster_footprint.h
Line | Count | Source |
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 | | |
18 | | //! @cond Doxygen_Suppress |
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 | 0 | { |
38 | 0 | return false; |
39 | 0 | } |
40 | | |
41 | | int GetInputType() const override |
42 | 0 | { |
43 | 0 | return GDAL_OF_RASTER; |
44 | 0 | } |
45 | | |
46 | | int GetOutputType() const override |
47 | 0 | { |
48 | 0 | return GDAL_OF_VECTOR; |
49 | 0 | } |
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 | 0 | : GDALRasterFootprintAlgorithm(/* standaloneStep = */ true) |
82 | 0 | { |
83 | 0 | } |
84 | | |
85 | | ~GDALRasterFootprintAlgorithmStandalone() override; |
86 | | }; |
87 | | |
88 | | //! @endcond |
89 | | |
90 | | #endif |