Line data Source code
1 : /****************************************************************************** 2 : * 3 : * Project: GDAL 4 : * Purpose: "edit" step of "vector pipeline" 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_EDIT_INCLUDED 14 : #define GDALALG_RASTER_EDIT_INCLUDED 15 : 16 : #include "gdalalg_vector_pipeline.h" 17 : 18 : //! @cond Doxygen_Suppress 19 : 20 : /************************************************************************/ 21 : /* GDALVectorEditAlgorithm */ 22 : /************************************************************************/ 23 : 24 : class GDALVectorEditAlgorithm /* non final */ 25 : : public GDALVectorPipelineStepAlgorithm 26 : { 27 : public: 28 : static constexpr const char *NAME = "edit"; 29 : static constexpr const char *DESCRIPTION = 30 : "Edit metadata of a vector dataset."; 31 : static constexpr const char *HELP_URL = "/programs/gdal_vector_edit.html"; 32 : 33 : explicit GDALVectorEditAlgorithm(bool standaloneStep = false); 34 : 35 : private: 36 : bool RunStep(GDALPipelineStepRunContext &ctxt) override; 37 : 38 : std::string m_activeLayer{}; 39 : std::string m_overrideCrs{}; 40 : std::string m_geometryType{}; 41 : std::vector<std::string> m_metadata{}; 42 : std::vector<std::string> m_unsetMetadata{}; 43 : std::vector<std::string> m_layerMetadata{}; 44 : std::vector<std::string> m_unsetLayerMetadata{}; 45 : bool m_unsetFID = false; 46 : }; 47 : 48 : /************************************************************************/ 49 : /* GDALVectorEditAlgorithmStandalone */ 50 : /************************************************************************/ 51 : 52 20 : class GDALVectorEditAlgorithmStandalone final : public GDALVectorEditAlgorithm 53 : { 54 : public: 55 10 : GDALVectorEditAlgorithmStandalone() 56 10 : : GDALVectorEditAlgorithm(/* standaloneStep = */ true) 57 : { 58 10 : } 59 : 60 : ~GDALVectorEditAlgorithmStandalone() override; 61 : }; 62 : 63 : //! @endcond 64 : 65 : #endif /* GDALALG_RASTER_EDIT_INCLUDED */