00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GEOS_LINEARREF_LENGTHINDEXOFPOINT_H
00022 #define GEOS_LINEARREF_LENGTHINDEXOFPOINT_H
00023
00024 #include <string>
00025
00026 #include <geos/geom/Coordinate.h>
00027 #include <geos/geom/Geometry.h>
00028 #include <geos/geom/LineSegment.h>
00029 #include <geos/linearref/LinearLocation.h>
00030
00031
00032 namespace geos
00033 {
00034 namespace linearref
00035 {
00036
00037 class LengthIndexOfPoint
00038 {
00039
00040 private:
00041 const geom::Geometry *linearGeom;
00042
00043 double indexOfFromStart(const geom::Coordinate& inputPt, const double minIndex) const;
00044
00045 double segmentNearestMeasure(const geom::LineSegment *seg,
00046 const geom::Coordinate& inputPt,
00047 double segmentStartMeasure) const;
00048 public:
00049 static double indexOf(const geom::Geometry *linearGeom, const geom::Coordinate& inputPt);
00050
00051 static double indexOfAfter(const geom::Geometry *linearGeom, const geom::Coordinate& inputPt, double minIndex);
00052
00053 LengthIndexOfPoint(const geom::Geometry *linearGeom);
00054
00061 double indexOf(const geom::Coordinate& inputPt) const;
00062
00078 double indexOfAfter(const geom::Coordinate& inputPt, double minIndex) const;
00079
00080 };
00081 }
00082 }
00083 #endif