与空间关系相关的 API。更多...
文件 | |
文件 | bounding_boxes.hpp |
文件 | bounding_boxes.cuh |
文件 | point_in_polygon.hpp |
文件 | point_in_polygon.cuh |
函数 | |
template<typename IdInputIt, typename PointInputIt, typename BoundingBoxOutputIt, typename T = iterator_vec_base_type<PointInputIt>> | |
BoundingBoxOutputIt | cuspatial::point_bounding_boxes (IdInputIt ids_first, IdInputIt ids_last, PointInputIt points_first, BoundingBoxOutputIt bounding_boxes_first, T expansion_radius=T{0}, rmm::cuda_stream_view stream=rmm::cuda_stream_default) |
计算点序列的空间边界框。 | |
template<class LinestringOffsetIterator, class VertexIterator, class BoundingBoxIterator, class T = iterator_vec_base_type<VertexIterator>, class IndexT = iterator_value_type<LinestringOffsetIterator>> | |
BoundingBoxIterator | cuspatial::linestring_bounding_boxes (LinestringOffsetIterator linestring_offsets_first, LinestringOffsetIterator linestring_offsets_last, VertexIterator linestring_vertices_first, VertexIterator linestring_vertices_last, BoundingBoxIterator bounding_boxes_first, T expansion_radius=T{0}, rmm::cuda_stream_view stream=rmm::cuda_stream_default) |
计算每个线串的最小边界框。 | |
template<class PolygonOffsetIterator, class RingOffsetIterator, class VertexIterator, class BoundingBoxIterator, class T = iterator_vec_base_type<VertexIterator>, class IndexT = iterator_value_type<PolygonOffsetIterator>> | |
BoundingBoxIterator | cuspatial::polygon_bounding_boxes (PolygonOffsetIterator polygon_offsets_first, PolygonOffsetIterator polygon_offsets_last, RingOffsetIterator polygon_ring_offsets_first, RingOffsetIterator polygon_ring_offsets_last, VertexIterator polygon_vertices_first, VertexIterator polygon_vertices_last, BoundingBoxIterator bounding_boxes_first, T expansion_radius=T{0}, rmm::cuda_stream_view stream=rmm::cuda_stream_default) |
计算每个多边形的最小边界框。 | |
std::unique_ptr< cudf::table > | cuspatial::linestring_bounding_boxes (cudf::column_view const &linestring_offsets, cudf::column_view const &x, cudf::column_view const &y, double expansion_radius, rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource()) |
计算一组线串和扩展半径的最小边界框。 | |
std::unique_ptr< cudf::table > | cuspatial::polygon_bounding_boxes (cudf::column_view const &poly_offsets, cudf::column_view const &ring_offsets, cudf::column_view const &x, cudf::column_view const &y, double expansion_radius=0.0, rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource()) |
计算列表中每个多边形的最小边界框。 | |
template<class PointRange, class PolygonRange, class OutputIt> | |
OutputIt | cuspatial::point_in_polygon (PointRange points, PolygonRange polygons, OutputIt output, rmm::cuda_stream_view stream=rmm::cuda_stream_default) |
测试指定的点是否在任何指定的多边形内。 | |
template<typename PointRange, typename PolygonRange, typename OutputIt> | |
OutputIt | cuspatial::pairwise_point_in_polygon (PointRange points, PolygonRange polygons, OutputIt results, rmm::cuda_stream_view stream=rmm::cuda_stream_default) |
给定 (点, 多边形) 对,测试对中的点是否在对中的多边形内。 | |
std::unique_ptr< cudf::column > | cuspatial::point_in_polygon (cudf::column_view const &test_points_x, cudf::column_view const &test_points_y, cudf::column_view const &poly_offsets, cudf::column_view const &poly_ring_offsets, cudf::column_view const &poly_points_x, cudf::column_view const &poly_points_y, rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource()) |
测试指定的点是否在任何指定的多边形内。 | |
std::unique_ptr< cudf::column > | cuspatial::pairwise_point_in_polygon (cudf::column_view const &test_points_x, cudf::column_view const &test_points_y, cudf::column_view const &poly_offsets, cudf::column_view const &poly_ring_offsets, cudf::column_view const &poly_points_x, cudf::column_view const &poly_points_y, rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource()) |
给定 (点, 多边形) 对,测试每对的点是否在该对的多边形内。 | |
与空间关系相关的 API。
std::unique_ptr< cudf::table > cuspatial::linestring_bounding_boxes | ( | cudf::column_view const & | linestring_offsets, |
cudf::column_view const & | x, | ||
cudf::column_view const & | y, | ||
double | expansion_radius, | ||
rmm::device_async_resource_ref | mr = rmm::mr::get_current_device_resource() ) |
计算一组线串和扩展半径的最小边界框。
linestring_offsets | 每个线串中第一个点的起始索引(即前缀和) |
x | 线串点的 x 坐标 |
y | 线串点的 y 坐标 |
expansion_radius | 扩展半径 |
x
和 y
相同:x_min - 每个边界框的最小 x 坐标;y_min - 每个边界框的最小 y 坐标;x_max - 每个边界框的最大 x 坐标;y_max - 每个边界框的最大 y 坐标linestring_offsets
的大小应比要处理的线串数量多一。此函数不使用最后一个偏移量,但偏移量的数量决定了输出大小。BoundingBoxIterator cuspatial::linestring_bounding_boxes | ( | LinestringOffsetIterator | linestring_offsets_first, |
LinestringOffsetIterator | linestring_offsets_last, | ||
VertexIterator | linestring_vertices_first, | ||
VertexIterator | linestring_vertices_last, | ||
BoundingBoxIterator | bounding_boxes_first, | ||
T | expansion_radius = T{0}, | ||
rmm::cuda_stream_view | stream = rmm::cuda_stream_default ) |
计算每个线串的最小边界框。
LinestringOffsetIterator | 线串偏移量的迭代器类型。必须满足 LegacyRandomAccessIterator 的要求并且可设备读取。 |
VertexIterator | 线串顶点的迭代器类型。必须满足 LegacyRandomAccessIterator 的要求并且可设备读取。 |
BoundingBoxIterator | 边界框的迭代器类型。必须可以使用 cuspatial::box<T> 类型的数据写入。必须满足 LegacyRandomAccessIterator 的要求并且可设备写入。 |
T | 坐标数据值类型。 |
IndexT | 偏移量数据值类型。 |
linestring_offsets_first | 输入多边形偏移量范围的起始迭代器。 |
linestring_offsets_last | 输入多边形偏移量范围的结束迭代器。 |
linestring_vertices_first | 输入多边形顶点范围的起始迭代器。 |
linestring_vertices_last | 输入多边形顶点范围的结束迭代器。 |
bounding_boxes_first | 输出边界框范围的起始迭代器。 |
expansion_radius | 用于扩展输出边界框每个顶点(使其形成一个框)的可选半径。 |
stream | 执行计算和分配内存所用的 CUDA 流。 |
std::distance(linestring_offsets_first, linestring_offsets_last)
的数量应比线串数量多一。此函数不使用最后一个偏移量,但偏移量的数量决定了输出大小。std::unique_ptr< cudf::column > cuspatial::pairwise_point_in_polygon | ( | cudf::column_view const & | test_points_x, |
cudf::column_view const & | test_points_y, | ||
cudf::column_view const & | poly_offsets, | ||
cudf::column_view const & | poly_ring_offsets, | ||
cudf::column_view const & | poly_points_x, | ||
cudf::column_view const & | poly_points_y, | ||
rmm::device_async_resource_ref | mr = rmm::mr::get_current_device_resource() ) |
给定 (点, 多边形) 对,测试每对的点是否在该对的多边形内。
测试每个点是否在其相应索引的多边形内。多边形是包含一个或多个环(ring)的集合。环是包含三个或更多顶点的集合。
[in] | test_points_x | 要测试的点的 x 坐标 |
[in] | test_points_y | 要测试的点的 y 坐标 |
[in] | poly_offsets | 每个多边形中第一个环的起始索引 |
[in] | poly_ring_offsets | 每个环中第一个点的起始索引 |
[in] | poly_points_x | 多边形点的 x 坐标 |
[in] | poly_points_y | 多边形点的 y 坐标 |
poly_ring_offsets
必须只包含构成由 poly_offsets
索引的多边形的环。如果在 poly_ring_offsets
中存在不属于 poly_offsets
中多边形的环,结果很可能不正确,并且行为是未定义的。OutputIt cuspatial::pairwise_point_in_polygon | ( | PointRange | points, |
PolygonRange | polygons, | ||
OutputIt | results, | ||
rmm::cuda_stream_view | stream = rmm::cuda_stream_default ) |
给定 (点, 多边形) 对,测试对中的点是否在对中的多边形内。
请注意,输入必须是单一的几何列,即使用计数迭代器作为几何偏移量迭代器初始化的 (multi*)geometry_range。
每个输入点将映射到输出中的一个 uint8_t
元素。
PointRange | 模板类型 multipoint_range 的实例,其中 GeometryIterator 必须是计数迭代器。 |
PolygonRange | 模板类型 multipolygon_range 的实例,其中 GeometryIterator 必须是计数迭代器。 |
OutputIt | 输出数组的迭代器类型。必须满足 LegacyRandomAccessIterator 的要求,可设备访问,可变,并迭代 int32_t 类型。 |
points | 点范围,每对计算的点-多边形对一个点, |
polygons | 多边形范围,每对计算的点-多边形对一个多边形 |
output | 输出缓冲区的起始迭代器 |
stream | 用于启动内核的 CUDA 流。 |
BoundingBoxOutputIt cuspatial::point_bounding_boxes | ( | IdInputIt | ids_first, |
IdInputIt | ids_last, | ||
PointInputIt | points_first, | ||
BoundingBoxOutputIt | bounding_boxes_first, | ||
T | expansion_radius = T{0}, | ||
rmm::cuda_stream_view | stream = rmm::cuda_stream_default ) |
计算点序列的空间边界框。
计算每个组(具有相同 ID 的连续点)中所有点的边界框。此函数可应用于轨迹数据、多边形顶点、线串顶点或任何分组的点数据。
在合并边界框之前,可以使用可选的 expansion_radius
将每个点扩展为一个边界框。点被扩展为一个边界框,其坐标为 (point.x - expansion_radius, point.y - expansion_radius)
和 (point.x + expansion_radius, point.y + expansion_radius)
。
IdInputIt | 对象 ID 的迭代器。必须满足 LegacyRandomAccessIterator 的要求并且可设备读取。 |
PointInputIt | 点的迭代器。必须满足 LegacyRandomAccessIterator 的要求并且可设备读取。 |
BoundingBoxOutputIt | 输出边界框的迭代器。每个元素是表示轴对齐边界框角的两个点的元组。点的类型与 PointInputIt 的 value_type 相同。必须满足 LegacyRandomAccessIterator 的要求并且可设备写入。 |
ids_first | 输入对象 ID 范围的起始 |
ids_last | 输入对象 ID 范围的结束 |
points_first | 输入点 (x,y) 坐标范围的起始 |
bounding_boxes_first | 输出边界框范围的起始,每个轨迹一个 |
expansion_radius | 计算其边界框时添加到每个点的半径。 |
stream | 执行计算所用的 CUDA 流。 |
std::unique_ptr< cudf::column > cuspatial::point_in_polygon | ( | cudf::column_view const & | test_points_x, |
cudf::column_view const & | test_points_y, | ||
cudf::column_view const & | poly_offsets, | ||
cudf::column_view const & | poly_ring_offsets, | ||
cudf::column_view const & | poly_points_x, | ||
cudf::column_view const & | poly_points_y, | ||
rmm::device_async_resource_ref | mr = rmm::mr::get_current_device_resource() ) |
测试指定的点是否在任何指定的多边形内。
测试点是否在最多 31 个多边形内。多边形是包含一个或多个环的集合。环是包含三个或更多顶点的集合。
[in] | test_points_x | 要测试的点的 x 坐标 |
[in] | test_points_y | 要测试的点的 y 坐标 |
[in] | poly_offsets | 每个多边形中第一个环的起始索引 |
[in] | poly_ring_offsets | 每个环中第一个点的起始索引 |
[in] | poly_points_x | 多边形点的 x 坐标 |
[in] | poly_points_y | 多边形点的 y 坐标 |
output[3] & 0b0010
表示第 3 个点与第 2 个多边形之间的命中或未命中。poly_ring_offsets
必须只包含构成由 poly_offsets
索引的多边形的环。如果在 poly_ring_offsets
中存在不属于 poly_offsets
中多边形的环,结果很可能不正确,并且行为是未定义的。OutputIt cuspatial::point_in_polygon | ( | PointRange | points, |
PolygonRange | polygons, | ||
OutputIt | output, | ||
rmm::cuda_stream_view | stream = rmm::cuda_stream_default ) |
测试指定的点是否在任何指定的多边形内。
测试点是否在最多 31 个多边形内。多边形是包含一个或多个环的集合。环是包含三个或更多顶点的集合。
每个输入点将映射到输出中的一个 int32_t
元素。每位(符号位除外)表示针对每个输入多边形的命中或未命中,按最低有效位顺序排列。例如,output[3] & 0b0010
表示第 3 个点与第 2 个多边形之间的命中或未命中。
请注意,输入必须是单一的几何列,即使用计数迭代器作为几何偏移量迭代器初始化的 (multi*)geometry_range。
PointRange | 模板类型 multipoint_range 的实例,其中 GeometryIterator 必须是计数迭代器。 |
PolygonRange | 模板类型 multipolygon_range 的实例,其中 GeometryIterator 必须是计数迭代器。 |
OutputIt | 输出数组的迭代器类型。必须满足 LegacyRandomAccessIterator 的要求,可设备访问,可变,并迭代 int32_t 类型。 |
points | 点范围,每对计算的点-多边形对一个点, |
polygons | 多边形范围,每对计算的点-多边形对一个多边形 |
output | 输出缓冲区的起始迭代器 |
stream | 用于启动内核的 CUDA 流。 |
std::unique_ptr< cudf::table > cuspatial::polygon_bounding_boxes | ( | cudf::column_view const & | poly_offsets, |
cudf::column_view const & | ring_offsets, | ||
cudf::column_view const & | x, | ||
cudf::column_view const & | y, | ||
double | expansion_radius = 0.0, | ||
rmm::device_async_resource_ref | mr = rmm::mr::get_current_device_resource() ) |
计算列表中每个多边形的最小边界框。
poly_offsets | 每个多边形中第一个环的起始索引(即前缀和) |
ring_offsets | 每个环中第一个点的起始索引(即前缀和) |
x | 多边形点的 x 坐标 |
y | 多边形点的 y 坐标 |
expansion_radius | 计算其边界框时添加到每个点的半径。 |
x
和 y
相同:x_min - 每个边界框的最小 x 坐标;y_min - 每个边界框的最小 y 坐标;x_max - 每个边界框的最大 x 坐标;y_max - 每个边界框的最大 y 坐标poly_offsets
的大小应比要处理的多边形数量多一。ring_offsets
的大小应比总环数多一。此函数不使用每个范围中的最后一个偏移量,但多边形偏移量的数量决定了输出大小。BoundingBoxIterator cuspatial::polygon_bounding_boxes | ( | PolygonOffsetIterator | polygon_offsets_first, |
PolygonOffsetIterator | polygon_offsets_last, | ||
RingOffsetIterator | polygon_ring_offsets_first, | ||
RingOffsetIterator | polygon_ring_offsets_last, | ||
VertexIterator | polygon_vertices_first, | ||
VertexIterator | polygon_vertices_last, | ||
BoundingBoxIterator | bounding_boxes_first, | ||
T | expansion_radius = T{0}, | ||
rmm::cuda_stream_view | stream = rmm::cuda_stream_default ) |
计算每个多边形的最小边界框。
PolygonOffsetIterator | 多边形偏移量的迭代器类型。必须满足 LegacyRandomAccessIterator 的要求并且可设备读取。 |
RingOffsetIterator | 多边形环偏移量的迭代器类型。必须满足 LegacyRandomAccessIterator 的要求并且可设备读取。 |
VertexIterator | 多边形顶点的迭代器类型。必须满足 LegacyRandomAccessIterator 的要求并且可设备读取。 |
BoundingBoxIterator | 边界框的迭代器类型。必须可以使用 cuspatial::box<T> 类型的数据写入。必须满足 LegacyRandomAccessIterator 的要求并且可设备写入。 |
T | 坐标数据值类型。 |
IndexT | 偏移量数据值类型。 |
polygon_offsets_first | 输入多边形偏移量范围的起始迭代器。 |
polygon_offsets_last | 输入多边形偏移量范围的结束迭代器。 |
polygon_ring_offsets_first | 输入多边形环偏移量范围的起始迭代器。 |
polygon_ring_offsets_last | 输入多边形环偏移量范围的结束迭代器。 |
polygon_vertices_first | 输入多边形顶点范围的起始迭代器。 |
polygon_vertices_last | 输入多边形顶点范围的结束迭代器。 |
bounding_boxes_first | 输出边界框范围的起始迭代器。 |
expansion_radius | 用于扩展输出边界框每个顶点(使其形成一个框)的可选半径。 |
stream | 执行计算和分配内存所用的 CUDA 流。 |
std::distance(polygon_offsets_first, polygon_offsets_last)
的数量应比多边形数量多一。环偏移量 std::distance(polygon_ring_offsets_first, polygon_ring_offsets_last)
的数量应比总环数多一。此函数不使用每个范围中的最后一个偏移量,但多边形偏移量的数量决定了输出大小。