GEOS 3.4.2

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

- File List

LengthIndexedLine.h
1 /**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2011 Sandro Santilli <strk@keybit.net>
7 * Copyright (C) 2005-2006 Refractions Research Inc.
8 * Copyright (C) 2001-2002 Vivid Solutions Inc.
9 *
10 * This is free software; you can redistribute and/or modify it under
11 * the terms of the GNU Lesser General Public Licence as published
12 * by the Free Software Foundation.
13 * See the COPYING file for more information.
14 *
15 **********************************************************************
16 *
17 * Last port: linearref/LengthIndexedLine.java r463
18 *
19 **********************************************************************/
20
21 #ifndef GEOS_LINEARREF_LENGTHINDEXEDLINE_H
22 #define GEOS_LINEARREF_LENGTHINDEXEDLINE_H
23
24 #include <geos/export.h>
25 #include <geos/geom/Coordinate.h>
26 #include <geos/geom/Geometry.h>
27 #include <geos/linearref/LinearLocation.h>
28
29 namespace geos
30 {
31 namespace linearref // geos::linearref
32 {
33
45 class GEOS_DLL LengthIndexedLine
46 {
47 private:
48 const geom::Geometry *linearGeom;
49 LinearLocation locationOf(double index) const;
50 LinearLocation locationOf(double index, bool resolveLower) const;
51 double positiveIndex(double index) const;
52
53 public:
54
62 LengthIndexedLine(const geom::Geometry *linearGeom);
63
75 geom::Coordinate extractPoint(double index) const;
76
77
96 geom::Coordinate extractPoint(double index, double offsetDistance) const;
97
108 geom::Geometry *extractLine(double startIndex, double endIndex) const;
109
110
128 double indexOf(const geom::Coordinate& pt) const;
129
152 double indexOfAfter(const geom::Coordinate& pt, double minIndex) const;
153
163 double* indicesOf(const geom::Geometry *subLine) const;
164
165
175 double project(const geom::Coordinate& pt) const;
176
181 double getStartIndex() const;
182
187 double getEndIndex() const;
188
195 bool isValidIndex(double index) const;
196
197
204 double clampIndex(double index) const;
205 };
206 }
207 }
208 #endif