Line data Source code
1 : /****************************************************************************** 2 : * 3 : * Project: GDAL 4 : * Purpose: "reproject" step of "raster pipeline" 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_RASTER_REPROJECT_INCLUDED 14 : #define GDALALG_RASTER_REPROJECT_INCLUDED 15 : 16 : #include "gdalalg_raster_pipeline.h" 17 : 18 : //! @cond Doxygen_Suppress 19 : 20 : /************************************************************************/ 21 : /* GDALRasterReprojectAlgorithm */ 22 : /************************************************************************/ 23 : 24 : class GDALRasterReprojectAlgorithm /* non final */ 25 : : public GDALRasterPipelineStepAlgorithm 26 : { 27 : public: 28 : static constexpr const char *NAME = "reproject"; 29 : static constexpr const char *DESCRIPTION = "Reproject a raster dataset."; 30 : static constexpr const char *HELP_URL = 31 : "/programs/gdal_raster_reproject.html"; 32 : 33 228 : static std::vector<std::string> GetAliases() 34 : { 35 228 : return {}; 36 : } 37 : 38 : explicit GDALRasterReprojectAlgorithm(bool standaloneStep = false); 39 : 40 : private: 41 : bool RunStep(GDALProgressFunc pfnProgress, void *pProgressData) override; 42 : 43 : std::string m_srsCrs{}; 44 : std::string m_dstCrs{}; 45 : std::string m_resampling{}; 46 : std::vector<double> m_resolution{}; 47 : std::vector<double> m_bbox{}; 48 : bool m_targetAlignedPixels = false; 49 : }; 50 : 51 : /************************************************************************/ 52 : /* GDALRasterReprojectAlgorithmStandalone */ 53 : /************************************************************************/ 54 : 55 : class GDALRasterReprojectAlgorithmStandalone final 56 : : public GDALRasterReprojectAlgorithm 57 : { 58 : public: 59 11 : GDALRasterReprojectAlgorithmStandalone() 60 11 : : GDALRasterReprojectAlgorithm(/* standaloneStep = */ true) 61 : { 62 11 : } 63 : }; 64 : 65 : //! @endcond 66 : 67 : #endif /* GDALALG_RASTER_REPROJECT_INCLUDED */