Line data Source code
1 : /****************************************************************************** 2 : * 3 : * Project: GDAL 4 : * Purpose: "gdal vector reproject" 5 : * Author: Even Rouault <even dot rouault at spatialys.com> 6 : * 7 : ****************************************************************************** 8 : * Copyright (c) 2024, Even Rouault <even dot rouault at spatialys.com> 9 : * 10 : * SPDX-License-Identifier: MIT 11 : ****************************************************************************/ 12 : 13 : #ifndef GDALALG_VECTOR_REPROJECT_INCLUDED 14 : #define GDALALG_VECTOR_REPROJECT_INCLUDED 15 : 16 : #include "gdalvectorpipelinestepalgorithm.h" 17 : 18 : //! @cond Doxygen_Suppress 19 : 20 : /************************************************************************/ 21 : /* GDALVectorReprojectAlgorithm */ 22 : /************************************************************************/ 23 : 24 : class GDALVectorReprojectAlgorithm /* non final */ 25 : : public GDALVectorPipelineStepAlgorithm 26 : { 27 : public: 28 : static constexpr const char *NAME = "reproject"; 29 : static constexpr const char *DESCRIPTION = "Reproject a vector dataset."; 30 : static constexpr const char *HELP_URL = 31 : "/programs/gdal_vector_reproject.html"; 32 : 33 : explicit GDALVectorReprojectAlgorithm(bool standaloneStep = false); 34 : 35 : private: 36 : bool RunStep(GDALPipelineStepRunContext &ctxt) override; 37 : 38 : std::string m_activeLayer{}; 39 : std::string m_srcCrs{}; 40 : std::string m_dstCrs{}; 41 : GDALArgDatasetValue m_likeDataset{}; 42 : std::string m_likeLayer{}; 43 : }; 44 : 45 : /************************************************************************/ 46 : /* GDALVectorReprojectAlgorithmStandalone */ 47 : /************************************************************************/ 48 : 49 122 : class GDALVectorReprojectAlgorithmStandalone final 50 : : public GDALVectorReprojectAlgorithm 51 : { 52 : public: 53 61 : GDALVectorReprojectAlgorithmStandalone() 54 61 : : GDALVectorReprojectAlgorithm(/* standaloneStep = */ true) 55 : { 56 61 : } 57 : 58 : ~GDALVectorReprojectAlgorithmStandalone() override; 59 : }; 60 : 61 : //! @endcond 62 : 63 : #endif /* GDALALG_VECTOR_REPROJECT_INCLUDED */