GEOS  3.8.0dev
LengthIndexedLine.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
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 namespace linearref { // geos::linearref
31 
43 class GEOS_DLL LengthIndexedLine {
44 private:
45  const geom::Geometry* linearGeom;
46  LinearLocation locationOf(double index) const;
47  LinearLocation locationOf(double index, bool resolveLower) const;
48  double positiveIndex(double index) const;
49 
50 public:
51 
59  LengthIndexedLine(const geom::Geometry* linearGeom);
60 
72  geom::Coordinate extractPoint(double index) const;
73 
74 
93  geom::Coordinate extractPoint(double index, double offsetDistance) const;
94 
105  geom::Geometry* extractLine(double startIndex, double endIndex) const;
106 
107 
125  double indexOf(const geom::Coordinate& pt) const;
126 
149  double indexOfAfter(const geom::Coordinate& pt, double minIndex) const;
150 
160  double* indicesOf(const geom::Geometry* subLine) const;
161 
162 
172  double project(const geom::Coordinate& pt) const;
173 
178  double getStartIndex() const;
179 
184  double getEndIndex() const;
185 
192  bool isValidIndex(double index) const;
193 
194 
201  double clampIndex(double index) const;
202 };
203 }
204 }
205 #endif
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:187
Represents a location along a LineString or MultiLineString.
Definition: LinearLocation.h:43
Supports linear referencing along a linear Geometry using the length along the line as the index...
Definition: LengthIndexedLine.h:43
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25