首页
libcuproj
cucim
cudf-java
cudf
cugraph
cuml
cuproj
cuspatial
cuvs
cuxfilter
dask-cuda
dask-cudf
kvikio
libcudf
libcuml
libcuproj
libcuspatial
libkvikio
librmm
libucxx
raft
rapids-cmake
rapidsmpf
rmm
stable (25.04)
nightly (25.06)
stable (25.04)
legacy (25.02)
加载中...
搜索中...
无匹配项
include
cuproj
operation
offset_scale_cartesian_coordinates.cuh
前往此文件的文档。
1
/*
2
* 版权所有 (c) 2023, NVIDIA CORPORATION。
3
*
4
* 根据 Apache 许可证 2.0 版(“许可证”)获得许可;
5
* 除非符合许可证的规定,否则您不得使用此文件。
6
* 您可以在以下位置获取许可证副本:
7
*
8
* https://apache.ac.cn/licenses/LICENSE-2.0
9
*
10
* 除非适用法律要求或书面同意,否则软件
11
* 在许可证下分发是基于“原样”基础的,
12
* 不附带任何明示或暗示的保证或条件。
13
* 有关特定语言的权限和限制,请参阅许可证。
14
*
15
*/
16
17
#pragma once
18
19
#include <cuproj/detail/utility/cuda.hpp>
20
#include <
cuproj/ellipsoid.hpp
>
21
#include <
cuproj/operation/operation.cuh
>
22
#include <
cuproj/projection_parameters.hpp
>
23
24
#include <thrust/iterator/transform_iterator.h>
25
26
#include <algorithm>
27
28
namespace
cuproj {
29
34
42
template
<
typename
Coordinate,
typename
T =
typename
Coordinate::value_type>
43
class
offset_scale_cartesian_coordinates
:
operation
<Coordinate> {
44
public
51
CUPROJ_HOST_DEVICE
offset_scale_cartesian_coordinates
(
projection_parameters<T>
const
& params)
52
: a_(params.ellipsoid_.a), ra_(T{1.0} / a_), x0_(params.x0), y0_(params.y0)
53
{
54
}
55
63
CUPROJ_HOST_DEVICE Coordinate
operator()
(Coordinate
const
& coord,
direction
dir)
const
64
{
65
if
(dir == direction::FORWARD)
66
return
forward(coord);
67
else
68
return
inverse(coord);
69
}
70
71
private
79
CUPROJ_HOST_DEVICE Coordinate forward(Coordinate
const
& coord)
const
80
{
81
return
coord * a_ + Coordinate{x0_, y0_};
82
};
83
91
CUPROJ_HOST_DEVICE Coordinate inverse(Coordinate
const
& coord)
const
92
{
93
return
(coord - Coordinate{x0_, y0_}) * ra_;
94
};
95
96
T a_;
// 椭球体半长轴
97
T ra_;
// 椭球体半长轴的倒数
98
T x0_;
// 投影原点 x
99
T y0_;
// 投影原点 y
100
};
101
105
106
}
// namespace cuproj
cuproj::offset_scale_cartesian_coordinates::operator()
CUPROJ_HOST_DEVICE Coordinate operator()(Coordinate const &coord, direction dir) const
偏移和缩放单个坐标。
定义
offset_scale_cartesian_coordinates.cuh:63
cuproj::offset_scale_cartesian_coordinates::offset_scale_cartesian_coordinates
CUPROJ_HOST_DEVICE offset_scale_cartesian_coordinates(projection_parameters< T > const ¶ms)
构造函数。
定义
offset_scale_cartesian_coordinates.cuh:51
cuproj::operation
所有变换操作的基类。
定义
operation.cuh:63
ellipsoid.hpp
cuproj::direction
direction
列举了变换操作的方向。
定义
operation.cuh:44
operation.cuh
projection_parameters.hpp
cuproj::projection_parameters
投影参数。
定义
projection_parameters.hpp:42
由
1.13.2 生成