![]() |
OTB
10.0.0
Orfeo Toolbox
|
#include <otbGDALImageIO.h>
Public Member Functions | |
virtual ::itk::LightObject::Pointer | CreateAnother (void) const |
virtual const char * | GetNameOfClass () const |
![]() | |
virtual void | SetFileName (const char *_arg) |
virtual const char * | GetFileName () const |
void | SetNumberOfDimensions (unsigned int) |
virtual unsigned int | GetNumberOfDimensions () const |
virtual void | SetDimensions (unsigned int i, unsigned int dim) |
virtual unsigned int | GetDimensions (unsigned int i) const |
virtual void | SetOrigin (unsigned int i, double origin) |
virtual double | GetOrigin (unsigned int i) const |
virtual void | SetSpacing (unsigned int i, double spacing) |
virtual double | GetSpacing (unsigned int i) const |
virtual void | SetDirection (unsigned int i, std::vector< double > &direction) |
virtual void | SetDirection (unsigned int i, vnl_vector< double > &direction) |
virtual std::vector< double > | GetDirection (unsigned int i) const |
virtual std::vector< double > | GetDefaultDirection (unsigned int i) const |
virtual void | SetIORegion (itk::ImageIORegion _arg) |
virtual const itk::ImageIORegion & | GetIORegion () const |
virtual void | SetPixelType (const IOPixelType _arg) |
virtual IOPixelType | GetPixelType () const |
virtual bool | SetPixelTypeInfo (const std::type_info &ptype) |
virtual void | SetComponentType (const IOComponentType _arg) |
virtual IOComponentType | GetComponentType () const |
virtual const std::type_info & | GetComponentTypeInfo () const |
virtual void | SetNumberOfComponents (unsigned int _arg) |
virtual const unsigned int & | GetNumberOfComponents () const |
virtual void | SetUseCompression (bool _arg) |
virtual bool | GetUseCompression () const |
virtual void | UseCompressionOn () |
virtual void | UseCompressionOff () |
virtual void | SetUseStreamedReading (bool _arg) |
virtual bool | GetUseStreamedReading () const |
virtual void | UseStreamedReadingOn () |
virtual void | UseStreamedReadingOff () |
virtual void | SetUseStreamedWriting (bool _arg) |
virtual bool | GetUseStreamedWriting () const |
virtual void | UseStreamedWritingOn () |
virtual void | UseStreamedWritingOff () |
virtual void | SetFileType (const FileType _arg) |
virtual FileType | GetFileType () const |
void | SetFileTypeToASCII () |
void | SetFileTypeToBinary () |
virtual void | SetByteOrder (const ByteOrder _arg) |
virtual ByteOrder | GetByteOrder () const |
void | SetByteOrderToBigEndian () |
void | SetByteOrderToLittleEndian () |
virtual SizeType | GetPixelStride () const |
SizeType | GetImageSizeInPixels () const |
SizeType | GetImageSizeInBytes () const |
SizeType | GetImageSizeInComponents () const |
virtual unsigned int | GetComponentSize () const |
virtual bool | SupportsDimension (unsigned long dim) |
virtual itk::ImageIORegion | GenerateStreamableReadRegionFromRequestedRegion (const itk::ImageIORegion &requested) const |
virtual unsigned int | GetActualNumberOfSplitsForWriting (unsigned int numberOfRequestedSplits, const itk::ImageIORegion &pasteRegion, const itk::ImageIORegion &largestPossibleRegion) |
virtual itk::ImageIORegion | GetSplitRegionForWriting (unsigned int ithPiece, unsigned int numberOfActualSplits, const itk::ImageIORegion &pasteRegion, const itk::ImageIORegion &largestPossibleRegion) |
const ArrayOfExtensionsType & | GetSupportedReadExtensions () const |
const ArrayOfExtensionsType & | GetSupportedWriteExtensions () const |
void | DoMapBuffer (void *buffer, vcl_size_t numberOfPixels, std::vector< unsigned int > &bandList) |
virtual const std::vector< std::string > & | GetAttachedFileNames () const |
const ImageMetadata & | GetImageMetadata () const |
void | SetImageMetadata (ImageMetadata) |
![]() | |
template<> | |
bool | GetAs (bool const &defaultValue, std::string const &path, int band) const |
template<typename T > | |
T | GetAs (std::string const &path, int band=-1) const |
template<typename T > | |
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 |
![]() | |
void | SetAs (const std::string &path, const std::string &value, int band=-1) |
void | SetAs (const std::string &path, double value, int band=-1) |
template<typename T > | |
void | SetAsVector (const char *path, std::vector< T > value, const char sep=' ', int band=-1) |
template<typename T > | |
void | SetAsVector (const std::string &path, std::vector< T > value, const char sep=' ', int band=-1) |
Static Public Member Functions | |
static Pointer | New () |
![]() | |
static std::string | GetComponentTypeAsString (IOComponentType) |
static std::string | GetPixelTypeAsString (IOPixelType) |
static std::string | GetFileTypeAsString (FileType) |
static std::string | GetByteOrderAsString (ByteOrder) |
typedef itk::SmartPointer< GDALDatasetWrapper > | GDALDatasetWrapperPointer |
int | m_NbBands |
int | m_CompressionLevel |
bool | m_IsIndexed |
unsigned int | m_DatasetNumber |
GDALDatasetWrapperPointer | m_Dataset |
unsigned int | m_epsgCode |
GDALDataTypeWrapper * | m_PxType |
int | m_BytePerPixel |
bool | m_FlagWriteImageInformation |
bool | m_CanStreamWrite |
bool | m_IsComplex |
bool | m_IsVectorImage |
GDALCreationOptionsType | m_CreationOptions |
unsigned int | m_NumberOfOverviews |
std::vector< std::pair< unsigned int, unsigned int > > | m_OverviewsSize |
unsigned int | m_ResolutionFactor |
std::vector< unsigned int > | m_OriginalDimensions |
bool | m_WriteRPCTags |
NoDataListType | m_NoDataList |
virtual void | SetCompressionLevel (int _arg) |
virtual int | GetCompressionLevel () |
virtual void | SetIsComplex (bool _arg) |
virtual bool | GetIsComplex () |
virtual void | SetIsVectorImage (bool _arg) |
virtual bool | GetIsVectorImage () |
virtual void | SetWriteRPCTags (bool _arg) |
virtual bool | GetWriteRPCTags () |
void | SetOptions (const GDALCreationOptionsType &opts) |
GDALCreationOptionsType | GetOptions (void) |
void | SetNoDataList (const NoDataListType &noDataList) |
void | SetOutputImagePixelType (bool isComplexInternalPixelType, bool isVectorImage) override |
bool | CanReadFile (const char *) override |
bool | CanStreamRead () override |
void | ReadImageInformation () override |
void | Read (void *buffer) override |
virtual void | ReadVolume (void *buffer) |
bool | GetSubDatasetInfo (std::vector< std::string > &names, std::vector< std::string > &desc) |
bool | GDALPixelTypeIsComplex () |
bool | CanWriteFile (const char *) override |
bool | CanStreamWrite () override |
void | WriteImageInformation () override |
void | Write (const void *buffer) override |
bool | GetAvailableResolutions (std::vector< unsigned int > &res) |
bool | GetResolutionInfo (std::vector< unsigned int > &res, std::vector< std::string > &desc) |
unsigned int | GetOverviewsCount () override |
std::vector< std::string > | GetOverviewsInfo () override |
std::string | GetGdalPixelTypeAsString () const |
int | GetNbBands () const override |
std::string | GetResourceFile (std::string const &s="") const override |
std::vector< std::string > | GetResourceFiles () const override |
std::string | GetMetadataValue (std::string const &path, bool &hasValue, int band=-1) const override |
void | SetMetadataValue (const char *path, const char *value, int band=-1) override |
void | SetEpsgCode (const unsigned int wellKnownCRS) |
unsigned int | GetNumberOf (std::string const &) const override |
unsigned int | GetAttributeId (std::string const &, std::string const &) const override |
GDALImageIO () | |
~GDALImageIO () override | |
void | KeywordlistToMetadata (ImageMetadataBase::Keywordlist, int band=-1) |
void | GDALMetadataToKeywordlist (const char *const *, ImageMetadataBase::Keywordlist &) |
void | GDALMetadataReadRPC () |
void | GDALMetadataWriteRPC (GDALDataset *) |
void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
void | InternalReadImageInformation () |
void | InternalWriteImageInformation (const void *buffer) |
GDALImageIO (const Self &)=delete | |
void | operator= (const Self &)=delete |
std::string | GetGdalWriteImageFileName (const std::string &gdalDriverShortName, const std::string &filename) const |
std::string | FilenameToGdalDriverShortName (const std::string &name) const |
bool | GetOriginFromGMLBox (std::vector< double > &origin) |
bool | CreationOptionContains (std::string partialOption) const |
void | ExportMetadata () |
void | ImportMetadata () |
bool | GDALInfoReportCorner (const char *corner_name, double x, double y, double &dfGeoX, double &dfGeoY) const |
Additional Inherited Members | |
![]() | |
const std::array< std::string, 3 > | FALSES = {"0", "false", "False"} |
const std::array< std::string, 3 > | TRUES = {"1", "true", "True"} |
![]() | |
ImageIOBase () | |
~ImageIOBase () override | |
void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
virtual void | Reset (const bool freeDynamic=true) |
void | Resize (const unsigned int numDimensions, const unsigned int *dimensions) |
virtual unsigned int | GetPixelSize () const |
void | ComputeStrides () |
SizeType | GetComponentStride () const |
SizeType | GetRowStride () const |
SizeType | GetSliceStride () const |
void | WriteBufferAsASCII (std::ostream &os, const void *buffer, IOComponentType ctype, SizeType numberOfBytesToWrite) |
void | ReadBufferAsASCII (std::istream &os, void *buffer, IOComponentType ctype, SizeType numberOfBytesToBeRead) |
bool | ReadBufferAsBinary (std::istream &os, void *buffer, SizeType numberOfBytesToBeRead) |
void | AddSupportedReadExtension (const char *extension) |
void | AddSupportedWriteExtension (const char *extension) |
virtual unsigned int | GetActualNumberOfSplitsForWritingCanStreamWrite (unsigned int numberOfRequestedSplits, const itk::ImageIORegion &pasteRegion) const |
virtual itk::ImageIORegion | GetSplitRegionForWritingCanStreamWrite (unsigned int ithPiece, unsigned int numberOfActualSplits, const itk::ImageIORegion &pasteRegion) const |
![]() | |
IOPixelType | m_PixelType |
IOComponentType | m_ComponentType |
ByteOrder | m_ByteOrder |
FileType | m_FileType |
bool | m_Initialized |
std::string | m_FileName |
unsigned int | m_NumberOfComponents |
unsigned int | m_NumberOfDimensions |
bool | m_UseCompression |
bool | m_UseStreamedReading |
bool | m_UseStreamedWriting |
itk::ImageIORegion | m_IORegion |
std::vector< SizeValueType > | m_Dimensions |
std::vector< double > | m_Spacing |
std::vector< double > | m_Origin |
std::vector< std::vector< double > > | m_Direction |
std::vector< SizeType > | m_Strides |
std::vector< std::string > | m_AttachedFileNames |
ImageMetadata | m_Imd |
std::vector< unsigned int > | m_BandList |
ImageIO object for reading and writing images with GDAL.
This ImageIO uses GDAL interface to read/write images. The origin and spacing are translated from/to GDAL geotransform matrix (even in the case of a sensor image). It means that extracts from sensor images are well supported. Typical sensor images in OTB have a spacing of [1,1] and an origin at [0.5,0.5] (when there is no GDAL geotransform, GDAL physical space is identical to GDAL index space).
Note that the geotransform matrix supports any rotated physical space whereas OTB doesn't.
Warning : the index coordinate system used in GDAL is attached to the corner of the top left pixel, whereas in OTB, the index coordinate system is attached to the centre of the top-left pixel. It means that the origin coefficients read from the GDAL geotransform are the location of the top-left pixel corner. This is why this location has to be shifted by half a pixel to be used as an OTB origin. In a nutshell, OTB images read/written by this ImageIO have the same physical space as GDAL physical space : a given point of image has the same physical location in OTB and in GDAL.
The streaming read is implemented.
Definition at line 77 of file otbGDALImageIO.h.
typedef std::vector<std::string> otb::GDALImageIO::GDALCreationOptionsType |
Definition at line 90 of file otbGDALImageIO.h.
|
private |
GDAL parameters.
Definition at line 313 of file otbGDALImageIO.h.
typedef unsigned char otb::GDALImageIO::InputPixelType |
Definition at line 83 of file otbGDALImageIO.h.
typedef std::vector<std::pair<int, double> > otb::GDALImageIO::NoDataListType |
Definition at line 92 of file otbGDALImageIO.h.
typedef itk::SmartPointer<Self> otb::GDALImageIO::Pointer |
Definition at line 88 of file otbGDALImageIO.h.
typedef GDALImageIO otb::GDALImageIO::Self |
Standard class typedefs.
Definition at line 86 of file otbGDALImageIO.h.
Definition at line 87 of file otbGDALImageIO.h.
|
protected |
Constructor. Spacing is set to [1,1] and origin to [0.5,0.5] as it would correspond to an image without geotransform
|
overrideprotected |
Destructor.
|
privatedelete |
GDAL parameters.
|
overridevirtual |
Determine the file type. Returns true if this ImageIO can read the file specified.
Implements otb::ImageIOBase.
|
inlineoverridevirtual |
Determine the file type. Returns true if the ImageIO can stream read the specified file
Reimplemented from otb::ImageIOBase.
Definition at line 155 of file otbGDALImageIO.h.
|
overridevirtual |
Determine the file type. Returns true if the ImageIO can stream write the specified file
Reimplemented from otb::ImageIOBase.
|
overridevirtual |
Determine the file type. Returns true if this ImageIO can read the file specified.
Implements otb::ImageIOBase.
virtual::itk::LightObject::Pointer otb::GDALImageIO::CreateAnother | ( | void | ) | const |
|
private |
Test whether m_CreationOptions has an option
partialOption | The beginning of a creation option (for example "QUALITY=") |
|
private |
Dump the ImageMetadata content into GDAL metadata
|
private |
GDAL parameters.
|
private |
GDAL parameters.
|
protected |
Parses the RPC from the GDAL Metadata
|
protected |
Parses a GDAL Metadata string list to fill a Keywordlist
|
protected |
Write the RPC to the GDAL Metadata
bool otb::GDALImageIO::GDALPixelTypeIsComplex | ( | ) |
Get if the pixel type in the file is complex or not (GDAL side)
|
inlineoverridevirtual |
If multiple keys have the same path, gives the position of the one with value value
Implements otb::MetadataSupplierInterface.
Definition at line 238 of file otbGDALImageIO.h.
bool otb::GDALImageIO::GetAvailableResolutions | ( | std::vector< unsigned int > & | res | ) |
Get all resolutions possible from the file dimensions
|
virtual |
GDAL parameters.
std::string otb::GDALImageIO::GetGdalPixelTypeAsString | ( | ) | const |
Returns gdal pixel type as string
|
private |
Determine real file name to write the image
|
virtual |
GDAL parameters.
|
virtual |
GDAL parameters.
|
overridevirtual |
Get metadata item in GDALDataset, domain can specified as "domain/key"
Implements otb::MetadataSupplierInterface.
|
virtual |
Run-time type information (and related methods).
Reimplemented from otb::ImageIOBase.
|
overridevirtual |
GDAL parameters.
Implements otb::MetadataSupplierInterface.
|
inlineoverridevirtual |
Get the number of keys starting with path
Implements otb::MetadataSupplierInterface.
Definition at line 231 of file otbGDALImageIO.h.
|
inline |
GDAL parameters.
Definition at line 128 of file otbGDALImageIO.h.
|
private |
Parse a GML box from a Jpeg2000 file and get the origin
|
overridevirtual |
Get number of available overviews in the file Return 0 if no overviews available Currently this overview count is only based on the first band If no pre-computed overviews are available we provide the overview count based on size division by 2
Implements otb::ImageIOBase.
|
overridevirtual |
Get description about overviews available into the file specified
Implements otb::ImageIOBase.
bool otb::GDALImageIO::GetResolutionInfo | ( | std::vector< unsigned int > & | res, |
std::vector< std::string > & | desc | ||
) |
Get Info about all resolution possible from the file dimensions
|
overridevirtual |
Get main image file
Implements otb::MetadataSupplierInterface.
|
overridevirtual |
GDAL parameters.
Reimplemented from otb::MetadataSupplierInterface.
bool otb::GDALImageIO::GetSubDatasetInfo | ( | std::vector< std::string > & | names, |
std::vector< std::string > & | desc | ||
) |
Get Info about all subDataset in hdf file
|
virtual |
GDAL parameters.
|
private |
Import the ImageMetadata content from GDAL metadata
|
protected |
Read all information on the image
|
protected |
Write all information on the image
|
protected |
Set the metadata from a Keywordlist
|
static |
Method for creation through the object factory.
|
privatedelete |
GDAL parameters.
|
overrideprotected |
GDAL parameters.
|
overridevirtual |
Reads the data from disk into the memory buffer provided.
Implements otb::ImageIOBase.
|
overridevirtual |
Set the spacing and dimension information for the set filename.
Implements otb::ImageIOBase.
|
virtual |
Reads 3D data from multiple files assuming one slice per file.
|
virtual |
Set/Get the level of compression for the output images. 0-9; 0 = none, 9 = maximum.
void otb::GDALImageIO::SetEpsgCode | ( | const unsigned int | wellKnownCRS | ) |
Set the projection system from EPSG code
|
virtual |
Set/Get whether the pixel type (otb side) is complex
|
virtual |
Set/Get whether the pixel type (otb side) is Vector or Scalar
|
overridevirtual |
Set metadata item in GDALDataset, domain can specified as prefix of the path, like "domain/key"
Implements otb::MetadataStorageInterface.
|
inline |
Set NoDataList
Definition at line 134 of file otbGDALImageIO.h.
|
inline |
Set/Get the options
Definition at line 123 of file otbGDALImageIO.h.
|
inlineoverridevirtual |
Provide hist about the output container to deal with complex pixel type
Implements otb::ImageIOBase.
Definition at line 141 of file otbGDALImageIO.h.
|
virtual |
Set/get whether the driver will write RPC tags to TIFF
|
overridevirtual |
Writes the data to disk from the memory buffer provided. Make sure that the IORegion has been set properly.
Implements otb::ImageIOBase.
|
overridevirtual |
Writes the spacing and dimensions of the image. Assumes SetFileName has been called with a valid file name.
Implements otb::ImageIOBase.
|
private |
Number of bytes per pixel
Definition at line 319 of file otbGDALImageIO.h.
|
private |
GDAL parameters.
Definition at line 324 of file otbGDALImageIO.h.
|
protected |
Buffer Determines the level of compression for written files. Range 0-9; 0 = none, 9 = maximum , default = 4
Definition at line 282 of file otbGDALImageIO.h.
|
private |
Creation Options
Definition at line 336 of file otbGDALImageIO.h.
|
private |
GDAL parameters.
Definition at line 314 of file otbGDALImageIO.h.
|
protected |
Dataset index to extract (starting at 0)
Definition at line 287 of file otbGDALImageIO.h.
|
private |
GDAL parameters.
Definition at line 315 of file otbGDALImageIO.h.
|
private |
GDAL parameters.
Definition at line 323 of file otbGDALImageIO.h.
|
private |
Whether the pixel type (otb side, not gdal side) is complex this information has to be provided by the reader
Definition at line 328 of file otbGDALImageIO.h.
|
protected |
GDAL parameters.
Definition at line 284 of file otbGDALImageIO.h.
|
private |
Whether the pixel type (otb side, not gdal side) is Vector this information has to be provided by the reader
Definition at line 332 of file otbGDALImageIO.h.
|
protected |
Number of bands of the image
Definition at line 275 of file otbGDALImageIO.h.
|
private |
GDAL parameters.
Definition at line 361 of file otbGDALImageIO.h.
|
private |
Number of Overviews in the file
Definition at line 340 of file otbGDALImageIO.h.
|
private |
Original dimension of the input image
Definition at line 353 of file otbGDALImageIO.h.
|
private |
Size of the different overviews of the file
Definition at line 344 of file otbGDALImageIO.h.
|
private |
GDAL parameters.
Definition at line 317 of file otbGDALImageIO.h.
|
private |
Resolution factor
Definition at line 348 of file otbGDALImageIO.h.
|
private |
True if RPC tags should be exported
Definition at line 358 of file otbGDALImageIO.h.