加载中...
搜索中...
无匹配项
distance.hpp 文件参考
#include <cuspatial/column/geometry_column_view.hpp>
#include <cuspatial/constants.hpp>
#include <cudf/column/column.hpp>
#include <cudf/column/column_view.hpp>
#include <cudf/table/table_view.hpp>
#include <cudf/utilities/span.hpp>
#include <rmm/mr/device/per_device_resource.hpp>
#include <rmm/resource_ref.hpp>
#include <optional>

转到此文件的源代码。

函数

std::unique_ptr< cudf::column > cuspatial::haversine_distance (cudf::column_view const &a_lon, cudf::column_view const &a_lat, cudf::column_view const &b_lon, cudf::column_view const &b_lat, double const radius=EARTH_RADIUS_KM, rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource())
 计算集合 A 中的点与集合 B 中对应点之间的 Haversine 距离。
 
std::pair< std::unique_ptr< cudf::column >, cudf::table_view > cuspatial::directed_hausdorff_distance (cudf::column_view const &xs, cudf::column_view const &ys, cudf::column_view const &space_offsets, rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource())
 计算空间集合中所有点对的 Hausdorff 距离
 
std::unique_ptr< cudf::column > cuspatial::pairwise_point_distance (geometry_column_view const &multipoints1, geometry_column_view const &multipoints2, rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource())
 计算成对的(多)点到(多)点之间的笛卡尔距离。
 
std::unique_ptr< cudf::column > cuspatial::pairwise_point_linestring_distance (geometry_column_view const &multipoints, geometry_column_view const &multilinestrings, rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource())
 计算成对的(多)点到(多)线串之间的笛卡尔距离。
 
std::unique_ptr< cudf::column > cuspatial::pairwise_point_polygon_distance (geometry_column_view const &multipoints, geometry_column_view const &multipolygons, rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource())
 计算成对的(多)点到(多)多边形之间的笛卡尔距离。
 
std::unique_ptr< cudf::column > cuspatial::pairwise_linestring_distance (geometry_column_view const &multilinestrings1, geometry_column_view const &multilinestrings2, rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource())
 计算成对的(多)线串到(多)线串之间的笛卡尔距离。
 
std::unique_ptr< cudf::column > cuspatial::pairwise_linestring_polygon_distance (geometry_column_view const &multilinestrings, geometry_column_view const &multipolygons, rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource())
 计算成对的(多)线串到(多)多边形之间的笛卡尔距离。
 
std::unique_ptr< cudf::column > cuspatial::pairwise_polygon_distance (geometry_column_view const &multipolygons1, geometry_column_view const &multipolygons2, rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource())
 计算成对的(多)多边形到(多)多边形之间的笛卡尔距离。
 

函数文档

◆ directed_hausdorff_distance()

std::pair< std::unique_ptr< cudf::column >, cudf::table_view > cuspatial::directed_hausdorff_distance ( cudf::column_view const & xs,
cudf::column_view const & ys,
cudf::column_view const & space_offsets,
rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource() )

计算空间集合中所有点对的 Hausdorff 距离

https://en.wikipedia.org/wiki/Hausdorff_distance

一维示例(此函数在二维中操作)

