You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.1 KiB
69 lines
2.1 KiB
/******************************************************************************
|
|
*
|
|
* Project: GDAL
|
|
* Purpose: "gdal vector simplify"
|
|
* 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_SIMPLIFY_INCLUDED
|
|
#define GDALALG_VECTOR_SIMPLIFY_INCLUDED
|
|
|
|
#include "gdalalg_vector_geom.h"
|
|
|
|
//! @cond Doxygen_Suppress
|
|
|
|
/************************************************************************/
|
|
/* GDALVectorSimplifyAlgorithm */
|
|
/************************************************************************/
|
|
|
|
class GDALVectorSimplifyAlgorithm /* non final */
|
|
: public GDALVectorGeomAbstractAlgorithm
|
|
{
|
|
public:
|
|
static constexpr const char *NAME = "simplify";
|
|
static constexpr const char *DESCRIPTION =
|
|
"Simplify geometries of a vector dataset.";
|
|
static constexpr const char *HELP_URL =
|
|
"/programs/gdal_vector_simplify.html";
|
|
|
|
struct Options : public GDALVectorGeomAbstractAlgorithm::OptionsBase
|
|
{
|
|
double m_tolerance = 0;
|
|
};
|
|
|
|
std::unique_ptr<OGRLayerWithTranslateFeature>
|
|
CreateAlgLayer(OGRLayer &srcLayer) override;
|
|
|
|
explicit GDALVectorSimplifyAlgorithm(bool standaloneStep = false);
|
|
|
|
private:
|
|
bool RunStep(GDALVectorPipelineStepRunContext &ctxt) override;
|
|
|
|
Options m_opts{};
|
|
};
|
|
|
|
/************************************************************************/
|
|
/* GDALVectorSimplifyAlgorithmStandalone */
|
|
/************************************************************************/
|
|
|
|
class GDALVectorSimplifyAlgorithmStandalone final
|
|
: public GDALVectorSimplifyAlgorithm
|
|
{
|
|
public:
|
|
GDALVectorSimplifyAlgorithmStandalone()
|
|
: GDALVectorSimplifyAlgorithm(/* standaloneStep = */ true)
|
|
{
|
|
}
|
|
|
|
~GDALVectorSimplifyAlgorithmStandalone() override;
|
|
};
|
|
|
|
//! @endcond
|
|
|
|
#endif /* GDALALG_VECTOR_SIMPLIFY_INCLUDED */
|