00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEOS_LINEARREF_LENGTHINDEXOFPOINT_H
00021 #define GEOS_LINEARREF_LENGTHINDEXOFPOINT_H
00022
00023 #include <string>
00024
00025 #include <geos/geom/Coordinate.h>
00026 #include <geos/geom/Geometry.h>
00027 #include <geos/geom/LineSegment.h>
00028 #include <geos/linearref/LinearLocation.h>
00029
00030
00031 namespace geos
00032 {
00033 namespace linearref
00034 {
00035
00045 class LengthIndexOfPoint
00046 {
00047
00048 private:
00049 const geom::Geometry *linearGeom;
00050
00051 double indexOfFromStart(const geom::Coordinate& inputPt, const double minIndex) const;
00052
00053 double segmentNearestMeasure(const geom::LineSegment *seg,
00054 const geom::Coordinate& inputPt,
00055 double segmentStartMeasure) const;
00056 public:
00057 static double indexOf(const geom::Geometry *linearGeom, const geom::Coordinate& inputPt);
00058
00059 static double indexOfAfter(const geom::Geometry *linearGeom, const geom::Coordinate& inputPt, double minIndex);
00060
00061 LengthIndexOfPoint(const geom::Geometry *linearGeom);
00062
00069 double indexOf(const geom::Coordinate& inputPt) const;
00070
00086 double indexOfAfter(const geom::Coordinate& inputPt, double minIndex) const;
00087
00088 };
00089 }
00090 }
00091 #endif