21 #include <geos/export.h>
22 #include <geos/geom/Coordinate.h>
23 #include <geos/geom/Geometry.h>
24 #include <geos/linearref/ExtractLineByLocation.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>
46 if(!linearGeom->isLineal()) {
61 : linearGeom(p_linearGeom)
106 double offsetDistance)
const
109 index.
getSegment(linearGeom)->pointAlongOffset(
127 std::unique_ptr<geom::Geometry>
153 return LocationIndexOfPoint::indexOf(linearGeom, pt);
184 return LocationIndexOfPoint::indexOfAfter(linearGeom, pt, &minIndex);
219 return LocationIndexOfPoint::indexOf(linearGeom, pt);
256 return index.
isValid(linearGeom);
271 loc.
clamp(linearGeom);
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:217
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:197
Represents a location along a LineString or MultiLineString.
Definition: LinearLocation.h:43
static LinearLocation getEndLocation(const geom::Geometry *linear)
Gets a location which refers to the end of a linear Geometry.
double getSegmentFraction() const
Gets the segment fraction for this location.
geom::Coordinate getCoordinate(const geom::Geometry *linearGeom) const
Gets the Coordinate along the given linear Geometry which is referenced by this location.
bool isValid(const geom::Geometry *linearGeom) const
Tests whether this location refers to a valid location on the given linear Geometry.
void clamp(const geom::Geometry *linear)
Ensures the indexes are valid for a given linear Geometry.
std::unique_ptr< geom::LineSegment > getSegment(const geom::Geometry *linearGeom) const
Gets a LineSegment representing the segment of the given linear Geometry which contains this location...
static LinearLocation * indicesOf(const geom::Geometry *linearGeom, const geom::Geometry *subLine)
Determines the location of a subline along a linear Geometry.
Supports linear referencing along a linear Geometry using LinearLocations as the index.
Definition: LocationIndexedLine.h:39
bool isValidIndex(const LinearLocation &index) const
Tests whether an index is in the valid index range for the line.
Definition: LocationIndexedLine.h:254
LinearLocation clampIndex(const LinearLocation &index) const
Computes a valid index for this line by clamping the given index to the valid range of index values.
Definition: LocationIndexedLine.h:268
LinearLocation indexOf(const geom::Coordinate &pt) const
Computes the index for a given point on the line.
Definition: LocationIndexedLine.h:151
LinearLocation indexOfAfter(const geom::Coordinate &pt, const LinearLocation &minIndex) const
Finds the index for a point on the line which is greater than the given index.
Definition: LocationIndexedLine.h:181
LinearLocation * indicesOf(const geom::Geometry *subLine) const
Computes the indices for a subline of the line.
Definition: LocationIndexedLine.h:199
geom::Coordinate extractPoint(const LinearLocation &index) const
Computes the Coordinate for the point on the line at the given index.
Definition: LocationIndexedLine.h:80
geom::Coordinate extractPoint(const LinearLocation &index, double offsetDistance) const
Computes the Coordinate for the point on the line at the given index, offset by the given distance.
Definition: LocationIndexedLine.h:105
LinearLocation getStartIndex() const
Returns the index of the start of the line.
Definition: LocationIndexedLine.h:229
LinearLocation getEndIndex() const
Returns the index of the end of the line.
Definition: LocationIndexedLine.h:241
LinearLocation project(const geom::Coordinate &pt) const
Computes the index for the closest point on the line to the given point.
Definition: LocationIndexedLine.h:217
LocationIndexedLine(const geom::Geometry *p_linearGeom)
Constructs an object which allows linear referencing along a given linear Geometry.
Definition: LocationIndexedLine.h:60
std::unique_ptr< geom::Geometry > extractLine(const LinearLocation &startIndex, const LinearLocation &endIndex) const
Computes the LineString for the interval on the line between the given indices.
Definition: LocationIndexedLine.h:128
Indicates one or more illegal arguments.
Definition: IllegalArgumentException.h:33
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25