OTB  10.0.0
Orfeo Toolbox
otbSpot5TransformBase.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 otbSpot5TransformBase_hxx
22 #define otbSpot5TransformBase_hxx
23 
24 #include "otbSpot5TransformBase.h"
25 
26 namespace otb
27 {
28 
29 template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
31 {
32 
33  if (!imd.Has(MDGeom::Spot5Geometry))
34  return false;
35  const boost::any any_Spot5 = imd[MDGeom::Spot5Geometry];
36  if (any_Spot5.empty())
37  return false;
38  try
39  {
40  this->m_Spot5Param = std::make_unique<Spot5Param>(boost::any_cast<Spot5Param>(imd[MDGeom::Spot5Geometry]));
41  }
42  catch (const boost::bad_any_cast&)
43  {
44  return false;
45  }
46 
47  this->m_Transformer = std::make_unique<Spot5SensorModel>(imd);
48  return true;
49 
50 }
51 
52 
53 template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
55 {
56  return m_Transformer != nullptr;
57 }
58 
62 template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
64 {
65  Superclass::PrintSelf(os, indent);
66  os << indent << "Spot5 Model\n";
67 }
69 
70 template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
72 {
73  // A Standard definition of this function is available for RPC sensor model in RPCTransformBase class
74  otbLogMacro(Warning, << "Optimize parameters function not implemented for Spot 5 sensor model. The sensor model parameters will NOT be modified");
75 }
76 
77 }
78 
79 #endif
bool Has(MDGeom key) const
Generic class containing image metadata used in OTB.
void OptimizeParameters(ImageMetadata &imd, const TiePointsType &tiepoints, double &rmsError) final
void PrintSelf(std::ostream &os, itk::Indent indent) const override
bool SetMetadata(const ImageMetadata &imd) override
bool IsValidSensorModel() const override
std::vector< std::pair< InputPointType, OutputPointType > > TiePointsType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
#define otbLogMacro(level, msg)
Definition: otbMacro.h:104