00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GEOS_LINEARREF_LENGTHINDEXEDLINE_H
00022 #define GEOS_LINEARREF_LENGTHINDEXEDLINE_H
00023
00024 #include <geos/export.h>
00025 #include <geos/geom/Coordinate.h>
00026 #include <geos/geom/Geometry.h>
00027 #include <geos/linearref/LinearLocation.h>
00028
00029 namespace geos
00030 {
00031 namespace linearref
00032 {
00033
00045 class GEOS_DLL LengthIndexedLine
00046 {
00047 private:
00048 const geom::Geometry *linearGeom;
00049 LinearLocation locationOf(double index) const;
00050 LinearLocation locationOf(double index, bool resolveLower) const;
00051 double positiveIndex(double index) const;
00052
00053 public:
00054
00062 LengthIndexedLine(const geom::Geometry *linearGeom);
00063
00075 geom::Coordinate extractPoint(double index) const;
00076
00077
00096 geom::Coordinate extractPoint(double index, double offsetDistance) const;
00097
00108 geom::Geometry *extractLine(double startIndex, double endIndex) const;
00109
00110
00128 double indexOf(const geom::Coordinate& pt) const;
00129
00152 double indexOfAfter(const geom::Coordinate& pt, double minIndex) const;
00153
00163 double* indicesOf(const geom::Geometry *subLine) const;
00164
00165
00175 double project(const geom::Coordinate& pt) const;
00176
00181 double getStartIndex() const;
00182
00187 double getEndIndex() const;
00188
00195 bool isValidIndex(double index) const;
00196
00197
00204 double clampIndex(double index) const;
00205 };
00206 }
00207 }
00208 #endif