1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
/******************************************************************************
*
* Project: GDAL
* Purpose: "gdal vector buffer"
* Author: Even Rouault <even dot rouault at spatialys.com>
*
******************************************************************************
* Copyright (c) 2025, Even Rouault <even dot rouault at spatialys.com>
*
* SPDX-License-Identifier: MIT
****************************************************************************/
#ifndef GDALALG_VECTOR_BUFFER_INCLUDED
#define GDALALG_VECTOR_BUFFER_INCLUDED
#include "gdalalg_vector_geom.h"
//! @cond Doxygen_Suppress
/************************************************************************/
/* GDALVectorBufferAlgorithm */
/************************************************************************/
class GDALVectorBufferAlgorithm /* non final */
: public GDALVectorGeomAbstractAlgorithm
{
public:
static constexpr const char *NAME = "buffer";
static constexpr const char *DESCRIPTION =
"Compute a buffer around geometries of a vector dataset.";
static constexpr const char *HELP_URL = "/programs/gdal_vector_buffer.html";
struct Options : public GDALVectorGeomAbstractAlgorithm::OptionsBase
{
double m_distance = 0;
std::string m_endCapStyle = "round";
std::string m_joinStyle = "round";
double m_mitreLimit = 5;
int m_quadrantSegments = 8;
std::string m_side = "both";
};
std::unique_ptr<OGRLayerWithTranslateFeature>
CreateAlgLayer(OGRLayer &srcLayer) override;
explicit GDALVectorBufferAlgorithm(bool standaloneStep = false);
private:
bool RunStep(GDALPipelineStepRunContext &ctxt) override;
Options m_opts{};
};
/************************************************************************/
/* GDALVectorBufferAlgorithmStandalone */
/************************************************************************/
class GDALVectorBufferAlgorithmStandalone final
: public GDALVectorBufferAlgorithm
{
public:
GDALVectorBufferAlgorithmStandalone()
: GDALVectorBufferAlgorithm(/* standaloneStep = */ true)
{
}
~GDALVectorBufferAlgorithmStandalone() override;
};
//! @endcond
#endif /* GDALALG_VECTOR_BUFFER_INCLUDED */
|