libcuspatial  23.12.00
Loading...
Searching...
No Matches
trajectory.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
19#include <rmm/cuda_stream_view.hpp>
20#include <rmm/device_uvector.hpp>
21#include <rmm/mr/device/device_memory_resource.hpp>
22
23#include <iterator>
24#include <memory>
25
26namespace cuspatial {
27
73template <typename IdInputIt,
74 typename PointInputIt,
75 typename TimestampInputIt,
76 typename IdOutputIt,
77 typename PointOutputIt,
78 typename TimestampOutputIt,
79 typename OffsetType = std::int32_t>
80std::unique_ptr<rmm::device_uvector<OffsetType>> derive_trajectories(
81 IdInputIt ids_first,
82 IdInputIt ids_last,
83 PointInputIt points_first,
84 TimestampInputIt timestamps_first,
85 IdOutputIt ids_output_first,
86 PointOutputIt points_output_first,
87 TimestampOutputIt timestamps_output_first,
88 rmm::cuda_stream_view stream = rmm::cuda_stream_default,
89 rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
90
120template <typename IdInputIt,
121 typename PointInputIt,
122 typename TimestampInputIt,
123 typename OutputIt,
124 typename IndexT = iterator_value_type<IdInputIt>>
125OutputIt trajectory_distances_and_speeds(IndexT num_trajectories,
126 IdInputIt ids_first,
127 IdInputIt ids_last,
128 PointInputIt points_first,
129 TimestampInputIt timestamps_first,
130 OutputIt distances_and_speeds_first,
131 rmm::cuda_stream_view stream = rmm::cuda_stream_default);
132
137} // namespace cuspatial
138
139#include <cuspatial/detail/trajectory/derive_trajectories.cuh>
140#include <cuspatial/detail/trajectory/trajectory_distances_and_speeds.cuh>
std::unique_ptr< rmm::device_uvector< OffsetType > > derive_trajectories(IdInputIt ids_first, IdInputIt ids_last, PointInputIt points_first, TimestampInputIt timestamps_first, IdOutputIt ids_output_first, PointOutputIt points_output_first, TimestampOutputIt timestamps_output_first, rmm::cuda_stream_view stream=rmm::cuda_stream_default, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Derive trajectories from object ids, points, and timestamps.
OutputIt trajectory_distances_and_speeds(IndexT num_trajectories, IdInputIt ids_first, IdInputIt ids_last, PointInputIt points_first, TimestampInputIt timestamps_first, OutputIt distances_and_speeds_first, rmm::cuda_stream_view stream=rmm::cuda_stream_default)
Compute the total distance (in meters) and average speed (in m/s) of objects in trajectories.