GEOS  3.13.0dev
LocationIndexOfPoint.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
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/LinearGeometryBuilder.java r466
18  *
19  **********************************************************************/
20 
21 #pragma once
22 
23 #include <geos/geom/Coordinate.h>
24 #include <geos/geom/Geometry.h>
25 #include <geos/linearref/LinearLocation.h>
26 
27 namespace geos {
28 namespace linearref { // geos::linearref
29 
38 
39 private:
40  const geom::Geometry* linearGeom;
41 
42  LinearLocation indexOfFromStart(const geom::CoordinateXY& inputPt, const LinearLocation* minIndex) const;
43 
44 public:
45  static LinearLocation indexOf(const geom::Geometry* linearGeom, const geom::CoordinateXY& inputPt);
46 
47  static LinearLocation indexOfAfter(const geom::Geometry* linearGeom, const geom::CoordinateXY& inputPt,
48  const LinearLocation* minIndex);
49 
50  LocationIndexOfPoint(const geom::Geometry* linearGeom);
51 
59  LinearLocation indexOf(const geom::CoordinateXY& inputPt) const;
60 
74  LinearLocation indexOfAfter(const geom::CoordinateXY& inputPt, const LinearLocation* minIndex) const;
75 };
76 }
77 }
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
Represents a location along a LineString or MultiLineString.
Definition: LinearLocation.h:43
Computes the LinearLocation of the point on a linear Geometry nearest a given Coordinate.
Definition: LocationIndexOfPoint.h:37
LinearLocation indexOfAfter(const geom::CoordinateXY &inputPt, const LinearLocation *minIndex) const
Find the nearest LinearLocation along the linear Geometry to a given Coordinate after the specified m...
LinearLocation indexOf(const geom::CoordinateXY &inputPt) const
Find the nearest location along a linear Geometry to a given point.
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25