GEOS  3.9.1
LinearGeometryBuilder.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2005-2006 Refractions Research Inc.
7  * Copyright (C) 2001-2002 Vivid Solutions Inc.
8  *
9  * This is free software; you can redistribute and/or modify it under
10  * the terms of the GNU Lesser General Public Licence as published
11  * by the Free Software Foundation.
12  * See the COPYING file for more information.
13  *
14  **********************************************************************
15  *
16  * Last port: linearref/LinearGeometryBuilder.java rev. 1.1
17  *
18  **********************************************************************/
19 
20 #ifndef GEOS_LINEARREF_LINEARGEOMETRYBUILDER_H
21 #define GEOS_LINEARREF_LINEARGEOMETRYBUILDER_H
22 
23 #include <geos/geom/Coordinate.h>
24 #include <geos/geom/CoordinateList.h>
25 #include <geos/geom/Geometry.h>
26 #include <geos/geom/GeometryFactory.h>
27 #include <geos/linearref/LinearLocation.h>
28 
29 #include <vector>
30 
31 namespace geos {
32 namespace linearref { // geos::linearref
33 
41 private:
42  const geom::GeometryFactory* geomFact;
43 
44  typedef std::vector<const geom::Geometry*> GeomPtrVect;
45 
46  // Geometry elements owned by this class
47  GeomPtrVect lines;
48 
49  bool ignoreInvalidLines;
50  bool fixInvalidLines;
52 
53  geom::Coordinate lastPt;
54 
55 public:
57 
59 
68  void setIgnoreInvalidLines(bool ignoreInvalidLines);
69 
78  void setFixInvalidLines(bool fixInvalidLines);
79 
85  void add(const geom::Coordinate& pt);
86 
94  void add(const geom::Coordinate& pt, bool allowRepeatedPoints);
95 
96  // NOTE strk: why return by value ?
97  geom::Coordinate getLastCoordinate() const;
98 
100  void endLine();
101 
102  geom::Geometry* getGeometry();
103 };
104 
105 } // namespace geos.linearref
106 } // namespace geos
107 
108 #endif
The default implementation of CoordinateSequence.
Definition: CoordinateArraySequence.h:37
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:68
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:188
Builds a linear geometry (LineString or MultiLineString) incrementally (point-by-point).
Definition: LinearGeometryBuilder.h:40
void setIgnoreInvalidLines(bool ignoreInvalidLines)
Allows invalid lines to be ignored rather than causing Exceptions.
void add(const geom::Coordinate &pt, bool allowRepeatedPoints)
Adds a point to the current line.
void add(const geom::Coordinate &pt)
Adds a point to the current line.
void endLine()
Terminate the current LineString.
void setFixInvalidLines(bool fixInvalidLines)
Allows invalid lines to be ignored rather than causing Exceptions.
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26