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/geom/Coordinate.h>
00025 #include <geos/geom/Geometry.h>
00026 #include <geos/linearref/LinearLocation.h>
00027
00028 namespace geos
00029 {
00030 namespace linearref
00031 {
00032
00044 class LengthIndexedLine
00045 {
00046 private:
00047 const geom::Geometry *linearGeom;
00048 LinearLocation locationOf(double index) const;
00049
00050 public:
00051
00059 LengthIndexedLine(const geom::Geometry *linearGeom);
00060
00072 geom::Coordinate extractPoint(double index) const;
00073
00074
00091 geom::Coordinate extractPoint(double index, double offsetDistance) const;
00092
00103 geom::Geometry *extractLine(double startIndex, double endIndex) const;
00104
00105
00123 double indexOf(const geom::Coordinate& pt) const;
00124
00147 double indexOfAfter(const geom::Coordinate& pt, double minIndex) const;
00148
00158 double* indicesOf(const geom::Geometry *subLine) const;
00159
00160
00170 double project(const geom::Coordinate& pt) const;
00171
00176 double getStartIndex() const;
00177
00182 double getEndIndex() const;
00183
00190 bool isValidIndex(double index) const;
00191
00192
00199 double clampIndex(double index) const;
00200 };
00201 }
00202 }
00203 #endif