metadata model in OTB v8

OTB v8 has a new metadata management which will lead to significant changes in diapotb.

A metadata model based on GDAL and not on OSSIM/OssimPlugins anymore, will be available in OTB v8.

Several impacts can be quoted :

  • Ossim dependancy is removed, see : #7
  • New management based on GDAL :
    • New keywords and APIs
    • Metadata included in tiff image (or with .aux.xml) instead of geom file

See : https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/wikis/Migration-guide-OTBv8

Impact on applications

Several applications used metadata to get or set information.

The main refactoring for metadata inside DiapOTB will be to get/set keys with right names and by using Set/GetImageMetadata instead of Set/GetImageKeywordlist.

Some examples available in https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/wikis/Migration-guide-OTBv8#migration-example

In OTB v8, keys are several kinds :

  • MDNum for numeric keys (double)
  • MDStr for string keys
  • MDTimes for dates, the Time struct is defined here
  • MDGeom for models (RPC model, Sar model, GCPs ...)
  • MDL1D et MDL2D for LUTS, the LUT struct is defined

Quote all key names used in DiapOTB (from legacy imagekeywordlist):

  • azimuthFmRate.*:
    • in SARParam.azimuthFmRates
  • dopplerCentroid.* :
    • in SARParam.dopplerCentroids
  • support_data.azimuth_steering_rate :
    • in SARParam.azimuthSteeringRate
  • support_data.line_time_interval :
    • not always 1/PRF (ie : TSX) => perhaps keep both line_time_interval and PRF in SarParams.azimuthTimeInterval
  • support_data.radar_frequency :
    • in v8 RadarFrequency
  • support_data.geom.bursts.* :
    • SARParam.burstRecords
  • support_data.range_sampling_rate :
    • SARParam.rangeSamplingRate
  • support_data.slant_range_to_first_pixel:
    • SARParam.nearRangeTime
  • support_data.first_line_time :
    • in v8 AcquisitionStartTime
  • support_data.last_line_time:
    • in v8 AcquisitionStopTime
  • support_data.abs_orbit :
    • in v8 OrbitNumber
  • support_data.range_spacing :
    • in v8 PixelSpacing
  • sensor:
    • in v8 Mission
  • manifest_data.instrument:
    • in v8 Instrument
  • support_data.orbit_pass:
    • in v8 OrbitDirection
  • support_data.acquisition_mode:
    • in v8 Mode
  • support_data.invalid_pixels (from SARBurstExtraction)
  • support_data.number_samples:
    • in v8 NumberOfColumns
  • number_lines :
    • in v8 NumberOfLines
  • number_samples :
    • in v8 NumberOfColumns
  • ul_lon/lat, ur_lon/lat ...:
    • SARParam.ulSceneCoord (or ur/lr/ll)
  • support_data.azimuth_bandwidth:
    • SARParam.azimuthBandwidth

Tips: an easy way to match every metadata is to look at ParseGeom function in each *MetadataInterface. For instance : for Sentinel1

Impact on python_src

Python chains used some of metadata to check sensor, to apply some processing or update some metadata.

In v7, Several ways are used to retrieve/use metadata :

  • Retrieve metadata as a dict from ReadImageInfo application with keywordlist = True
  • Update metdata though a new geom file thanks to SARMetadataCorrection. A extended filename is used to take the new geom into account
  • Read/Write geom file to get all metadata with expected time struct with python functions : read/write
Edited by Gaëlle USSEGLIO
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information