21 #ifndef GEOS_LINEARREF_LINEARLOCATION_H 22 #define GEOS_LINEARREF_LINEARLOCATION_H 27 #include <geos/geom/Coordinate.h> 28 #include <geos/geom/Geometry.h> 29 #include <geos/geom/LineSegment.h> 46 size_t componentIndex;
48 double segmentFraction;
93 LinearLocation(
size_t segmentIndex = 0,
double segmentFraction = 0.0);
95 LinearLocation(
size_t componentIndex,
size_t segmentIndex,
double segmentFraction);
204 int compareLocationValues(
size_t componentIndex1,
size_t segmentIndex1,
double segmentFraction1)
const;
220 size_t componentIndex0,
size_t segmentIndex0,
double segmentFraction0,
221 size_t componentIndex1,
size_t segmentIndex1,
double segmentFraction1);
242 friend std::ostream& operator<< (std::ostream& out,
const LinearLocation& obj);
double getSegmentLength(const geom::Geometry *linearGeom) const
Gets the length of the segment in the given Geometry containing this location.
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
void clamp(const geom::Geometry *linear)
Ensures the indexes are valid for a given linear Geometry.
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:188
bool isOnSameSegment(const LinearLocation &loc) const
Tests whether two locations are on the same segment in the parent Geometry.
size_t getComponentIndex() const
Gets the component index for this location.
Represents a location along a LineString or MultiLineString.
Definition: LinearLocation.h:44
int compareLocationValues(size_t componentIndex1, size_t segmentIndex1, double segmentFraction1) const
Compares this object with the specified index values for order.
bool isVertex() const
Tests whether this location refers to a vertex.
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).
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
LinearLocation(size_t segmentIndex=0, double segmentFraction=0.0)
Creates a location referring to the start of a linear geometry.
size_t getSegmentIndex() const
Gets the segment index for this location.
int compareTo(const LinearLocation &other) const
Compares this object with the specified object for order.
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.
bool isEndpoint(const geom::Geometry &linearGeom) const
Tests whether this location is an endpoint of the linear component it refers to.
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...
void setToEnd(const geom::Geometry *linear)
Sets the value of this location to refer the end of a linear geometry.
geom::Coordinate getCoordinate(const geom::Geometry *linearGeom) const
Gets the Coordinate along the given linear Geometry which is referenced by this location.
void snapToVertex(const geom::Geometry *linearGeom, double minDistance)
Snaps the value of this location to the nearest vertex on the given linear Geometry,...
bool isValid(const geom::Geometry *linearGeom) const
Tests whether this location refers to a valid location on the given linear Geometry.