OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | List of all members
otb::GeomMetadataSupplier Class Reference

#include <otbGeomMetadataSupplier.h>

+ Inheritance diagram for otb::GeomMetadataSupplier:
+ Collaboration diagram for otb::GeomMetadataSupplier:

Public Types

using DictType = std::unordered_map< std::string, std::string >
 

Public Member Functions

bool FetchGCP (ImageMetadata &imd)
 
bool FetchRPC (ImageMetadata &imd, const double lineOffset=0, const double sampleOffset=0)
 
 GeomMetadataSupplier (const GeomMetadataSupplier &)=delete
 
 GeomMetadataSupplier (const std::string &geomFile)
 
 GeomMetadataSupplier (const std::string &geomFile, const std::string &imageFile)
 
std::string GetMetadataValue (std::string const &path, bool &hasValue, int band=1) const override
 
int GetNbBands () const override
 
unsigned int GetNumberOf (std::string const &) const override
 
std::string GetResourceFile (std::string const &s="") const override
 
std::vector< std::string > GetResourceFiles () const override
 
GeomMetadataSupplieroperator= (const GeomMetadataSupplier &)=delete
 
 ~GeomMetadataSupplier ()=default
 
- Public Member Functions inherited from otb::MetadataSupplierInterface
template<>
bool GetAs (bool const &defaultValue, std::string const &path, int band) const
 
template<typename T >
GetAs (std::string const &path, int band=-1) const
 
template<typename T >
GetAs (T const &defaultValue, std::string const &path, int band=-1) const
 
template<typename T >
std::vector< T > GetAsVector (std::string const &path, char sep=' ', int size=-1, int band=-1) const
 
bool HasValue (std::string const &path, int band=-1) const
 
virtual ~MetadataSupplierInterface ()=default
 
std::unordered_map< std::string, std::string > m_FileNames
 
DictType m_MetadataDic
 
unsigned int GetAttributId (std::string const &, std::string const &) const override
 
std::string PrintSelf () const
 
void ReadGeomFile ()
 

Additional Inherited Members

- Public Attributes inherited from otb::MetadataSupplierInterface
const std::array< std::string, 3 > FALSES = {"0", "false", "False"}
 
const std::array< std::string, 3 > TRUES = {"1", "true", "True"}
 

Detailed Description

Class to access metadata information in a Geom file.

Definition at line 41 of file otbGeomMetadataSupplier.h.

Member Typedef Documentation

◆ DictType

using otb::GeomMetadataSupplier::DictType = std::unordered_map<std::string, std::string>

Definition at line 45 of file otbGeomMetadataSupplier.h.

Constructor & Destructor Documentation

◆ GeomMetadataSupplier() [1/3]

otb::GeomMetadataSupplier::GeomMetadataSupplier ( const std::string &  geomFile)

◆ GeomMetadataSupplier() [2/3]

otb::GeomMetadataSupplier::GeomMetadataSupplier ( const std::string &  geomFile,
const std::string &  imageFile 
)

◆ GeomMetadataSupplier() [3/3]

otb::GeomMetadataSupplier::GeomMetadataSupplier ( const GeomMetadataSupplier )
delete

◆ ~GeomMetadataSupplier()

otb::GeomMetadataSupplier::~GeomMetadataSupplier ( )
default

Member Function Documentation

◆ FetchGCP()

bool otb::GeomMetadataSupplier::FetchGCP ( ImageMetadata imd)

Fill the ImageMetadata with the GCP from the geom file.

Parameters
imdThe ImageMetadata to fill

Referenced by otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::GenerateOutputInformation().

◆ FetchRPC()

bool otb::GeomMetadataSupplier::FetchRPC ( ImageMetadata imd,
const double  lineOffset = 0,
const double  sampleOffset = 0 
)

Fill the ImageMetadata with the RPC model from the geom file.

Parameters
imdThe ImageMetadata to fill

Referenced by otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::GenerateOutputInformation().

◆ GetAttributId()

unsigned int otb::GeomMetadataSupplier::GetAttributId ( std::string const &  ,
std::string const &   
) const
inlineoverridevirtual

If multiple keys have the same path, gives the position of the one with value value

Implements otb::MetadataSupplierInterface.

Definition at line 86 of file otbGeomMetadataSupplier.h.

References otbLogMacro.

◆ GetMetadataValue()

std::string otb::GeomMetadataSupplier::GetMetadataValue ( std::string const &  path,
bool &  hasValue,
int  band = 1 
) const
overridevirtual

Get the metadata value corresponding to a given path.

Parameters
pathThe path to look for
hasValueTrue if path is found
bandnot used
Returns
The value corresponding to path. Empty string if not found.

Implements otb::MetadataSupplierInterface.

◆ GetNbBands()

int otb::GeomMetadataSupplier::GetNbBands ( ) const
overridevirtual

◆ GetNumberOf()

unsigned int otb::GeomMetadataSupplier::GetNumberOf ( std::string const &  ) const
overridevirtual

Get the number of keys starting with path

Implements otb::MetadataSupplierInterface.

◆ GetResourceFile()

std::string otb::GeomMetadataSupplier::GetResourceFile ( std::string const &  s = "") const
overridevirtual

◆ GetResourceFiles()

std::vector<std::string> otb::GeomMetadataSupplier::GetResourceFiles ( ) const
overridevirtual

Reimplemented from otb::MetadataSupplierInterface.

◆ operator=()

GeomMetadataSupplier& otb::GeomMetadataSupplier::operator= ( const GeomMetadataSupplier )
delete

◆ PrintSelf()

std::string otb::GeomMetadataSupplier::PrintSelf ( ) const

Writes the content of the Geom file into a string.

Returns
A std::string

◆ ReadGeomFile()

void otb::GeomMetadataSupplier::ReadGeomFile ( )
protected

Parse a Geom file and fill the internal map.

Member Data Documentation

◆ m_FileNames

std::unordered_map<std::string, std::string> otb::GeomMetadataSupplier::m_FileNames
private

List of resource files

Definition at line 108 of file otbGeomMetadataSupplier.h.

◆ m_MetadataDic

DictType otb::GeomMetadataSupplier::m_MetadataDic
private

Dictionary containing the metadata

Definition at line 111 of file otbGeomMetadataSupplier.h.


The documentation for this class was generated from the following file: