OTB  10.0.0
Orfeo Toolbox
otbWrapperMetaDataHelper.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 otbWrapperMetaDataHelper_h
22 #define otbWrapperMetaDataHelper_h
23 
24 #include "otbMetaDataKey.h"
26 #include "otbGeometryMetadata.h"
27 #include "itkMetaDataDictionary.h"
28 #include "OTBApplicationEngineExport.h"
29 
30 namespace otb
31 {
32 namespace Wrapper
33 {
34 
44 namespace MetaDataHelper
45 {
46 
47 enum class MDType
48 {
49  String,
50  Int,
51  Double,
52  GCP,
53  Vector,
54  ImageKWL,
57 };
58 
59 OTBApplicationEngine_EXPORT MDType GetType(const std::string& val);
60 
61 OTBApplicationEngine_EXPORT std::string GetString(const itk::MetaDataDictionary& dict, const std::string& key);
62 OTBApplicationEngine_EXPORT void SetString(itk::MetaDataDictionary& dict, const std::string& key, const std::string& val);
63 
64 OTBApplicationEngine_EXPORT unsigned int GetInt(const itk::MetaDataDictionary& dict, const std::string& key);
65 OTBApplicationEngine_EXPORT void SetInt(itk::MetaDataDictionary& dict, const std::string& key, unsigned int val);
66 
67 OTBApplicationEngine_EXPORT double GetDouble(const itk::MetaDataDictionary& dict, const std::string& key);
68 OTBApplicationEngine_EXPORT void SetDouble(itk::MetaDataDictionary& dict, const std::string& key, double val);
69 
70 OTBApplicationEngine_EXPORT otb::GCP GetGCP(const itk::MetaDataDictionary& dict, const std::string& key);
71 OTBApplicationEngine_EXPORT void SetGCP(itk::MetaDataDictionary& dict, const std::string& key, const otb::GCP& val);
72 
73 OTBApplicationEngine_EXPORT otb::MetaDataKey::VectorType GetVector(const itk::MetaDataDictionary& dict, const std::string& key);
74 OTBApplicationEngine_EXPORT void SetVector(itk::MetaDataDictionary& dict, const std::string& key, const otb::MetaDataKey::VectorType& val);
75 
76 OTBApplicationEngine_EXPORT otb::VectorDataKeywordlist GetVectorDataKWL(const itk::MetaDataDictionary& dict, const std::string& key);
77 OTBApplicationEngine_EXPORT void SetVectorDataKWL(itk::MetaDataDictionary& dict, const std::string& key, const otb::VectorDataKeywordlist& val);
78 
79 OTBApplicationEngine_EXPORT otb::MetaDataKey::BoolVectorType GetBoolVector(const itk::MetaDataDictionary& dict, const std::string& key);
80 OTBApplicationEngine_EXPORT void SetBoolVector(itk::MetaDataDictionary& dict, const std::string& key, const otb::MetaDataKey::BoolVectorType& val);
81 
82 } // end of namespace MetaDataHelper
83 
84 } // end of namespace Wrapper
85 } // end of namespace otb
86 
87 #endif
This GCP class is used to manage the GCP parameters in OTB.
this class handle the metadata of vector data.
Contains small helper functions to manipulate itk::MetaDataDictionary.
std::vector< bool > BoolVectorType
std::vector< double > VectorType
OTBApplicationEngine_EXPORT void SetVector(itk::MetaDataDictionary &dict, const std::string &key, const otb::MetaDataKey::VectorType &val)
OTBApplicationEngine_EXPORT double GetDouble(const itk::MetaDataDictionary &dict, const std::string &key)
OTBApplicationEngine_EXPORT std::string GetString(const itk::MetaDataDictionary &dict, const std::string &key)
OTBApplicationEngine_EXPORT void SetGCP(itk::MetaDataDictionary &dict, const std::string &key, const otb::GCP &val)
OTBApplicationEngine_EXPORT void SetDouble(itk::MetaDataDictionary &dict, const std::string &key, double val)
OTBApplicationEngine_EXPORT otb::GCP GetGCP(const itk::MetaDataDictionary &dict, const std::string &key)
OTBApplicationEngine_EXPORT otb::VectorDataKeywordlist GetVectorDataKWL(const itk::MetaDataDictionary &dict, const std::string &key)
OTBApplicationEngine_EXPORT otb::MetaDataKey::VectorType GetVector(const itk::MetaDataDictionary &dict, const std::string &key)
OTBApplicationEngine_EXPORT void SetInt(itk::MetaDataDictionary &dict, const std::string &key, unsigned int val)
OTBApplicationEngine_EXPORT void SetString(itk::MetaDataDictionary &dict, const std::string &key, const std::string &val)
OTBApplicationEngine_EXPORT MDType GetType(const std::string &val)
OTBApplicationEngine_EXPORT otb::MetaDataKey::BoolVectorType GetBoolVector(const itk::MetaDataDictionary &dict, const std::string &key)
OTBApplicationEngine_EXPORT void SetVectorDataKWL(itk::MetaDataDictionary &dict, const std::string &key, const otb::VectorDataKeywordlist &val)
OTBApplicationEngine_EXPORT void SetBoolVector(itk::MetaDataDictionary &dict, const std::string &key, const otb::MetaDataKey::BoolVectorType &val)
OTBApplicationEngine_EXPORT unsigned int GetInt(const itk::MetaDataDictionary &dict, const std::string &key)
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.