Loading...
Searching...
No Matches
distance.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020-2024, NVIDIA CORPORATION.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
21
22#include <cudf/column/column.hpp>
23#include <cudf/column/column_view.hpp>
24#include <cudf/table/table_view.hpp>
25#include <cudf/utilities/span.hpp>
26
27#include <rmm/mr/device/per_device_resource.hpp>
28#include <rmm/resource_ref.hpp>
29
30#include <optional>
31
32namespace cuspatial {
33
52std::unique_ptr<cudf::column> haversine_distance(
53 cudf::column_view const& a_lon,
54 cudf::column_view const& a_lat,
55 cudf::column_view const& b_lon,
56 cudf::column_view const& b_lat,
57 double const radius = EARTH_RADIUS_KM,
58 rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());
59
124std::pair<std::unique_ptr<cudf::column>, cudf::table_view> directed_hausdorff_distance(
125 cudf::column_view const& xs,
126 cudf::column_view const& ys,
127 cudf::column_view const& space_offsets,
128 rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());
129
145std::unique_ptr<cudf::column> pairwise_point_distance(
146 geometry_column_view const& multipoints1,
147 geometry_column_view const& multipoints2,
148 rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());
149
167std::unique_ptr<cudf::column> pairwise_point_linestring_distance(
168 geometry_column_view const& multipoints,
169 geometry_column_view const& multilinestrings,
170 rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());
171
191std::unique_ptr<cudf::column> pairwise_point_polygon_distance(
192 geometry_column_view const& multipoints,
193 geometry_column_view const& multipolygons,
194 rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());
195
213std::unique_ptr<cudf::column> pairwise_linestring_distance(
214 geometry_column_view const& multilinestrings1,
215 geometry_column_view const& multilinestrings2,
216 rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());
217
238std::unique_ptr<cudf::column> pairwise_linestring_polygon_distance(
239 geometry_column_view const& multilinestrings,
240 geometry_column_view const& multipolygons,
241 rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());
242
257std::unique_ptr<cudf::column> pairwise_polygon_distance(
258 geometry_column_view const& multipolygons1,
259 geometry_column_view const& multipolygons2,
260 rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());
261
266} // namespace cuspatial
A non-owning, immutable view of a geometry column.
OutputIt directed_hausdorff_distance(PointIt points_first, PointIt points_last, OffsetIt space_offsets_first, OffsetIt space_offsets_last, OutputIt distance_first, rmm::cuda_stream_view stream=rmm::cuda_stream_default)
Computes Hausdorff distances for all pairs in a collection of spaces.
OutputIt pairwise_point_distance(MultiPointArrayViewA multipoints1, MultiPointArrayViewB multipoints2, OutputIt distances_first, rmm::cuda_stream_view stream=rmm::cuda_stream_default)
Compute pairwise (multi)point-to-(multi)point Cartesian distance.
OutputIt pairwise_polygon_distance(MultipolygonRangeA lhs, MultipolygonRangeB rhs, OutputIt distances_first, rmm::cuda_stream_view stream=rmm::cuda_stream_default)
Computes pairwise multipolygon to multipolygon distance.
OutputIt haversine_distance(LonLatItA a_lonlat_first, LonLatItA a_lonlat_last, LonLatItB b_lonlat_first, OutputIt distance_first, T const radius=EARTH_RADIUS_KM, rmm::cuda_stream_view stream=rmm::cuda_stream_default)
Compute haversine distances between points in set A to the corresponding points in set B.
OutputIt pairwise_linestring_distance(MultiLinestringRange1 multilinestrings1, MultiLinestringRange2 multilinestrings2, OutputIt distances_first, rmm::cuda_stream_view stream=rmm::cuda_stream_default)
OutputIt pairwise_linestring_polygon_distance(MultiLinestringRange multilinestrings, MultiPolygonRange multipoiygons, OutputIt distances_first, rmm::cuda_stream_view stream=rmm::cuda_stream_default)
Computes pairwise multilinestring to multipolygon distance.
OutputIt pairwise_point_linestring_distance(MultiPointRange multipoints, MultiLinestringRange multilinestrings, OutputIt distances_first, rmm::cuda_stream_view stream=rmm::cuda_stream_default)
Compute pairwise multipoint to multilinestring distance.
OutputIt pairwise_point_polygon_distance(MultiPointRange multipoints, MultiPolygonRange multipoiygons, OutputIt distances_first, rmm::cuda_stream_view stream=rmm::cuda_stream_default)
Computes pairwise multipoint to multipolygon distance.