Line data Source code
1 : /****************************************************************************** 2 : * 3 : * Project: GDAL 4 : * Purpose: gdal "vector grid invdist" subcommand 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_VECTOR_GRID_INVDIST_INCLUDED 14 : #define GDALALG_VECTOR_GRID_INVDIST_INCLUDED 15 : 16 : #include "gdalalg_vector_grid.h" 17 : 18 : #include <limits> 19 : 20 : //! @cond Doxygen_Suppress 21 : 22 : /************************************************************************/ 23 : /* GDALVectorGridInvdistAlgorithm */ 24 : /************************************************************************/ 25 : 26 : class GDALVectorGridInvdistAlgorithm /* non final */ 27 : : public GDALVectorGridAbstractAlgorithm 28 : { 29 : public: 30 : static constexpr const char *NAME = "invdist"; 31 : static constexpr const char *DESCRIPTION = 32 : "Create a regular grid from scattered points using weighted inverse " 33 : "distance interpolation."; 34 : static constexpr const char *HELP_URL = "/programs/gdal_vector_grid.html"; 35 : 36 : explicit GDALVectorGridInvdistAlgorithm(bool standaloneStep = false); 37 : 38 : std::string GetGridAlgorithm() const override; 39 : 40 : private: 41 : double m_power = 2.0; 42 : double m_smoothing = 0.0; 43 : }; 44 : 45 : /************************************************************************/ 46 : /* GDALVectorGridInvdistAlgorithmStandalone */ 47 : /************************************************************************/ 48 : 49 88 : class GDALVectorGridInvdistAlgorithmStandalone final 50 : : public GDALVectorGridInvdistAlgorithm 51 : { 52 : public: 53 44 : GDALVectorGridInvdistAlgorithmStandalone() 54 44 : : GDALVectorGridInvdistAlgorithm(/* standaloneStep = */ true) 55 : { 56 44 : } 57 : 58 : ~GDALVectorGridInvdistAlgorithmStandalone() override; 59 : }; 60 : 61 : //! @endcond 62 : 63 : #endif