GEOS  3.6.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 {
33 namespace linearref // geos::linearref
34 {
35 
43 {
44 private:
45  const geom::GeometryFactory* geomFact;
46 
47  typedef std::vector<geom::Geometry *> GeomPtrVect;
48 
49  // Geometry elements owned by this class
50  GeomPtrVect lines;
51 
52  bool ignoreInvalidLines;
53  bool fixInvalidLines;
54  geom::CoordinateSequence* coordList;
55 
56  geom::Coordinate lastPt;
57 
58 public:
60 
62 
70  void setIgnoreInvalidLines(bool ignoreInvalidLines);
71 
79  void setFixInvalidLines(bool fixInvalidLines);
80 
86  void add(const geom::Coordinate& pt);
87 
93  void add(const geom::Coordinate& pt, bool allowRepeatedPoints);
94 
97 
99  void endLine();
100 
101  geom::Geometry *getGeometry();
102 };
103 
104 } // namespace geos.linearref
105 } // namespace geos
106 
107 #endif
void endLine()
Terminate the current LineString.
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
void add(const geom::Coordinate &pt)
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:167
void setIgnoreInvalidLines(bool ignoreInvalidLines)
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:67
geom::Coordinate getLastCoordinate() const
NOTE strk: why return by value ?
Definition: LinearGeometryBuilder.h:42
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:59
void setFixInvalidLines(bool fixInvalidLines)