OTB  9.1.1
Orfeo Toolbox
otbSpot5InverseTransform.hxx
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 otbSpot5InverseTransform_hxx
22 #define otbSpot5InverseTransform_hxx
23 
25 #include "otbDEMHandler.h"
26 
27 namespace otb
28 {
29 template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
31 {}
32 
33 template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
36 {
38  worldPoint[0] = static_cast<double>(point[0]);
39  worldPoint[1] = static_cast<double>(point[1]);
40  if (NInputDimensions > 2)
41  worldPoint[2] = static_cast<double>(point[2]);
42  else
43  worldPoint[2] = otb::DEMHandler::GetInstance().GetHeightAboveEllipsoid(point[0], point[1]);
44 
45  Spot5SensorModel::Point2DType sensorPoint(this->m_Transformer->WorldToLineSample(worldPoint));
46 
47  OutputPointType pOut;
48 
49  // from centered to upper left corner pixel convention
50  pOut[0] = static_cast<TScalarType>(sensorPoint[0]) + 0.5;
51  pOut[1] = static_cast<TScalarType>(sensorPoint[1]) + 0.5;
52 
53  if (NOutputDimensions > 2)
54  pOut[2] = static_cast<TScalarType>(worldPoint[2]);
55 
56  return pOut;
57 }
58 
62 template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
64 {
65  Superclass::PrintSelf(os, indent);
66  os << indent << "Transformation direction: Inverse\n";
67 }
69 
70 }
71 
72 #endif
otb::Spot5SensorModel::Point2DType
itk::Point< double, 2 > Point2DType
SPOT5 sensor class, based on OSSIM Spot5SensorModel with ITK/GDAL implementation.
Definition: otbSpot5SensorModel.h:49
otb::DEMHandler::GetInstance
static DEMHandler & GetInstance()
otb::SensorTransformBase::OutputPointType
itk::Point< TScalarType, NOutputDimensions > OutputPointType
Definition: otbSensorTransformBase.h:60
otb::SensorTransformBase::InputPointType
itk::Point< TScalarType, NInputDimensions > InputPointType
Definition: otbSensorTransformBase.h:59
otbSpot5InverseTransform.h
otb::Transform< TScalarType, 2, 3 >::TransformDirection
TransformDirection
Definition: otbPCAImageFilter.h:34
otb::Spot5InverseTransform::PrintSelf
void PrintSelf(std::ostream &os, itk::Indent indent) const override
Definition: otbSpot5InverseTransform.hxx:63
otbDEMHandler.h
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Transform
Class to overload method passed to virtual pure in ITK V4.
Definition: otbTransform.h:39
otb::Spot5InverseTransform::TransformPoint
OutputPointType TransformPoint(const InputPointType &point) const override
Definition: otbSpot5InverseTransform.hxx:35
otb::Spot5SensorModel::Point3DType
itk::Point< double, 3 > Point3DType
Definition: otbSpot5SensorModel.h:50
otb::Spot5InverseTransform::Spot5InverseTransform
Spot5InverseTransform()
Definition: otbSpot5InverseTransform.hxx:30
otb::Spot5InverseTransform::OutputPointType
itk::Point< TScalarType, NOutputDimensions > OutputPointType
Definition: otbSpot5InverseTransform.h:49
otb::DEMHandler::GetHeightAboveEllipsoid
double GetHeightAboveEllipsoid(double lon, double lat) const