GEOS 3.11.1
PointwisePrecisionReducerTransformer.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2021 Paul Ramsey <pramsey@cleverelephant.ca>
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************/
14
15#pragma once
16
17#include <geos/export.h>
18#include <memory>
19
20#include <geos/geom/util/GeometryTransformer.h>
21
22// Forward declarations
23namespace geos {
24namespace geom {
25class PrecisionModel;
26class Geometry;
27class CoordinateSequence;
28}
29}
30
31namespace geos {
32namespace precision { // geos.precision
33
34
41
42private:
43
44 const geom::PrecisionModel& targetPM;
45
46 std::vector<geom::Coordinate> reducePointwise(
47 const geom::CoordinateSequence* coordinates);
48
49public:
50
52 const geom::PrecisionModel& p_targetPM)
53 : targetPM(p_targetPM)
54 {};
55
56 static std::unique_ptr<geom::Geometry> reduce(
57 const geom::Geometry& geom,
58 const geom::PrecisionModel& targetPM);
59
60
61
62protected:
63
64 std::unique_ptr<geom::CoordinateSequence> transformCoordinates(
65 const geom::CoordinateSequence* coords,
66 const geom::Geometry* parent);
67
68
69};
70
71} // namespace geos.precision
72} // namespace geos
73
74
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:44
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
Specifies the precision model of the Coordinate in a Geometry.
Definition: PrecisionModel.h:90
A framework for processes which transform an input Geometry into an output Geometry,...
Definition: GeometryTransformer.h:88
Definition: PointwisePrecisionReducerTransformer.h:40
Basic namespace for all GEOS functionalities.
Definition: geos.h:39