Line data Source code
1 : /****************************************************************************** 2 : * 3 : * Project: GDAL 4 : * Purpose: "gdal vector combine" 5 : * Author: Daniel Baston 6 : * 7 : ****************************************************************************** 8 : * Copyright (c) 2025-2026, ISciences LLC 9 : * 10 : * SPDX-License-Identifier: MIT 11 : ****************************************************************************/ 12 : 13 : #ifndef GDALALG_VECTOR_COMBINE_INCLUDED 14 : #define GDALALG_VECTOR_COMBINE_INCLUDED 15 : 16 : #include "gdalvectorpipelinestepalgorithm.h" 17 : 18 : #include "cpl_progress.h" 19 : 20 : #include <string> 21 : 22 : //! @cond Doxygen_Suppress 23 : 24 : /************************************************************************/ 25 : /* GDALVectorCombineAlgorithm */ 26 : /************************************************************************/ 27 : 28 : class GDALVectorCombineAlgorithm : public GDALVectorPipelineStepAlgorithm 29 : { 30 : public: 31 : static constexpr const char *NAME = "combine"; 32 : static constexpr const char *DESCRIPTION = 33 : "Combine features into collections"; 34 : static constexpr const char *HELP_URL = 35 : "/programs/gdal_vector_combine.html"; 36 : 37 : explicit GDALVectorCombineAlgorithm(bool standaloneStep = false); 38 : 39 : static constexpr const char *NO = "no"; 40 : static constexpr const char *SOMETIMES_IDENTICAL = "sometimes-identical"; 41 : static constexpr const char *ALWAYS_IDENTICAL = "always-identical"; 42 : 43 : private: 44 : bool RunStep(GDALPipelineStepRunContext &ctxt) override; 45 : 46 : std::vector<std::string> m_groupBy{}; 47 : bool m_keepNested{false}; 48 : std::string m_addExtraFields{NO}; 49 : }; 50 : 51 : /************************************************************************/ 52 : /* GDALVectorCombineAlgorithmStandalone */ 53 : /************************************************************************/ 54 : 55 134 : class GDALVectorCombineAlgorithmStandalone final 56 : : public GDALVectorCombineAlgorithm 57 : { 58 : public: 59 67 : GDALVectorCombineAlgorithmStandalone() 60 67 : : GDALVectorCombineAlgorithm(/* standaloneStep = */ true) 61 : { 62 67 : } 63 : 64 : ~GDALVectorCombineAlgorithmStandalone() override; 65 : }; 66 : 67 : //! @endcond 68 : 69 : #endif /* GDALALG_VECTOR_COMBINE_INCLUDED */