libcuspatial  24.02.00
Loading...
Searching...
No Matches
distance.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020-2023, 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
29#include <optional>
30
31namespace cuspatial {
32
51std::unique_ptr<cudf::column> haversine_distance(
52 cudf::column_view const& a_lon,
53 cudf::column_view const& a_lat,
54 cudf::column_view const& b_lon,
55 cudf::column_view const& b_lat,
56 double const radius = EARTH_RADIUS_KM,
57 rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
58
123std::pair<std::unique_ptr<cudf::column>, cudf::table_view> directed_hausdorff_distance(
124 cudf::column_view const& xs,
125 cudf::column_view const& ys,
126 cudf::column_view const& space_offsets,
127 rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
128
144std::unique_ptr<cudf::column> pairwise_point_distance(
145 geometry_column_view const& multipoints1,
146 geometry_column_view const& multipoints2,
147 rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
148
166std::unique_ptr<cudf::column> pairwise_point_linestring_distance(
167 geometry_column_view const& multipoints,
168 geometry_column_view const& multilinestrings,
169 rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
170
190std::unique_ptr<cudf::column> pairwise_point_polygon_distance(
191 geometry_column_view const& multipoints,
192 geometry_column_view const& multipolygons,
193 rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
194
212std::unique_ptr<cudf::column> pairwise_linestring_distance(
213 geometry_column_view const& multilinestrings1,
214 geometry_column_view const& multilinestrings2,
215 rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
216
237std::unique_ptr<cudf::column> pairwise_linestring_polygon_distance(
238 geometry_column_view const& multilinestrings,
239 geometry_column_view const& multipolygons,
240 rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
241
256std::unique_ptr<cudf::column> pairwise_polygon_distance(
257 geometry_column_view const& multipolygons1,
258 geometry_column_view const& multipolygons2,
259 rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
260
265} // 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.