CoverageSimplifier.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2023 Paul Ramsey <pramsey@cleverelephant.ca>
* Copyright (c) 2023 Martin Davis.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#pragma once
#include <vector>
#include <memory>
#include <geos/export.h>
namespace geos {
namespace geom {
class Geometry;
class GeometryFactory;
class MultiLineString;
}
namespace coverage {
class CoverageEdge;
}
}
namespace geos {
namespace coverage { // geos::coverage
class GEOS_DLL CoverageSimplifier {
using CoverageEdge = geos::coverage::CoverageEdge;
using Geometry = geos::geom::Geometry;
using GeometryFactory = geos::geom::GeometryFactory;
using MultiLineString = geos::geom::MultiLineString;
public:
CoverageSimplifier(const std::vector<const Geometry*>& coverage);
static std::vector<std::unique_ptr<Geometry>> simplify(
std::vector<const Geometry*>& coverage,
double tolerance);
static std::vector<std::unique_ptr<Geometry>> simplify(
const std::vector<std::unique_ptr<Geometry>>& coverage,
double tolerance);
static std::vector<std::unique_ptr<Geometry>> simplifyInner(
std::vector<const Geometry*>& coverage,
double tolerance);
static std::vector<std::unique_ptr<Geometry>> simplifyInner(
const std::vector<std::unique_ptr<Geometry>>& coverage,
double tolerance);
std::vector<std::unique_ptr<Geometry>> simplify(
double tolerance);
std::vector<std::unique_ptr<Geometry>> simplifyInner(
double tolerance);
private:
// Members
const std::vector<const Geometry*>& m_input;
const GeometryFactory* m_geomFactory;
// Methods
void simplifyEdges(
std::vector<CoverageEdge*> edges,
const MultiLineString* constraints,
double tolerance);
void setCoordinates(
std::vector<CoverageEdge*>& edges,
const MultiLineString* lines);
std::vector<bool> getFreeRings(
const std::vector<CoverageEdge*>& edges) const;
}; // CoverageSimplifier
} // geos::coverage
} // geos
geos::coverage::CoverageEdge
Definition CoverageEdge.h:46
geos::coverage::CoverageSimplifier::simplifyInner
static std::vector< std::unique_ptr< Geometry > > simplifyInner(std::vector< const Geometry * > &coverage, double tolerance)
geos::coverage::CoverageSimplifier::simplify
static std::vector< std::unique_ptr< Geometry > > simplify(std::vector< const Geometry * > &coverage, double tolerance)
geos::coverage::CoverageSimplifier::CoverageSimplifier
CoverageSimplifier(const std::vector< const Geometry * > &coverage)
geos::coverage::CoverageSimplifier::simplify
std::vector< std::unique_ptr< Geometry > > simplify(double tolerance)
geos::coverage::CoverageSimplifier::simplifyInner
std::vector< std::unique_ptr< Geometry > > simplifyInner(double tolerance)
geos::geom::GeometryFactory
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:70
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:196
geos::geom::MultiLineString
Models a collection of LineStrings.
Definition MultiLineString.h:49
geos::geom
Definition Angle.h:26
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38