libcuspatial
24.04.00
|
Distance computation APIs. More...
Files | |
file | distance.hpp |
file | distance.cuh |
Functions | |
template<class LonLatItA , class LonLatItB , class OutputIt , class T = typename cuspatial::iterator_vec_base_type<LonLatItA>> | |
OutputIt | cuspatial::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. | |
template<class PointIt , class OffsetIt , class OutputIt > | |
OutputIt | cuspatial::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. | |
template<class MultiPointArrayViewA , class MultiPointArrayViewB , class OutputIt > | |
OutputIt | cuspatial::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. | |
template<class MultiPointRange , class MultiLinestringRange , class OutputIt > | |
OutputIt | cuspatial::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. | |
template<class MultiPointRange , class MultiPolygonRange , class OutputIt > | |
OutputIt | cuspatial::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. | |
template<class MultiLinestringRange1 , class MultiLinestringRange2 , class OutputIt > | |
OutputIt | cuspatial::pairwise_linestring_distance (MultiLinestringRange1 multilinestrings1, MultiLinestringRange2 multilinestrings2, OutputIt distances_first, rmm::cuda_stream_view stream=rmm::cuda_stream_default) |
template<class MultiLinestringRange , class MultiPolygonRange , class OutputIt > | |
OutputIt | cuspatial::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. | |
template<class MultipolygonRangeA , class MultipolygonRangeB , class OutputIt > | |
OutputIt | cuspatial::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. | |
Distance computation APIs.
OutputIt cuspatial::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.
https://en.wikipedia.org/wiki/Hausdorff_distance
Example in 1D (this function operates in 2D):
[in] | points_first | xs: beginning of range of (x,y) points |
[in] | points_lasts | xs: end of range of (x,y) points |
[in] | space_offsets_first | beginning of range of indices to each space. |
[in] | space_offsets_first | end of range of indices to each space. Last index is the last |
[in] | distance_first | beginning of range of output Hausdorff distance for each pair of spaces |
PointIt | Iterator to input points. Points must be of a type that is convertible to cuspatial::vec_2d<T> . Must meet the requirements of [LegacyRandomAccessIterator][LinkLRAI] and be device-accessible. |
OffsetIt | Iterator to space offsets. Value type must be integral. Must meet the requirements of [LegacyRandomAccessIterator][LinkLRAI] and be device-accessible. |
OutputIt | Output iterator. Must meet the requirements of [LegacyRandomAccessIterator][LinkLRAI] and be device-accessible and mutable. |
OutputIt cuspatial::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.
Computes N haversine distances, where N is std::distance(a_lonlat_first, a_lonlat_last)
. The distance for each a_lonlat[i]
and b_lonlat[i]
point pair is assigned to distance_first[i]
. distance_first
must be an iterator to output storage allocated for N distances.
Computed distances will have the same units as radius
.
https://en.wikipedia.org/wiki/Haversine_formula
[in] | a_lonlat_first | beginning of range of (longitude, latitude) locations in set A |
[in] | a_lonlat_last | end of range of (longitude, latitude) locations in set A |
[in] | b_lonlat_first | beginning of range of (longitude, latitude) locations in set B |
[out] | distance_first | beginning of output range of haversine distances |
[in] | radius | radius of the sphere on which the points reside. default: 6371.0 (approximate radius of Earth in km) |
[in] | stream | The CUDA stream on which to perform computations and allocate memory. |
LonLatItA | Iterator to input location set A. Must meet the requirements of LegacyRandomAccessIterator and be device-accessible. |
LonLatItB | Iterator to input location set B. Must meet the requirements of LegacyRandomAccessIterator and be device-accessible. |
OutputIt | Output iterator. Must meet the requirements of LegacyRandomAccessIterator and be device-accessible and mutable. |
T | The underlying coordinate type. Must be a floating-point type. |
Location
type, with the same underlying floating-point coordinate type (e.g. cuspatial::vec_2d<float>
).OutputIt cuspatial::pairwise_linestring_distance | ( | MultiLinestringRange1 | multilinestrings1, |
MultiLinestringRange2 | multilinestrings2, | ||
OutputIt | distances_first, | ||
rmm::cuda_stream_view | stream = rmm::cuda_stream_default ) |
The shortest distance between two linestrings is defined as the shortest distance between all pairs of segments of the two linestrings. If any of the segments intersect, the distance is 0.
MultiLinestringRange | an instance of template type multilinestring_range |
OutputIt | iterator type for output array. Must meet the requirements of [LRAI](LinkLRAI) and be device writable. |
multilinestrings1 | Range object of the lhs multilinestring array |
multilinestrings2 | Range object of the rhs multilinestring array |
stream | The CUDA stream to use for device memory operations and kernel launches. |
OutputIt cuspatial::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.
MultiLinestringRange | An instance of template type multipoint_range |
MultiPolygonRange | An instance of template type multipolygon_range |
OutputIt | iterator type for output array. Must meet the requirements of [LRAI](LinkLRAI). Must be an iterator to type convertible from floating points. |
multilinestrings | Range of multilinestrings, one per computed distance pair. |
multipolygons | Range of multipolygons, one per computed distance pair. |
stream | The CUDA stream on which to perform computations |
OutputIt cuspatial::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.
Computes the cartesian distance between each pair of multipoints.
MultiPointArrayViewA | An instance of template type array_view::multipoint_array |
MultiPointArrayViewB | An instance of template type array_view::multipoint_array |
multipoints1 | Range of first multipoint in each distance pair. |
multipoints2 | Range of second multipoint in each distance pair. |
OutputIt cuspatial::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.
MultiPointRange | an instance of template type multipoint_range |
MultiLinestringRange | an instance of template type multilinestring_range |
OutputIt | iterator type for output array. Must meet the requirements of [LRAI](LinkLRAI). |
multipoints | The range of multipoints, one per computed distance pair |
multilinestrings | The range of multilinestrings, one per computed distance pair |
stream | The CUDA stream to use for device memory operations and kernel launches. |
OutputIt cuspatial::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.
MultiPointRange | An instance of template type multipoint_range |
MultiPolygonRange | An instance of template type multipolygon_range |
OutputIt | iterator type for output array. Must meet the requirements of [LRAI](LinkLRAI). Must be an iterator to type convertible from floating points. |
multipoints | Range of multipoints, one per computed distance pair. |
multipolygons | Range of multilinestrings, one per computed distance pair. |
stream | The CUDA stream on which to perform computations |
OutputIt cuspatial::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.
MultiPolygonRangeA | An instance of template type multipolygon_range |
MultiPolygonRangeB | An instance of template type multipolygon_range |
OutputIt | iterator type for output array. Must meet the requirements of [LRAI](LinkLRAI). Must be an iterator to type convertible from floating points. |
lhs | The first multipolygon range to compute distance from |
rhs | The second multipolygon range to compute distance to |
stream | The CUDA stream on which to perform computations |