空间
[0 2 5] [9] [3 7]
表示为每个空间的点以及所有点的连接
[0 2 5 9 3 7] [3 1 2]
注意:以下矩阵在视觉上是分开的,以突出显示一对
点与产生它的空间对之间的关系
所有点的笛卡尔积
按空间对划分的点,以及点之间的距离
+----------+----+-------+ +---------+---+------+
: 00 02 05 : 09 : 03 07 : : 0 2 5 : 9 : 3 7 :
: 20 22 25 : 29 : 23 27 : : 2 0 3 : 7 : 1 5 :
: 50 52 55 : 59 : 53 57 : : 5 3 0 : 4 : 2 2 :
+----------+----+-------+ +---------+---+------+
: 90 92 95 : 99 : 93 97 : : 9 7 4 : 0 : 6 2 :
+----------+----+-------+ +---------+---+------+
: 30 32 35 : 39 : 33 37 : : 3 1 2 : 6 : 0 4 :
: 70 72 75 : 79 : 73 77 : : 7 5 2 : 2 : 4 0 :
+----------+----+-------+ +---------+---+------+
最小距离,来自
一个空间中的每个点到另一个空间中任何点的距离
空间到另一个空间中任何点的距离
最小距离的最大值
+----------+----+-------+ +---------+---+------+
: 0 : 9 : 3 : : 0 : 9 : 3 :
: 0 : 7 : 1 : : : : :
: 0 : 4 : 2 : : : : :
+----------+----+-------+ +---------+---+------+
: 4 : 0 : 2 : : 4 : 0 : 2 :
+----------+----+-------+ +---------+---+------+
: 1 : 6 : 0 : : : 6 : 0 :
: 2 : 2 : 0 : : 2 : : :
+----------+----+-------+ +---------+---+------+
返回
列: [0 4 2 9 0 6 3 2 0]
table_view: [0 4 2] [9 0 6] [3 2 0]
参数
[in]xs点的 x 分量
[in]ys点的 y 分量
[in]space_offsets每个空间的起始索引,加上最后一个空间的结束偏移量。
返回
Hausdorff 距离结果的拥有对象。包含每个输入空间的分割视图的 table_view。
异常
cudf::cuda_error如果 xsys 长度不同
cudf::cuda_error如果 xsys 类型不同
cudf::cuda_error如果 space_offsets 大小小于 xsxy
cudf::cuda_error如果 xsysspace_offsets 包含 null
注意
Hausdorff 距离是非对称的

◆ haversine_distance()

std::unique_ptr< cudf::column > cuspatial::haversine_distance ( cudf::column_view const & a_lon,
cudf::column_view const & a_lat,
cudf::column_view const & b_lon,
cudf::column_view const & b_lat,
double const radius = EARTH_RADIUS_KM,
rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource() )

计算集合 A 中的点与集合 B 中对应点之间的 Haversine 距离。

https://en.wikipedia.org/wiki/Haversine_formula

参数
[in]a_lon集合 A 中点的经度
[in]a_lat集合 A 中点的纬度
[in]b_lon集合 B 中点的经度
[in]b_lat集合 B 中点的纬度
[in]半径点所在的球体半径。默认值:6371.0(近似地球半径,单位公里)
返回
所有 (a_lon[i], a_lat[i]) 和 (b_lon[i], b_lat[i]) 点对的距离数组

◆ pairwise_linestring_distance()

std::unique_ptr< cudf::column > cuspatial::pairwise_linestring_distance ( geometry_column_view const & multilinestrings1,
geometry_column_view const & multilinestrings2,
rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource() )

计算成对的(多)线串到(多)线串之间的笛卡尔距离。

一对多线串之间的距离是两个多线串中任意一对线段之间的最短笛卡尔距离。如果任意线段相交,则距离为 0。

参数
multilinestrings1用于计算距离的多线串的第一列
multilinestrings2用于计算距离的多线串的第二列
mr用于分配返回列的设备内存的设备内存资源
返回
包含每对输入(多)线串之间距离的列
异常
cuspatial::logic_error如果 multilinestrings1multilinestrings2 大小不同
cuspatial::logic_error如果 multilinestrings1multilinestrings2 不是线串列。
cuspatial::logic_error如果 multilinestrings1multilinestrings2 坐标类型不同

◆ pairwise_linestring_polygon_distance()

std::unique_ptr< cudf::column > cuspatial::pairwise_linestring_polygon_distance ( geometry_column_view const & multilinestrings,
geometry_column_view const & multipolygons,
rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource() )

计算成对的(多)线串到(多)多边形之间的笛卡尔距离。

