Loading...
Searching...
No Matches
trajectory.cuh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022-2024, 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#include <rmm/resource_ref.hpp>
23
24#include <iterator>
25#include <memory>
26
27namespace cuspatial {
28
74template <typename IdInputIt,
75 typename PointInputIt,
76 typename TimestampInputIt,
77 typename IdOutputIt,
78 typename PointOutputIt,
79 typename TimestampOutputIt,
80 typename OffsetType = std::int32_t>
81std::unique_ptr<rmm::device_uvector<OffsetType>> derive_trajectories(
82 IdInputIt ids_first,
83 IdInputIt ids_last,
84 PointInputIt points_first,
85 TimestampInputIt timestamps_first,
86 IdOutputIt ids_output_first,
87 PointOutputIt points_output_first,
88 TimestampOutputIt timestamps_output_first,
89 rmm::cuda_stream_view stream = rmm::cuda_stream_default,
90 rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());
91
121template <typename IdInputIt,
122 typename PointInputIt,
123 typename TimestampInputIt,
124 typename OutputIt,
125 typename IndexT = iterator_value_type<IdInputIt>>
126OutputIt trajectory_distances_and_speeds(IndexT num_trajectories,
127 IdInputIt ids_first,
128 IdInputIt ids_last,
129 PointInputIt points_first,
130 TimestampInputIt timestamps_first,
131 OutputIt distances_and_speeds_first,
132 rmm::cuda_stream_view stream = rmm::cuda_stream_default);
133
138} // namespace cuspatial
139
140#include <cuspatial/detail/trajectory/derive_trajectories.cuh>
141#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::device_async_resource_ref 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.