加载中...
搜索中...
无匹配项
空间关系

与空间关系相关的 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。

函数文档

◆ linestring_bounding_boxes() [1/2]

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扩展半径
返回值
一个包含边界框的 cudf 表,包含四个列,类型与 xy 相同:x_min - 每个边界框的最小 x 坐标;y_min - 每个边界框的最小 y 坐标;x_max - 每个边界框的最大 x 坐标;y_max - 每个边界框的最大 y 坐标
前置条件
为了与 GeoArrow 兼容,linestring_offsets 的大小应比要处理的线串数量多一。此函数不使用最后一个偏移量,但偏移量的数量决定了输出大小。

◆ linestring_bounding_boxes() [2/2]

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 )

计算每个线串的最小边界框。

模板参数
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 流。
返回值
输出边界框范围末尾的迭代器。
前置条件
为了与 GeoArrow 兼容,线串偏移量 std::distance(linestring_offsets_first, linestring_offsets_last) 的数量应比线串数量多一。此函数不使用最后一个偏移量,但偏移量的数量决定了输出大小。

◆ pairwise_point_in_polygon() [1/2]

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 坐标
返回值
每个点/多边形对的布尔值列。
注意
环的方向无关紧要。
支持开放或封闭的多边形格式。
此算法支持 ESRI shapefile 格式,但假定所有多边形都是“干净的”(按格式定义),并且验证输入是否符合 shapefile 格式。
重叠的环会相互抵消。这种行为不限于一次抵消,允许在同一多边形内存在“岛”。
poly_ring_offsets 必须只包含构成由 poly_offsets 索引的多边形的环。如果在 poly_ring_offsets 中存在不属于 poly_offsets 中多边形的环,结果很可能不正确,并且行为是未定义的。
带两个环的多边形 带四个环的多边形
+-----------+ +------------------------+
:███████████: :████████████████████████
:███████████: :██+------------------+██
:██████+----:------+ :██: +----+ +----+ :██
:██████: :██████: :██: :████: :████: :██
+------;----+██████: :██: :----: :----: :██
:███████████: :██+------------------+██
:███████████: :████████████████████████
+-----------+ +------------------------+

◆ pairwise_point_in_polygon() [2/2]

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 )

给定 (点, 多边形) 对,测试对中的点是否在对中的多边形内。

请注意,输入必须是单一的几何列,即使用计数迭代器作为几何偏移量迭代器初始化的 (multi*)geometry_range。

每个输入点将映射到输出中的一个 uint8_t 元素。

模板参数
PointRange模板类型 multipoint_range 的实例,其中 GeometryIterator 必须是计数迭代器。
PolygonRange模板类型 multipolygon_range 的实例,其中 GeometryIterator 必须是计数迭代器。
OutputIt输出数组的迭代器类型。必须满足 LegacyRandomAccessIterator 的要求,可设备访问,可变,并迭代 int32_t 类型。
参数
points点范围,每对计算的点-多边形对一个点,
polygons多边形范围,每对计算的点-多边形对一个多边形
output输出缓冲区的起始迭代器
stream用于启动内核的 CUDA 流。
返回值
输出缓冲区中最后一个元素的后一个位置的迭代器
注意
环的方向无关紧要。
环的点必须显式闭合。
重叠的环会相互抵消。这种行为不限于一次抵消,允许在同一多边形内存在“岛”。
带两个环的多边形 带四个环的多边形
+-----------+ +------------------------+
:███████████: :████████████████████████
:███████████: :██+------------------+██
:██████+----:------+ :██: +----+ +----+ :██
:██████: :██████: :██: :████: :████: :██
+------;----+██████: :██: :----: :----: :██
:███████████: :██+------------------+██
:███████████: :████████████████████████
+-----------+ +------------------------+
前置条件
输出迭代器必须是可变的,并且迭代 uint8_t 类型。

◆ point_bounding_boxes()

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 )

计算点序列的空间边界框。

