Line data Source code
1 : /****************************************************************************** 2 : * 3 : * Project: GDAL 4 : * Purpose: "gdal vector concave-hull" 5 : * Author: Daniel Baston 6 : * 7 : ****************************************************************************** 8 : * Copyright (c) 2026, ISciences LLC 9 : * 10 : * SPDX-License-Identifier: MIT 11 : ****************************************************************************/ 12 : 13 : #ifndef GDALALG_VECTOR_CONCAVE_HULL_INCLUDED 14 : #define GDALALG_VECTOR_CONCAVE_HULL_INCLUDED 15 : 16 : #include "gdalalg_vector_geom.h" 17 : 18 : //! @cond Doxygen_Suppress 19 : 20 : class GDALVectorConcaveHullAlgorithm /* non final */ 21 : : public GDALVectorGeomAbstractAlgorithm 22 : { 23 : public: 24 : static constexpr const char *NAME = "concave-hull"; 25 : static constexpr const char *DESCRIPTION = 26 : "Compute the concave hull of geometries of a vector dataset."; 27 : static constexpr const char *HELP_URL = 28 : "/programs/gdal_vector_concave_hull.html"; 29 : 30 : struct Options : public GDALVectorGeomAbstractAlgorithm::OptionsBase 31 : { 32 : double m_ratio = 0.0; 33 : bool m_allowHoles = false; 34 : bool m_tight = false; 35 : }; 36 : 37 : std::unique_ptr<OGRLayerWithTranslateFeature> 38 : CreateAlgLayer(OGRLayer &srcLayer) override; 39 : 40 : explicit GDALVectorConcaveHullAlgorithm(bool standaloneStep = false); 41 : 42 : private: 43 : bool RunStep(GDALPipelineStepRunContext &ctxt) override; 44 : 45 : Options m_opts{}; 46 : }; 47 : 48 112 : class GDALVectorConcaveHullAlgorithmStandalone final 49 : : public GDALVectorConcaveHullAlgorithm 50 : { 51 : public: 52 56 : GDALVectorConcaveHullAlgorithmStandalone() 53 56 : : GDALVectorConcaveHullAlgorithm(/* standaloneStep = */ true) 54 : { 55 56 : } 56 : 57 : ~GDALVectorConcaveHullAlgorithmStandalone() override; 58 : }; 59 : 60 : //! @endcond 61 : 62 : #endif /* GDALALG_VECTOR_CONCAVE_HULL_INCLUDED */