OTB  9.0.0
Orfeo Toolbox
otbGDALRPCTransformer.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 #ifndef otbGDALRPCTransformer_h
21 #define otbGDALRPCTransformer_h
22 
23 #include "itkPoint.h"
24 #include "gdal_alg.h"
25 
26 #include "otbDEMHandler.h"
27 #include "otbGeometryMetadata.h"
28 
29 #include <mutex>
30 
31 namespace otb
32 {
53 {
54 public:
55 
56  using PointType = itk::Point<double, 3>;
57 
67  GDALRPCTransformer(double LineOffset, double SampleOffset, double LatOffset, double LonOffset, double HeightOffset,
68  double LineScale, double SampleScale, double LatScale, double LonScale, double HeightScale,
69  const double (&LineNum)[20], const double (&LineDen)[20], const double (&SampleNum)[20], const double (&SampleDen)[20], bool useDEM);
70 
71  GDALRPCTransformer(const Projection::RPCParam &, bool useDEM);
72 
74 
135  void SetOption(const std::string& Name, const std::string& Value);
136 
147  void SetPixErrThreshold(double PixErrThreshold);
148 
163  bool ForwardTransform(double* x, double* y, double* z, int nPointCount);
164 
175 
190  bool InverseTransform(double* x, double* y, double* z, int nPointCount);
191 
202 
203 protected:
209  void Update() final;
210 
211 private:
213  bool m_Modified = true;
214 
216  GDALRPCInfo m_GDALRPCInfo;
217 
219  char ** m_Options = nullptr;
220 
222  double m_PixErrThreshold = 0.1;
223 
225  void * m_TransformArg = nullptr;
226 
228  std::mutex m_Mutex;
229 
231  bool m_UseDEM = true;
232 
233 };
234 }
235 #endif
otb::GDALRPCTransformer::PointType
itk::Point< double, 3 > PointType
Definition: otbGDALRPCTransformer.h:56
otb::DEMObserverInterface
Observer design pattern to keep track of DEM configuration changes.
Definition: otbDEMHandler.h:39
otbDEMHandler.h
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::GDALRPCTransformer::ForwardTransform
bool ForwardTransform(double *x, double *y, double *z, int nPointCount)
otb::GDALRPCTransformer::SetOption
void SetOption(const std::string &Name, const std::string &Value)
otbGeometryMetadata.h
otb::GDALRPCTransformer::InverseTransform
bool InverseTransform(double *x, double *y, double *z, int nPointCount)
otb::GDALRPCTransformer::~GDALRPCTransformer
~GDALRPCTransformer()
otb::GDALRPCTransformer::m_TransformArg
void * m_TransformArg
Definition: otbGDALRPCTransformer.h:225
otb::GDALRPCTransformer::m_PixErrThreshold
double m_PixErrThreshold
Definition: otbGDALRPCTransformer.h:222
otb::GDALRPCTransformer::GDALRPCTransformer
GDALRPCTransformer(double LineOffset, double SampleOffset, double LatOffset, double LonOffset, double HeightOffset, double LineScale, double SampleScale, double LatScale, double LonScale, double HeightScale, const double(&LineNum)[20], const double(&LineDen)[20], const double(&SampleNum)[20], const double(&SampleDen)[20], bool useDEM)
otb::GDALRPCTransformer::m_GDALRPCInfo
GDALRPCInfo m_GDALRPCInfo
Definition: otbGDALRPCTransformer.h:216
otb::GDALRPCTransformer::Update
void Update() final
otb::Projection::RPCParam
Coefficients for RPC model (quite similar to GDALRPCInfo)
Definition: otbGeometryMetadata.h:130
otb::GDALRPCTransformer::SetPixErrThreshold
void SetPixErrThreshold(double PixErrThreshold)
otb::GDALRPCTransformer::m_UseDEM
bool m_UseDEM
Definition: otbGDALRPCTransformer.h:231
otb::GDALRPCTransformer::m_Modified
bool m_Modified
Definition: otbGDALRPCTransformer.h:213
otb::GDALRPCTransformer
This class is a wrapper around GDALCreateRPCTransformer and GDALRPCTransform.
Definition: otbGDALRPCTransformer.h:52
otb::GDALRPCTransformer::m_Mutex
std::mutex m_Mutex
Definition: otbGDALRPCTransformer.h:228
otb::GDALRPCTransformer::m_Options
char ** m_Options
Definition: otbGDALRPCTransformer.h:219