SFCGAL  2.3.0
Public Member Functions | List of all members
SFCGAL::detail::SegmentStore Class Reference

Collection of segments from a geometry for interpolation. More...

#include <SegmentStore.h>

Public Member Functions

 SegmentStore ()=default
 Default constructor. More...
 
void addSegment (const Segment &segment)
 Add a segment to the store. More...
 
auto hasZ () const -> bool
 Check if store contains segments with Z coordinates. More...
 
auto hasM () const -> bool
 Check if store contains segments with M values. More...
 
auto findNearestSegment (double x, double y) const -> Segment
 Find the nearest segment to a point. More...
 
auto interpolateZM (double x, double y) const -> std::tuple< double, double >
 Interpolate Z and M values for a point. More...
 
auto extractSegments (const LineString &lineString) -> void
 Extract segments from a LineString for interpolation. More...
 
auto extractSegments (const Polygon &polygon) -> void
 Extract segments from a Polygon for interpolation. More...
 
auto extractSegments (const Geometry &geometry) -> void
 Extract segments from all geometry types. More...
 
auto createPoint (double x, double y, CoordinateType dimension) const -> Point
 Create a point with interpolated Z and M values. More...
 

Detailed Description

Collection of segments from a geometry for interpolation.

Constructor & Destructor Documentation

SFCGAL::detail::SegmentStore::SegmentStore ( )
default

Default constructor.

Member Function Documentation

void SFCGAL::detail::SegmentStore::addSegment ( const Segment &  segment)
inline

Add a segment to the store.

Parameters
segmentThe segment to add
auto SFCGAL::detail::SegmentStore::createPoint ( double  x,
double  y,
CoordinateType  dimension 
) const -> Point
inline

Create a point with interpolated Z and M values.

Parameters
xX-coordinate of the point
yY-coordinate of the point
dimensionThe coordinate type for the point
Returns
Point with interpolated Z and M values
auto SFCGAL::detail::SegmentStore::extractSegments ( const LineString &  lineString) -> void
inline

Extract segments from a LineString for interpolation.

Parameters
lineStringThe linestring to extract segments from
auto SFCGAL::detail::SegmentStore::extractSegments ( const Polygon &  polygon) -> void
inline

Extract segments from a Polygon for interpolation.

Parameters
polygonThe polygon to extract segments from
auto SFCGAL::detail::SegmentStore::extractSegments ( const Geometry &  geometry) -> void
inline

Extract segments from all geometry types.

Parameters
geometryThe geometry to extract segments from
auto SFCGAL::detail::SegmentStore::findNearestSegment ( double  x,
double  y 
) const -> Segment
inline

Find the nearest segment to a point.

Parameters
xX-coordinate of the point
yY-coordinate of the point
Returns
The nearest segment to the given point
auto SFCGAL::detail::SegmentStore::hasM ( ) const -> bool
inline

Check if store contains segments with M values.

Returns
True if any segment has M values
auto SFCGAL::detail::SegmentStore::hasZ ( ) const -> bool
inline

Check if store contains segments with Z coordinates.

Returns
True if any segment has Z coordinates
auto SFCGAL::detail::SegmentStore::interpolateZM ( double  x,
double  y 
) const -> std::tuple<double, double>
inline

Interpolate Z and M values for a point.

Parameters
xX-coordinate of the point
yY-coordinate of the point
Returns
Tuple with interpolated (z, m) values, NaN if not applicable