GEOS 3.6.2
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
29namespace geos
30{
31namespace linearref // geos::linearref
32{
33
44
45class GEOS_DLL LengthIndexedLine
46{
47private:
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
53public:
54
61
63
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
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:167
double indexOfAfter(const geom::Coordinate &pt, double minIndex) const
geom::Coordinate extractPoint(double index, double offsetDistance) const
Computes the Coordinate for the point on the line at the given index, offset by the given distance.
double project(const geom::Coordinate &pt) const
LengthIndexedLine(const geom::Geometry *linearGeom)
Constructs an object which allows a linear Geometry to be linearly referenced using length as an inde...
geom::Geometry * extractLine(double startIndex, double endIndex) const
bool isValidIndex(double index) const
double * indicesOf(const geom::Geometry *subLine) const
double indexOf(const geom::Coordinate &pt) const
geom::Coordinate extractPoint(double index) const
Computes the Coordinate for the point on the line at the given index. If the index is out of range th...
double clampIndex(double index) const
Represents a location along a LineString or MultiLineString.
Definition LinearLocation.h:44
Provides classes for various kinds of spatial indexes.
Definition IndexedNestedRingTester.h:31
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25