libcuspatial
24.02.00
|
APIs to compute the nearest points between geometries. More...
Files | |
file | nearest_points.hpp |
file | nearest_points.cuh |
Classes | |
struct | cuspatial::point_linestring_nearest_points_result |
Container for the result of pairwise_point_linestring_nearest_points More... | |
Functions | |
point_linestring_nearest_points_result | cuspatial::pairwise_point_linestring_nearest_points (std::optional< cudf::device_span< cudf::size_type const > > multipoint_geometry_offsets, cudf::column_view points_xy, std::optional< cudf::device_span< cudf::size_type const > > multilinestring_geometry_offsets, cudf::device_span< cudf::size_type const > linestring_part_offsets, cudf::column_view linestring_points_xy, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource()) |
Compute the nearest points and geometry ID between pairs of (multi)point and (multi)linestring. | |
APIs to compute the nearest points between geometries.
point_linestring_nearest_points_result cuspatial::pairwise_point_linestring_nearest_points | ( | std::optional< cudf::device_span< cudf::size_type const > > | multipoint_geometry_offsets, |
cudf::column_view | points_xy, | ||
std::optional< cudf::device_span< cudf::size_type const > > | multilinestring_geometry_offsets, | ||
cudf::device_span< cudf::size_type const > | linestring_part_offsets, | ||
cudf::column_view | linestring_points_xy, | ||
rmm::mr::device_memory_resource * | mr = rmm::mr::get_current_device_resource() ) |
Compute the nearest points and geometry ID between pairs of (multi)point and (multi)linestring.
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 in the multilinestring that has the shortest distance between all pairs of points and linestrings.
Returns a structure of columns containing (for each pair) the ID to the nearest point in (multi)point, the ID to the linestring in the (multi)linestring, the ID to the segment in the linestring and the coordinate to the nearest point on the (multi)linestring. See point_linestring_nearest_points_result
for detail.
The below example computes the nearest point from 2 points to 2 linestrings:
The below example computes the nearest point from 3 multipoints to 3 multilinestrings:
multipoint_geometry_offsets | Beginning and ending indices for each multipoint |
points_xy | Interleaved x, y-coordinate of points |
multilinestring_geometry_offsets | Beginning and ending indices for each multilinestring |
linestring_part_offsets | Beginning and ending indices for each linestring |
linestring_points_xy | Interleaved x, y-coordinates of the linestring points |
mr | Device memory resource used to allocate the returned column. |
cuspatial::logic_error | if points_xy or linestring_points_xy contains odd number of coordinates. |
cuspatial::logic_error | if points_xy or linestring_points_xy are not floating point type. |
cuspatial::logic_error | if the number of (multi)point(s) mismatch the number of (multi)linestring(s). |
cuspatial::logic_error | if the type of point_xy and linestring_points_xy mismatch. |
cuspatial::logic_error | if any of point_xy and linestring_points_xy contains null. |