libcuspatial  24.04.00
Loading...
Searching...
No Matches
spatial_join.cuh
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
19#include <cuspatial/detail/join/intersection.cuh>
20#include <cuspatial/detail/join/traversal.cuh>
21#include <cuspatial/iterator_factory.cuh>
22#include <cuspatial/point_quadtree.cuh>
23#include <cuspatial/traits.hpp>
24
25#include <rmm/device_uvector.hpp>
26
27#include <iterator>
28#include <utility>
29
30namespace cuspatial {
31
62template <class BoundingBoxIterator,
63 class T = typename cuspatial::iterator_vec_base_type<BoundingBoxIterator>>
64std::pair<rmm::device_uvector<uint32_t>, rmm::device_uvector<uint32_t>>
66 point_quadtree_ref quadtree,
67 BoundingBoxIterator bounding_boxes_first,
68 BoundingBoxIterator bounding_boxes_last,
69 vec_2d<T> const& v_min,
70 T scale,
71 int8_t max_depth,
72 rmm::cuda_stream_view stream = rmm::cuda_stream_default,
73 rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
74
115template <class PolyIndexIterator,
116 class QuadIndexIterator,
117 class PointIndexIterator,
118 class PointIterator,
119 class MultiPolygonRange,
120 class IndexType = iterator_value_type<PointIndexIterator>>
121std::pair<rmm::device_uvector<IndexType>, rmm::device_uvector<IndexType>> quadtree_point_in_polygon(
122 PolyIndexIterator poly_indices_first,
123 PolyIndexIterator poly_indices_last,
124 QuadIndexIterator quad_indices_first,
125 point_quadtree_ref quadtree,
126 PointIndexIterator point_indices_first,
127 PointIndexIterator point_indices_last,
128 PointIterator points_first,
129 MultiPolygonRange polygons,
130 rmm::cuda_stream_view stream = rmm::cuda_stream_default,
131 rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
132
170template <class LinestringIndexIterator,
171 class QuadIndexIterator,
172 class PointIndexIterator,
173 class PointIterator,
174 class MultiLinestringRange,
175 typename IndexType = iterator_value_type<PointIndexIterator>,
176 typename T = iterator_vec_base_type<PointIterator>>
177std::tuple<rmm::device_uvector<IndexType>, rmm::device_uvector<IndexType>, rmm::device_uvector<T>>
179 LinestringIndexIterator linestring_indices_first,
180 LinestringIndexIterator linestring_indices_last,
181 QuadIndexIterator quad_indices_first,
182 point_quadtree_ref quadtree,
183 PointIndexIterator point_indices_first,
184 PointIndexIterator point_indices_last,
185 PointIterator points_first,
186 MultiLinestringRange linestrings,
187 rmm::cuda_stream_view stream = rmm::cuda_stream_default,
188 rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
189
190} // namespace cuspatial
191
192#include <cuspatial/detail/join/quadtree_bbox_filtering.cuh>
193#include <cuspatial/detail/join/quadtree_point_in_polygon.cuh>
194#include <cuspatial/detail/join/quadtree_point_to_nearest_linestring.cuh>
std::tuple< rmm::device_uvector< IndexType >, rmm::device_uvector< IndexType >, rmm::device_uvector< T > > quadtree_point_to_nearest_linestring(LinestringIndexIterator linestring_indices_first, LinestringIndexIterator linestring_indices_last, QuadIndexIterator quad_indices_first, point_quadtree_ref quadtree, PointIndexIterator point_indices_first, PointIndexIterator point_indices_last, PointIterator points_first, MultiLinestringRange linestrings, rmm::cuda_stream_view stream=rmm::cuda_stream_default, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Finds the nearest linestring to each point in a quadrant, and computes the distances between each poi...
std::pair< rmm::device_uvector< IndexType >, rmm::device_uvector< IndexType > > quadtree_point_in_polygon(PolyIndexIterator poly_indices_first, PolyIndexIterator poly_indices_last, QuadIndexIterator quad_indices_first, point_quadtree_ref quadtree, PointIndexIterator point_indices_first, PointIndexIterator point_indices_last, PointIterator points_first, MultiPolygonRange polygons, rmm::cuda_stream_view stream=rmm::cuda_stream_default, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Test whether the specified points are inside any of the specified polygons.
std::pair< rmm::device_uvector< uint32_t >, rmm::device_uvector< uint32_t > > join_quadtree_and_bounding_boxes(point_quadtree_ref quadtree, BoundingBoxIterator bounding_boxes_first, BoundingBoxIterator bounding_boxes_last, vec_2d< T > const &v_min, T scale, int8_t max_depth, rmm::cuda_stream_view stream=rmm::cuda_stream_default, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Search a quadtree for polygon or linestring bounding box intersections.