SFCGAL 2.3.0
SFCGAL::detail::SegmentStore Class Reference

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

#include <SegmentStore.h>

Public Member Functions

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

Detailed Description

Collection of segments from a geometry for interpolation.

Constructor & Destructor Documentation

◆ SegmentStore()

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

Default constructor.

Member Function Documentation

◆ addSegment()

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

Add a segment to the store.

Parameters
segmentThe segment to add

◆ createPoint()

auto SFCGAL::detail::SegmentStore::createPoint ( double x,
double y,
CoordinateType dimension ) const -> Point
inlinenodiscard

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

◆ extractSegments() [1/3]

auto SFCGAL::detail::SegmentStore::extractSegments ( const Geometry & geometry) -> void
inline

Extract segments from all geometry types.

Parameters
geometryThe geometry to extract segments from

◆ extractSegments() [2/3]

auto SFCGAL::detail::SegmentStore::extractSegments ( const LineString & lineString) -> void
inline

Extract segments from a LineString for interpolation.

Parameters
lineStringThe linestring to extract segments from

◆ extractSegments() [3/3]

auto SFCGAL::detail::SegmentStore::extractSegments ( const Polygon & polygon) -> void
inline

Extract segments from a Polygon for interpolation.

Parameters
polygonThe polygon to extract segments from

◆ findNearestSegment()

auto SFCGAL::detail::SegmentStore::findNearestSegment ( double x,
double y ) const -> Segment
inlinenodiscard

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

◆ hasM()

auto SFCGAL::detail::SegmentStore::hasM ( ) const -> bool
inlinenodiscard

Check if store contains segments with M values.

Returns
True if any segment has M values

◆ hasZ()

auto SFCGAL::detail::SegmentStore::hasZ ( ) const -> bool
inlinenodiscard

Check if store contains segments with Z coordinates.

Returns
True if any segment has Z coordinates

◆ interpolateZM()

auto SFCGAL::detail::SegmentStore::interpolateZM ( double x,
double y ) const -> std::tuple< double, double >
inlinenodiscard

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