OTB  10.0.0
Orfeo Toolbox
otbGeocentricTransform.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbGeocentricTransform_h
22 #define otbGeocentricTransform_h
23 
25 #include "otbTransform.h"
26 
27 namespace otb
28 {
36 template <TransformDirection TDirectionOfMapping, class TScalarType = double>
37 class ITK_EXPORT GeocentricTransform : public Transform<TScalarType, // Data type for scalars
38  3, // Number of dimensions in the input space
39  3> // Number of dimensions in the output space
40 {
41 public:
45  typedef itk::SmartPointer<Self> Pointer;
46  typedef itk::SmartPointer<const Self> ConstPointer;
47 
49  typedef itk::Point<ScalarType, 3> InputPointType;
50  typedef itk::Point<ScalarType, 3> OutputPointType;
51 
52 
54  itkNewMacro(Self);
55 
58 
59  static const TransformDirection DirectionOfMapping = TDirectionOfMapping;
60 
61  itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
62  itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
63  itkStaticConstMacro(SpaceDimension, unsigned int, 3);
64  itkStaticConstMacro(ParametersDimension, unsigned int, 3*(3 + 1));
65 
66  OutputPointType TransformPoint(const InputPointType& point) const override;
67 
68 protected:
69  GeocentricTransform() : Superclass(ParametersDimension) {};
70  ~GeocentricTransform() override = default;
71 
72 private:
73  GeocentricTransform(const Self&) = delete;
74  void operator=(const Self&) = delete;
75 };
76 
77 namespace Projection
78 {
86 template <class TScalarType = double>
88 {
89 
91  static constexpr TScalarType a = 6378137.;
92 
94  static constexpr TScalarType b = 6356752.314245;
95 
97  static constexpr TScalarType f = (a - b) / a;
98 
100  static constexpr TScalarType es = 1 - (b * b) / (a * a);
101 };
102 
112 template <class TScalarType = double, class TEllipsoid = WGS84Ellipsoid<TScalarType>>
113 itk::Point<TScalarType, 3> WorldToEcef(const itk::Point<TScalarType, 3> & worldPoint);
114 
123 template <class TScalarType = double, class TEllipsoid = WGS84Ellipsoid<TScalarType>>
124 itk::Point<TScalarType, 3> EcefToWorld(const itk::Point<TScalarType, 3> & ecefPoint);
125 
126 } // namespace Projection
127 
128 } // namespace otb
129 
130 #ifndef OTB_MANUAL_INSTANTIATION
132 #endif
133 
134 #endif
Convert coordinates from geocentric (X, Y, Z) to geographic (lon, lat, h)
itk::SmartPointer< Self > Pointer
void operator=(const Self &)=delete
GeocentricTransform(const Self &)=delete
~GeocentricTransform() override=default
Transform< TScalarType, 3, 3 > Superclass
itk::SmartPointer< const Self > ConstPointer
itk::Point< ScalarType, 3 > InputPointType
Superclass::ScalarType ScalarType
itk::Point< ScalarType, 3 > OutputPointType
Class to overload method passed to virtual pure in ITK V4.
Definition: otbTransform.h:42
TScalarType ScalarType
Definition: otbTransform.h:71
itk::Point< TScalarType, 3 > EcefToWorld(const itk::Point< TScalarType, 3 > &ecefPoint)
itk::Point< TScalarType, 3 > WorldToEcef(const itk::Point< TScalarType, 3 > &worldPoint)
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
TransformDirection
Definition: otbTransform.h:30
a structure holding the ellipsoid parameters for WGS84
static constexpr TScalarType f
static constexpr TScalarType b
static constexpr TScalarType a
static constexpr TScalarType es