GEOS: LinearGeometryBuilder.h Source File

GEOS 3.5.0

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

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
42 class LinearGeometryBuilder
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:
59 LinearGeometryBuilder(const geom::GeometryFactory* geomFact);
60
61 ~LinearGeometryBuilder();
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
96 geom::Coordinate getLastCoordinate() const;
97
99 void endLine();
100
101 geom::Geometry *getGeometry();
102 };
103
104 } // namespace geos.linearref
105 } // namespace geos
106
107 #endif
geos::linearref::LinearGeometryBuilder::endLine
void endLine()
Terminate the current LineString.
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
geos::linearref::LinearGeometryBuilder::add
void add(const geom::Coordinate &pt)
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:167
geos::linearref::LinearGeometryBuilder::setIgnoreInvalidLines
void setIgnoreInvalidLines(bool ignoreInvalidLines)
geos::geom::GeometryFactory
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:67
geos::linearref::LinearGeometryBuilder
Definition: LinearGeometryBuilder.h:42
geos
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
geos::geom::CoordinateSequence
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:59
geos::linearref::LinearGeometryBuilder::setFixInvalidLines
void setFixInvalidLines(bool fixInvalidLines)
geos::linearref::LinearGeometryBuilder::getLastCoordinate
geom::Coordinate getLastCoordinate() const
NOTE strk: why return by value ?