GEOS  3.13.0dev
LengthIndexOfPoint.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2005-2006 Refractions Research Inc.
7  * Copyright (C) 2001-2002 Vivid Solutions Inc.
8  *
9  * This is free software; you can redistribute and/or modify it under
10  * the terms of the GNU Lesser General Public Licence as published
11  * by the Free Software Foundation.
12  * See the COPYING file for more information.
13  *
14  **********************************************************************
15  *
16  * Last port: linearref/LengthIndexOfPoint.java rev. 1.10
17  *
18  **********************************************************************/
19 
20 #pragma once
21 
22 #include <string>
23 
24 #include <geos/geom/Coordinate.h>
25 #include <geos/geom/Geometry.h>
26 #include <geos/geom/LineSegment.h>
27 #include <geos/linearref/LinearLocation.h>
28 
29 
30 namespace geos {
31 namespace linearref { // geos::linearref
32 
43 
44 private:
45  const geom::Geometry* linearGeom;
46 
47  double indexOfFromStart(const geom::Coordinate& inputPt, const double minIndex) const;
48 
49  double segmentNearestMeasure(const geom::LineSegment* seg,
50  const geom::Coordinate& inputPt,
51  double segmentStartMeasure) const;
52 public:
53  static double indexOf(const geom::Geometry* linearGeom, const geom::Coordinate& inputPt);
54 
55  static double indexOfAfter(const geom::Geometry* linearGeom, const geom::Coordinate& inputPt, double minIndex);
56 
57  LengthIndexOfPoint(const geom::Geometry* linearGeom);
58 
65  double indexOf(const geom::Coordinate& inputPt) const;
66 
82  double indexOfAfter(const geom::Coordinate& inputPt, double minIndex) const;
83 
84 };
85 
86 }
87 }
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:216
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
Definition: LineSegment.h:61
Computes the length index of the point on a linear Geometry nearest a given Coordinate.
Definition: LengthIndexOfPoint.h:42
double indexOf(const geom::Coordinate &inputPt) const
double indexOfAfter(const geom::Coordinate &inputPt, double minIndex) const
Finds the nearest index along the linear Geometry to a given Coordinate after the specified minimum i...
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25