GEOS  3.13.0dev
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
23 namespace geos {
24 namespace geom {
25 class PrecisionModel;
26 class Geometry;
27 class CoordinateSequence;
28 }
29 }
30 
31 namespace geos {
32 namespace precision { // geos.precision
33 
34 
41 
42 private:
43 
44  const geom::PrecisionModel& targetPM;
45 
46  std::unique_ptr<geom::CoordinateSequence> reducePointwise(
47  const geom::CoordinateSequence* coordinates);
48 
49 public:
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 
62 protected:
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:56
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:88
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: Angle.h:25