计算每个组(具有相同 ID 的连续点)中所有点的边界框。此函数可应用于轨迹数据、多边形顶点、线串顶点或任何分组的点数据。

在合并边界框之前,可以使用可选的 expansion_radius 将每个点扩展为一个边界框。点被扩展为一个边界框,其坐标为 (point.x - expansion_radius, point.y - expansion_radius)(point.x + expansion_radius, point.y + expansion_radius)

注意
假定对象 ID 和点已按 ID 预排序。
模板参数
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 流。
返回值
输出边界框范围末尾的迭代器。

◆ point_in_polygon() [1/2]

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 坐标
返回值
一个 INT32 列,每个输入点包含一个元素。每位(符号位除外)表示针对每个输入多边形的命中或未命中,按最低有效位顺序排列。例如,output[3] & 0b0010 表示第 3 个点与第 2 个多边形之间的命中或未命中。
注意
每次调用最多限制 31 个多边形。多边形可以包含多个环。
环的方向无关紧要。
此算法支持 ESRI shapefile 格式,但假定所有多边形都是“干净的”(按格式定义),并且验证输入是否符合 shapefile 格式。
重叠的环会相互抵消。这种行为不限于一次抵消,允许在同一多边形内存在“岛”。
poly_ring_offsets 必须只包含构成由 poly_offsets 索引的多边形的环。如果在 poly_ring_offsets 中存在不属于 poly_offsets 中多边形的环,结果很可能不正确,并且行为是未定义的。
带两个环的多边形 带四个环的多边形
+-----------+ +------------------------+
:███████████: :████████████████████████
:███████████: :██+------------------+██
:██████+----:------+ :██: +----+ +----+ :██
:██████: :██████: :██: :████: :████: :██
+------;----+██████: :██: :----: :----: :██
:███████████: :██+------------------+██
:███████████: :████████████████████████
+-----------+ +------------------------+

◆ point_in_polygon() [2/2]

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 )

测试指定的点是否在任何指定的多边形内。

测试点是否在最多 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 流。
返回值
输出缓冲区中最后一个元素的后一个位置的迭代器
注意
环的方向无关紧要。
环的点必须显式闭合。
重叠的环会相互抵消。这种行为不限于一次抵消,允许在同一多边形内存在“岛”。
带两个环的多边形 带四个环的多边形
+-----------+ +------------------------+
:███████████: :████████████████████████
:███████████: :██+------------------+██
:██████+----:------+ :██: +----+ +----+ :██
:██████: :██████: :██: :████: :████: :██
+------;----+██████: :██: :----: :----: :██
:███████████: :██+------------------+██
:███████████: :████████████████████████
+-----------+ +------------------------+
前置条件
输出迭代器必须是可变的,并且迭代 int32_t 类型。

◆ polygon_bounding_boxes() [1/2]

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计算其边界框时添加到每个点的半径。
返回值
一个包含边界框的 cudf 表,包含四个列,类型与 xy 相同:x_min - 每个边界框的最小 x 坐标;y_min - 每个边界框的最小 y 坐标;x_max - 每个边界框的最大 x 坐标;y_max - 每个边界框的最大 y 坐标
前置条件
为了与 GeoArrow 兼容,poly_offsets 的大小应比要处理的多边形数量多一。ring_offsets 的大小应比总环数多一。此函数不使用每个范围中的最后一个偏移量,但多边形偏移量的数量决定了输出大小。

◆ polygon_bounding_boxes() [2/2]

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 )

计算每个多边形的最小边界框。

模板参数
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 流。
返回值
输出边界框范围末尾的迭代器。
前置条件
为了与 GeoArrow 兼容,多边形偏移量 std::distance(polygon_offsets_first, polygon_offsets_last) 的数量应比多边形数量多一。环偏移量 std::distance(polygon_ring_offsets_first, polygon_ring_offsets_last) 的数量应比总环数多一。此函数不使用每个范围中的最后一个偏移量,但多边形偏移量的数量决定了输出大小。