GEOS 3.3.4

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

LengthIndexOfPoint.h
1 /**********************************************************************
2 * $Id: LengthIndexOfPoint.h 3012 2010-06-19 11:14:21Z strk $
3 *
4 * GEOS - Geometry Engine Open Source
5 * http://geos.refractions.net
6 *
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/LengthIndexOfPoint.java rev. 1.10
18 *
19 **********************************************************************/
20
21 #ifndef GEOS_LINEARREF_LENGTHINDEXOFPOINT_H
22 #define GEOS_LINEARREF_LENGTHINDEXOFPOINT_H
23
24 #include <string>
25
26 #include <geos/geom/Coordinate.h>
27 #include <geos/geom/Geometry.h>
28 #include <geos/geom/LineSegment.h>
29 #include <geos/linearref/LinearLocation.h>
30
31
32 namespace geos
33 {
34 namespace linearref // geos::linearref
35 {
36
46 class LengthIndexOfPoint
47 {
48
49 private:
50 const geom::Geometry *linearGeom;
51
52 double indexOfFromStart(const geom::Coordinate& inputPt, const double minIndex) const;
53
54 double segmentNearestMeasure(const geom::LineSegment *seg,
55 const geom::Coordinate& inputPt,
56 double segmentStartMeasure) const;
57 public:
58 static double indexOf(const geom::Geometry *linearGeom, const geom::Coordinate& inputPt);
59
60 static double indexOfAfter(const geom::Geometry *linearGeom, const geom::Coordinate& inputPt, double minIndex);
61
62 LengthIndexOfPoint(const geom::Geometry *linearGeom);
63
70 double indexOf(const geom::Coordinate& inputPt) const;
71
87 double indexOfAfter(const geom::Coordinate& inputPt, double minIndex) const;
88
89 };
90 }
91 }
92 #endif