Loading...
Searching...
No Matches
distance.cuh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022-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
20#include <cuspatial/traits.hpp>
21
22#include <rmm/cuda_stream_view.hpp>
23
24#include <iterator>
25
26namespace cuspatial {
27
69template <class LonLatItA,
70 class LonLatItB,
71 class OutputIt,
72 class T = typename cuspatial::iterator_vec_base_type<LonLatItA>>
73OutputIt haversine_distance(LonLatItA a_lonlat_first,
74 LonLatItA a_lonlat_last,
75 LonLatItB b_lonlat_first,
76 OutputIt distance_first,
77 T const radius = EARTH_RADIUS_KM,
78 rmm::cuda_stream_view stream = rmm::cuda_stream_default);
79
149template <class PointIt, class OffsetIt, class OutputIt>
150OutputIt directed_hausdorff_distance(PointIt points_first,
151 PointIt points_last,
152 OffsetIt space_offsets_first,
153 OffsetIt space_offsets_last,
154 OutputIt distance_first,
155 rmm::cuda_stream_view stream = rmm::cuda_stream_default);
156
169template <class MultiPointArrayViewA, class MultiPointArrayViewB, class OutputIt>
170OutputIt pairwise_point_distance(MultiPointArrayViewA multipoints1,
171 MultiPointArrayViewB multipoints2,
172 OutputIt distances_first,
173 rmm::cuda_stream_view stream = rmm::cuda_stream_default);
174
190template <class MultiPointRange, class MultiLinestringRange, class OutputIt>
192 MultiPointRange multipoints,
193 MultiLinestringRange multilinestrings,
194 OutputIt distances_first,
195 rmm::cuda_stream_view stream = rmm::cuda_stream_default);
196
213template <class MultiPointRange, class MultiPolygonRange, class OutputIt>
214OutputIt pairwise_point_polygon_distance(MultiPointRange multipoints,
215 MultiPolygonRange multipoiygons,
216 OutputIt distances_first,
217 rmm::cuda_stream_view stream = rmm::cuda_stream_default);
218
238template <class MultiLinestringRange1, class MultiLinestringRange2, class OutputIt>
239OutputIt pairwise_linestring_distance(MultiLinestringRange1 multilinestrings1,
240 MultiLinestringRange2 multilinestrings2,
241 OutputIt distances_first,
242 rmm::cuda_stream_view stream = rmm::cuda_stream_default);
243
260template <class MultiLinestringRange, class MultiPolygonRange, class OutputIt>
262 MultiLinestringRange multilinestrings,
263 MultiPolygonRange multipoiygons,
264 OutputIt distances_first,
265 rmm::cuda_stream_view stream = rmm::cuda_stream_default);
266
283template <class MultipolygonRangeA, class MultipolygonRangeB, class OutputIt>
284OutputIt pairwise_polygon_distance(MultipolygonRangeA lhs,
285 MultipolygonRangeB rhs,
286 OutputIt distances_first,
287 rmm::cuda_stream_view stream = rmm::cuda_stream_default);
288
293} // namespace cuspatial
294
295#include <cuspatial/detail/distance/hausdorff.cuh>
296#include <cuspatial/detail/distance/haversine.cuh>
297#include <cuspatial/detail/distance/linestring_distance.cuh>
298#include <cuspatial/detail/distance/linestring_polygon_distance.cuh>
299#include <cuspatial/detail/distance/point_distance.cuh>
300#include <cuspatial/detail/distance/point_linestring_distance.cuh>
301#include <cuspatial/detail/distance/point_polygon_distance.cuh>
302#include <cuspatial/detail/distance/polygon_distance.cuh>
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.