计算几何体之间最近点的API。更多...
文件 | |
文件 | nearest_points.hpp |
文件 | nearest_points.cuh |
类 | |
结构体 | cuspatial::point_linestring_nearest_points_result |
pairwise_point_linestring_nearest_points 的结果容器。更多... | |
函数 | |
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::device_async_resource_ref mr=rmm::mr::get_current_device_resource()) |
计算(多)点和(多)线串对之间的最近点和几何体ID。 | |
计算几何体之间最近点的API。
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::device_async_resource_ref | mr = rmm::mr::get_current_device_resource() ) |
计算(多)点和(多)线串对之间的最近点和几何体ID。
测试点到线串的最近点是线串上的一个点,与线串上的其他点相比,该点到测试点的距离最短。
测试多点到多线串的最近点是多线串中的一个点,该点在所有点和线串对中具有最短距离。
返回一个包含列的结构体,其中包含(对于每一对)(多)点中最近点的ID、(多)线串中线串的ID、线串中线段的ID以及(多)线串上最近点的坐标。详情请参阅 point_linestring_nearest_points_result
。
下面的示例计算了从2个点到2个线串的最近点
下面的示例计算了从3个多点到3个多线串的最近点
multipoint_geometry_offsets | 每个多点的起始和结束索引 |
points_xy | 点的交错 x, y 坐标 |
multilinestring_geometry_offsets | 每个多线串的起始和结束索引 |
linestring_part_offsets | 每个线串的起始和结束索引 |
linestring_points_xy | 线串点的交错 x, y 坐标 |
mr | 用于分配返回列的设备内存资源。 |
cuspatial::logic_error | 如果 points_xy 或 linestring_points_xy 包含奇数个坐标。 |
cuspatial::logic_error | 如果 points_xy 或 linestring_points_xy 不是浮点类型。 |
cuspatial::logic_error | 如果(多)点数量与(多)线串数量不匹配。 |
cuspatial::logic_error | 如果 point_xy 和 linestring_points_xy 的类型不匹配。 |
cuspatial::logic_error | 如果 point_xy 和 linestring_points_xy 中的任何一个包含 null。 |