一对(多)线串与(多)多边形之间的距离是多线串中任意线段与多边形中任意边之间的最短笛卡尔距离。如果任意线段相交,或者如果任意线串包含在任意多边形中,则距离为 0。

参数
multilinestrings多线串的几何列
multipolygons多多边形的几何列
mr用于分配返回列的设备内存资源。
返回
包含每对输入几何体之间距离的列,类型与输入坐标类型相同。
异常
cuspatial::logic_error如果 multilinestringsmultipolygons 大小不同
cuspatial::logic_error如果 multilinestrings 不是线串列或 multipolygons 不是多边形列。
cuspatial::logic_error如果 multilinestringsmultipolygons 的坐标类型不同。

◆ pairwise_point_distance()

std::unique_ptr< cudf::column > cuspatial::pairwise_point_distance ( geometry_column_view const & multipoints1,
geometry_column_view const & multipoints2,
rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource() )

计算成对的(多)点到(多)点之间的笛卡尔距离。

一对多点之间的距离是两个多点中任意一对点之间的最短笛卡尔距离。

参数
points1用于计算距离的(多)点的第一列
points2用于计算距离的(多)点的第二列
返回
包含每对输入点之间距离的列
异常
cuspatial::logic_error如果 multipoints1multipoints2 大小不同
cuspatial::logic_error如果 multipoints1multipoints2 不是多点列
cuspatial::logic_error如果 multipoints1multipoints2 坐标类型不同

◆ pairwise_point_linestring_distance()

std::unique_ptr< cudf::column > cuspatial::pairwise_point_linestring_distance ( geometry_column_view const & multipoints,
geometry_column_view const & multilinestrings,
rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource() )

计算成对的(多)点到(多)线串之间的笛卡尔距离。

点与线串之间的距离定义为点与线串任意线段之间的最小笛卡尔距离。

参数
multipoints用于计算距离的多点列
multilinestrings用于计算距离的多线串列
mr用于分配返回列的设备内存资源。
返回
包含每对输入(多)点和(多)线串之间距离的列
异常
cuspatial::logic_error如果 multipointsmultilinestrings 大小不同
cuspatial::logic_error如果 multipoints 不是多点列或 multilinestrings 不是多线串列
cuspatial::logic_error如果 multipointsmultilinestrings 坐标类型不同

◆ pairwise_point_polygon_distance()

std::unique_ptr< cudf::column > cuspatial::pairwise_point_polygon_distance ( geometry_column_view const & multipoints,
geometry_column_view const & multipolygons,
rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource() )

计算成对的(多)点到(多)多边形之间的笛卡尔距离。

点与多边形之间的距离定义为点与多边形任意线段之间的最小笛卡尔距离。如果多点中的任一点包含在多边形中,则距离为 0。

参数
multipoints多点的几何列
multipolygons多多边形的几何列
mr用于分配返回列的设备内存资源。
返回
包含每对输入(多)点和(多)多边形之间距离的列
异常
cuspatial::logic_error如果 multipointsmultipolygons 大小不同
cuspatial::logic_error如果 multipoints 不是点列且 multipolygons 不是多边形列。
cuspatial::logic_error如果 multipointsmultipolygons 坐标类型不同

◆ pairwise_polygon_distance()

std::unique_ptr< cudf::column > cuspatial::pairwise_polygon_distance ( geometry_column_view const & multipolygons1,
geometry_column_view const & multipolygons2,
rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource() )

计算成对的(多)多边形到(多)多边形之间的笛卡尔距离。

一对(多)多边形与(多)多边形之间的距离是多多边形中任意一对边之间的最短笛卡尔距离。如果任意边相交,或者如果任意多边形包含在任何其他多边形中,则距离为 0。

参数
multipolygons1用于计算距离的多多边形的几何列(来源)
multipolygons2用于计算距离的多多边形的几何列(目标)
mr用于分配返回列的设备内存资源。
返回
包含每对输入几何体之间距离的列,类型与输入坐标类型相同。