Loading...
Searching...
No Matches
Functions
nearest_points.cuh File Reference
#include <rmm/cuda_stream_view.hpp>
#include <cuspatial/detail/point_linestring_nearest_points.cuh>

Go to the source code of this file.

Functions

template<class Vec2dItA , class Vec2dItB , class OffsetIteratorA , class OffsetIteratorB , class OffsetIteratorC , class OutputIt >
OutputIt cuspatial::pairwise_point_linestring_nearest_points (OffsetIteratorA points_geometry_offsets_first, OffsetIteratorA points_geometry_offsets_last, Vec2dItA points_first, Vec2dItA points_last, OffsetIteratorB linestring_geometry_offsets_first, OffsetIteratorC linestring_part_offsets_first, OffsetIteratorC linestring_part_offsets_last, Vec2dItB linestring_points_first, Vec2dItB linestring_points_last, OutputIt output_first, rmm::cuda_stream_view stream=rmm::cuda_stream_default)
 Compute the nearest points and geometry ID between pairs of multipoint and multilinestring.
 

Function Documentation

◆ pairwise_point_linestring_nearest_points()

template<class Vec2dItA , class Vec2dItB , class OffsetIteratorA , class OffsetIteratorB , class OffsetIteratorC , class OutputIt >
OutputIt cuspatial::pairwise_point_linestring_nearest_points ( OffsetIteratorA points_geometry_offsets_first,
OffsetIteratorA points_geometry_offsets_last,
Vec2dItA points_first,
Vec2dItA points_last,
OffsetIteratorB linestring_geometry_offsets_first,
OffsetIteratorC linestring_part_offsets_first,
OffsetIteratorC linestring_part_offsets_last,
Vec2dItB linestring_points_first,
Vec2dItB linestring_points_last,
OutputIt output_first,
rmm::cuda_stream_view stream = rmm::cuda_stream_default )

Compute the nearest points and geometry ID between pairs of multipoint and multilinestring.

The nearest point from a test point to a linestring is a point on the linestring that has the shortest distance to the test point compared to any other points on the linestring.

The nearest point from a test multipoint to a multilinestring is the nearest point that has the shortest distance in all pairs of points and linestrings.

In addition, this API writes these geometry and part ID where the nearest point locates to output iterators:

  • The point ID indicates which point in the multipoint is the nearest point.
  • The linestring ID is the offset within the multilinestring that contains the nearest point.
  • The segment ID is the offset within the linestring of the segment that contains the nearest point. It is the same as the ID of the starting point of the segment.
Template Parameters
Cart2dItAiterator type for point array of the point element of each pair. Must meet the requirements of LegacyRandomAccessIterator and be device-accessible.
Cart2dItBiterator type for point array of the linestring element of each pair. Must meet the requirements of LegacyRandomAccessIterator and be device-accessible.
OffsetIteratorAiterator type for point_geometry_offset array. Must meet the requirements of LegacyRandomAccessIterator and be device-accessible.
OffsetIteratorBiterator type for linestring_geometry_offset array. Must meet the requirements of LegacyRandomAccessIterator and be device-accessible.
OffsetIteratorCiterator type for linestring_part_offset array. Must meet the requirements of LegacyRandomAccessIterator and be device-accessible.
OutputItiterator type for output array. Must meet the requirements of LegacyRandomAccessIterator and be device-accessible.
Parameters
point_geometry_offset_firstbeginning of the range of multipoint geometries of each pair
point_geometry_offset_lastend of the range of multipoint geometries of each pair
points_firstbeginning of the range of point values
points_lastend of the range of the point values
linestring_geometry_offset_firstbeginning of the range of offsets to the multilinestring geometry of each pair, the end range is implied by linestring_geometry_offset_first + std::distance(point_geometry_offset_first, point_geometry_offset_last)
linestring_offsets_firstbeginning of the range of offsets to the starting point of each linestring
linestring_offsets_lastend of the range of offsets to the starting point of each linestring
linestring_points_firstbeginning of the range of linestring points
linestring_points_lastend of the range of linestring points
output_firstA zipped-iterator of 4 outputs. The first element should be compatible with iterator_value_type<OffsetIteratorA>, stores the geometry ID of the nearest point in multipoint. The second element should be compatible with iterator_value_type<OffsetIteratorB>, stores the geometry ID of the nearest linestring. The third element should be compatible with iterator_value_type<OffsetIteratorC>, stores the part ID to the nearest segment. The forth element should be compatible with vec_2d, stores the coordinate of the nearest point on the (multi)linestring.
streamThe CUDA stream to use for device memory operations and kernel launches.
Returns
Output iterator to the element past the last tuple computed.
Precondition
all input iterators for coordinates must have cuspatial::vec_2d type, and must have the same base floating point type.