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 : #include <limits> 19 : 20 : //! @cond Doxygen_Suppress 21 : 22 : /************************************************************************/ 23 : /* GDALRasterReprojectAlgorithm */ 24 : /************************************************************************/ 25 : 26 : class GDALRasterReprojectAlgorithm /* non final */ 27 : : public GDALRasterPipelineStepAlgorithm 28 : { 29 : public: 30 : static constexpr const char *NAME = "reproject"; 31 : static constexpr const char *DESCRIPTION = "Reproject a raster dataset."; 32 : static constexpr const char *HELP_URL = 33 : "/programs/gdal_raster_reproject.html"; 34 : 35 378 : static std::vector<std::string> GetAliases() 36 : { 37 378 : return {}; 38 : } 39 : 40 : explicit GDALRasterReprojectAlgorithm(bool standaloneStep = false); 41 : 42 : private: 43 : bool RunStep(GDALProgressFunc pfnProgress, void *pProgressData) override; 44 : 45 : std::string m_srsCrs{}; 46 : std::string m_dstCrs{}; 47 : std::string m_resampling{}; 48 : std::vector<double> m_resolution{}; 49 : std::vector<double> m_bbox{}; 50 : std::string m_bboxCrs{}; 51 : std::vector<int> m_size{}; 52 : bool m_targetAlignedPixels = false; 53 : std::vector<std::string> m_srcNoData{}; 54 : std::vector<std::string> m_dstNoData{}; 55 : bool m_addAlpha = false; 56 : std::vector<std::string> m_warpOptions{}; 57 : std::vector<std::string> m_transformOptions{}; 58 : double m_errorThreshold = std::numeric_limits<double>::quiet_NaN(); 59 : }; 60 : 61 : /************************************************************************/ 62 : /* GDALRasterReprojectAlgorithmStandalone */ 63 : /************************************************************************/ 64 : 65 : class GDALRasterReprojectAlgorithmStandalone final 66 : : public GDALRasterReprojectAlgorithm 67 : { 68 : public: 69 21 : GDALRasterReprojectAlgorithmStandalone() 70 21 : : GDALRasterReprojectAlgorithm(/* standaloneStep = */ true) 71 : { 72 21 : } 73 : }; 74 : 75 : //! @endcond 76 : 77 : #endif /* GDALALG_RASTER_REPROJECT_INCLUDED */