GEOS 3.6.2
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
31namespace geos
32{
33namespace linearref // geos::linearref
34{
35
42class LinearGeometryBuilder
43{
44private:
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
58public:
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
97
99 void endLine();
100
101 geom::Geometry *getGeometry();
102};
103
104} // namespace geos.linearref
105} // namespace geos
106
107#endif
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:59
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:67
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:167
geom::Coordinate getLastCoordinate() const
NOTE strk: why return by value ?
void setIgnoreInvalidLines(bool ignoreInvalidLines)
void add(const geom::Coordinate &pt, bool allowRepeatedPoints)
void add(const geom::Coordinate &pt)
void endLine()
Terminate the current LineString.
void setFixInvalidLines(bool fixInvalidLines)
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25