Skip to content

Metadata refactoring

Sub-issue of #1506 (closed).

The metadata in OTB will be refactored in order to allow OSSIM removal.

The following macro-actions should be done:

  • Define the basic struct to store metadata (ImageMetadata)
  • Setup utility functions in GDALImageIO to efficiently retrieve metadata (dates, doubles, vectors,...)
  • Implement metadata parsing into each sensor IMI
    • DIMAP ? for the PHR/S6/S7 family
    • DigitalGlobe ? for QB, WorldView, ...
    • Sentinel1
  • Save ImageMetadata through GDALImageIO
  • Load ImageMetadata from GDALImageIO2024-metadata-refac
  • Translate OSSIM Keywordlist into ImageMetadata

In order to implement progressively the new metadata model into the OTB, the work will be decomposed in 5 steps:

  1. Metadata parsing for Pleiades: implement all the required classes and method necessary to handle Pleiades metadata (Optical sensor).
  2. Metadata parsing for Sentinel 1: implement all the required classes and method necessary to handle Sentinel-1 metadata (SAR sensor).
  3. Implements all the other SAR metadata interfaces: TerraSar, CosmoImage, Radarsat2.
  4. Implements all the other optical metadata interfaces: Ikonos, WorldView2, QuickBird, Spot, Spot6 and Formosat.
  5. Implements metadata utility functionalities: import/export...

Here is a detailed description of remaining work per step and per-class:

  1. Metadata parsing for Pleiades
    • Metadata
      • class ImageMetadataBase
        • ToKeywordlist: handle Geometry keys
        • ToKeywordlist: handle LUT1D keys
        • ToKeywordlist: handle LUT2D keys
        • FromKeywordlist
      • class ImageMetadata
        • slice
        • append
      • class OpticalImageMetadataInterface
        • ConvertImageKeywordlistToImageMetadata
      • MetaDataInterface implementation:
        • DimapMetadataInterface: Pleiades
      • class MetadataStorageInterface
        • TODO: check precision settings
        • TODO: check if we can use lexical_cast on a string_view
    • ImageBase
      • class Image
        • GenericRSTransform should be instanciated to translate from physical space to EPSG:4328
      • class VectorImage
        • GenericRSTransform should be instanciated to translate from physical space to EPSG:4328
      • class ImageCommons
        • Move back GetGeotransform to otb::Image and otb::VectorImage
        • Move back the GetCorners to otb::Image and otb::VectorImage, and return coordinates, in physical space, adapt usages of these function to add a GenericRSTranform to get WGS84 coords.
        • TODO: support EPSG and proj as fallback
    • IOGDAL
      • class GDALImageIO
        • ExportMetadata
        • ImportMetadata
        • Implement test ioTvGDALImageIOImportExportMetadata_JPEG_99
  2. Metadata parsing for Sentinel 1
    • Metadata
      • class SARImageMetadataInterface
        • ConvertImageKeywordlistToImageMetadata
      • MetaDataInterface implementation:
        • SAR IMI: Sentinel1
  3. Other SAR metadata interfaces
    • Metadata
      • MetaDataInterface implementation:
        • SAR IMI: TerraSar
        • SAR IMI: CosmoSkyMed
        • SAR IMI: Radarsat2
  4. Other optical metadata interfaces
    • Metadata
      • MetaDataInterface implementation:
        • DimapMetadataInterface: Spot, Formosat, (S6, S7)
        • DGMetadataInterface: QB, Worldview
        • IkonosMetadataInterface
        • Read optical metadata from geom
  5. Metadata utility functionalities
    • Metadata
      • class ImageMetadata
        • compact
        • merge
        • Use merge in otbImageMetadataInterfaceFactory.h to avoid Imd duplication
        • Update ChangeInformationImageFilter and it's test
    • Band metadata management : Manage pixel conversion (e.g. RGB->Grayscale, Vector->complex etc) * [ ] Implement specific behavior in image manipulation filters (extractROI etc..)
    • No data Use otb::ImageMetadata instead of itk::MetaDataDictionary when using ND in filters
    • OSSIMAdapters
      • class ImageKeywordlist
        • ReadGeometry
        • WriteGeometry
    • ImageFileReader
      • TODO: disable when Ossim removed
      • TODO: define proper behavior in this case
Edited by Cédric Traizet