19 #ifndef GEOS_LINEARREF_LOCATIONINDEXEDLINE_H
20 #define GEOS_LINEARREF_LOCATIONINDEXEDLINE_H
22 #include <geos/export.h>
23 #include <geos/geom/Coordinate.h>
24 #include <geos/geom/Geometry.h>
25 #include <geos/linearref/LinearLocation.h>
26 #include <geos/linearref/LocationIndexOfPoint.h>
27 #include <geos/linearref/LocationIndexOfLine.h>
28 #include <geos/util/IllegalArgumentException.h>
39 class GEOS_DLL LocationIndexedLine {
41 const geom::Geometry* linearGeom;
46 if(!linearGeom->isLineal()) {
47 throw util::IllegalArgumentException(
"Input geometry must be linear");
60 LocationIndexedLine(
const geom::Geometry* p_linearGeom)
61 : linearGeom(p_linearGeom)
80 extractPoint(
const LinearLocation& index)
const
82 return index.getCoordinate(linearGeom);
106 double offsetDistance)
const
109 index.
getSegment(linearGeom)->pointAlongOffset(
127 std::unique_ptr<geom::Geometry>
153 return LocationIndexOfPoint::indexOf(linearGeom, pt);
181 indexOfAfter(
const geom::Coordinate& pt,
182 const LinearLocation& minIndex)
const
184 return LocationIndexOfPoint::indexOfAfter(linearGeom, pt, &minIndex);
199 indicesOf(
const geom::Geometry* subLine)
const
217 project(
const geom::Coordinate& pt)
const
219 return LocationIndexOfPoint::indexOf(linearGeom, pt);
229 getStartIndex()
const
231 return LinearLocation();
256 return index.
isValid(linearGeom);
268 clampIndex(
const LinearLocation& index)
const
270 LinearLocation loc = index;
271 loc.clamp(linearGeom);