26#include <geos/geom/Coordinate.h>
27#include <geos/geom/Geometry.h>
28#include <geos/geom/LineSegment.h>
45 std::size_t componentIndex;
46 std::size_t segmentIndex;
47 double segmentFraction;
94 LinearLocation(std::size_t componentIndex, std::size_t segmentIndex,
double segmentFraction);
219 std::size_t componentIndex0, std::size_t segmentIndex0,
double segmentFraction0,
220 std::size_t componentIndex1, std::size_t segmentIndex1,
double segmentFraction1);
241 friend std::ostream& operator<< (std::ostream& out,
const LinearLocation& obj);
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.
static int compareLocationValues(std::size_t componentIndex0, std::size_t segmentIndex0, double segmentFraction0, std::size_t componentIndex1, std::size_t segmentIndex1, double segmentFraction1)
Compares two sets of location values for order.
int compareTo(const LinearLocation &other) const
Compares this object with the specified object for order.
bool isEndpoint(const geom::Geometry &linearGeom) const
Tests whether this location is an endpoint of the linear component it refers to.
LinearLocation(std::size_t segmentIndex=0, double segmentFraction=0.0)
Creates a location referring to the start of a linear geometry.
bool isOnSameSegment(const LinearLocation &loc) const
Tests whether two locations are on the same segment in the parent Geometry.
double getSegmentLength(const geom::Geometry *linearGeom) const
Gets the length of the segment in the given Geometry containing this location.
bool isVertex() const
Tests whether this location refers to a vertex.
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...
std::size_t getSegmentIndex() const
Gets the segment index for this location.
void setToEnd(const geom::Geometry *linear)
Sets the value of this location to refer the end of a linear geometry.
double getSegmentFraction() const
Gets the segment fraction for this location.
int compareLocationValues(std::size_t componentIndex1, std::size_t segmentIndex1, double segmentFraction1) const
Compares this object with the specified index values for order.
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 snapToVertex(const geom::Geometry *linearGeom, double minDistance)
Snaps the value of this location to the nearest vertex on the given linear Geometry,...
void clamp(const geom::Geometry *linear)
Ensures the indexes are valid for a given linear Geometry.
static geom::Coordinate pointAlongSegmentByFraction(const geom::Coordinate &p0, const geom::Coordinate &p1, double frac)
Computes the Coordinate of a point a given fraction along the line segment (p0, p1).
std::size_t getComponentIndex() const
Gets the component index for this location.
Basic namespace for all GEOS functionalities.
Definition geos.h:39