# Landsat to ISO 19115 metadata

Landset metadata are provided as key-value pairs in text files (ASCII). While Landsat files are divided in groups (`METADATA_FILE_INFO`, `PRODUCT_METADATA`, `IMAGE_ATTRIBUTES`, `MIN_MAX_RADIANCE`, `MIN_MAX_REFLECTANCE`, `MIN_MAX_PIXEL_VALUE`, `RADIOMETRIC_RESCALING`, `TIRS_THERMAL_CONSTANTS`, `PROJECTION_PARAMETERS`), they can nevertheless be though as flat structures since there is no duplicated key names. Consequently the Landsat group are omitted in the following discussion. But ISO 19115 metadata on the other hand are structured as trees, and this tree structure can not be ignored.

Landsat values are mapped to ISO 19115 metadata when an ISO property can be found for a Landsat key. The Landsat to ISO mapping is not always a one-to-one relationship. In some cases the ISO value need to be computed from two or more Landsat values. In other cases the ISO value does not appear in the Landsat file at all, so the value is hard-coded in the `LandsatReader` class.

In the following table, black values in the "Landsat property" column are hard-coded values. Some of them are inferred from table 2-1: Band Reference Table in the Landsat Data Format Control Book (DFCB). Green values are values to be read and interpreted as described in table 3-4: L1Gt / L1T Metadata File. Values in the ISO 19115 column shown the paths to an ISO property relative to the `Metadata` root. When an ISO property can accept various subtypes, the type used are those listed below:

- `identificationInfo` is of type `DataIdentification` (a `Identification` subtype)
- `contentInfo` is of type `ImageDescription` (a `ContentInformation` subtype)
- `attribute` is of type `Band` (a `RangeDimension` subtype)

Sources:

- ISO 19115-1:2014 - Geographic information - Metadata - Part 1: Fundamentals
- LANDSAT 8 (L8) level 1 (L1) Data Format Control Book (DFCB)

Metadata mapping
ISO 19115 property | Landsat property | Description or comment
--- | --- | ---
Metadata
`├─`Language | English |
`├─`Spatial representation info (1 of 3) |  |
`│ ├─`Number of dimensions | 2 |
`│ ├─`Axis dimension properties (1 of 2) |  |
`│ │ ├─`Dimension name | Sample |
`│ │ └─`Dimension size | `PANCHROMATIC_SAMPLES` |
`│ └─`Axis dimension properties (2 of 2) |  |
`│ ├─`Dimension name | Line |
`│ └─`Dimension size | `PANCHROMATIC_LINES` |
`├─`Spatial representation info (2 of 3) |  |
`│ ├─`Number of dimensions | 2 |
`│ │ ├─`Dimension name | Sample |
`│ │ └─`Dimension size | `REFLECTIVE_SAMPLES` |
`│ └─`Axis dimension properties (2 of 2) |  |
`│ ├─`Dimension name | Line |
`│ └─`Dimension size | `REFLECTIVE_LINES` |
`├─`Spatial representation info (3 of 3) |  |
`│ ├─`Number of dimensions | 2 |
`│ │ ├─`Dimension name | Sample |
`│ │ └─`Dimension size | `THERMAL_SAMPLES` |
`│ └─`Axis dimension properties (2 of 2) |  |
`│ ├─`Dimension name | Line |
`│ └─`Dimension size | `THERMAL_LINES` |
`├─`Reference system info | `MAP_PROJECTION`, etc. | UTM or polar stereographic projection built from up to 8 elements.
`├─`Identification info |  |
`│ ├─`Citation |  |
`│ │ ├─`Date: | `FILE_DATE` | The date when metadata file product set was created.
`│ │ │ └─`Date type: | Creation | Hard-coded ISO 19115 value to be set only if above date exists.
`│ │ └─`Identifier: | `LANDSAT_SCENE_ID` | The unique Landsat scene identifier.
`│ ├─`Credit: | `ORIGIN` | Recognition of those who contributed to the resources.
`│ ├─`Resource format |  |
`│ │ └─`Format specification citation |  |
`│ │ ├─`Title: |  | Long name inferred from `OUTPUT_FORMAT` if possible.
`│ │ └─`Alternate title: | `OUTPUT_FORMAT` | The name of the data transfer format, considered as an abbreviation.
`│ ├─`Spatial resolution (1 of 3) | `GRID_CELL_SIZE_PANCHROMATIC` | The grid cell size in meters for the panchromatic band, if part of the product.
`│ ├─`Spatial resolution (2 of 3) | `GRID_CELL_SIZE_REFLECTIVE` | The grid cell size in meters for the reflective bands, if part of the product.
`│ ├─`Spatial resolution (3 of 3) | `GRID_CELL_SIZE_THERMAL` | The grid cell size in meters for the thermal bands, if part of the product.
`│ └─`Extent |  |
`│ ├─`Geographic element |  |
`│ │ ├─`West bound longitude: | `min(CORNER_*_LON_PRODUCT)` | The western-most longitude value in degrees (approximation).
`│ │ ├─`East bound longitude: | `max(CORNER_*_LON_PRODUCT)` | The eastern-most longitude value in degrees (approximation).
`│ │ ├─`South bound latitude: | `min(CORNER_*_LAT_PRODUCT)` | The southern-most longitude value in degrees (approximation).
`│ │ ├─`North bound latitude: | `max(CORNER_*_LAT_PRODUCT)` | The northern-most longitude value in degrees (approximation).
`│ │ └─`Extent type code: | true |
`│ └─`Temporal element |  |
`│ └─`Start time: | `DATE_ACQUIRED + SCENE_CENTER_TIME` | The date and center time the image was acquired.
`├─`Content info |  |
`│ ├─`Illumination elevation angle: | `SUN_ELEVATION` | The Sun elevation angle in degrees for the image center location at the image center acquisition time.
`│ ├─`Illumination azimuth angle: | `SUN_AZIMUTH` | The Sun azimuth angle in degrees for the image center location at the image center acquisition time.
`│ ├─`Cloud cover percentage: | `CLOUD_COVER` | The overall cloud coverage (percent) of the WRS-2 scene.
`│ ├─`Attribute group (1 of 3) |  | Reflective bands
`│ │ ├─`Content type: | Physical measurement | The types of information represented by the values.
`│ │ ├─`Attribute (1 of 8) |  |
`│ │ │ ├─`Bound units: | nm | Units in which sensor wavelengths are expressed.
`│ │ │ ├─`Peak response: | 433 |
`│ │ │ ├─`Min value: | `QUANTIZE_CAL_MIN_BAND_1` | Minimum pixel value.
`│ │ │ ├─`Max value: | `QUANTIZE_CAL_MAX_BAND_1` | Maximum pixel value.
`│ │ │ ├─`Scale factor: | `RADIANCE_MULT_BAND_1` | Multiplicative rescaling factor from pixel to radiance units.
`│ │ │ ├─`Offset: | `RADIANCE_ADD_BAND_1` | Additive rescaling factor from pixel to radiance units.
`│ │ │ ├─`Transfer function type: | Linear | Scale factor and offset are used in a linear equation.
`│ │ │ ├─`Name: | `FILE_NAME_BAND_1` | File name of the TIFF image containing pixel values
`│ │ │ └─`Description: | Coastal Aerosol (Operational Land Imager) |
`│ │ ├─`Attribute (2 of 8) |  |
`│ │ │ ├─`Bound units: | nm | Units in which sensor wavelengths are expressed.
`│ │ │ ├─`Peak response: | 482 |
`│ │ │ ├─`Min value: | `QUANTIZE_CAL_MIN_BAND_2` | Minimum pixel value.
`│ │ │ ├─`Max value: | `QUANTIZE_CAL_MAX_BAND_2` | Maximum pixel value.
`│ │ │ ├─`Scale factor: | `RADIANCE_MULT_BAND_2` | Multiplicative rescaling factor from pixel to radiance units.
`│ │ │ ├─`Offset: | `RADIANCE_ADD_BAND_2` | Additive rescaling factor from pixel to radiance units.
`│ │ │ ├─`Transfer function type: | Linear | Scale factor and offset are used in a linear equation.
`│ │ │ ├─`Name: | `FILE_NAME_BAND_2` | File name of the TIFF image containing pixel values
`│ │ │ └─`Description: | Blue (OLI) |
`│ │ ├─`Attribute (3 of 8) |  |
`│ │ │ ├─`Bound units: | nm | Units in which sensor wavelengths are expressed.
`│ │ │ ├─`Peak response: | 562 |
`│ │ │ ├─`Min value: | `QUANTIZE_CAL_MIN_BAND_3` | Minimum pixel value.
`│ │ │ ├─`Max value: | `QUANTIZE_CAL_MAX_BAND_3` | Maximum pixel value.
`│ │ │ ├─`Scale factor: | `RADIANCE_MULT_BAND_3` | Multiplicative rescaling factor from pixel to radiance units.
`│ │ │ ├─`Offset: | `RADIANCE_ADD_BAND_3` | Additive rescaling factor from pixel to radiance units.
`│ │ │ ├─`Transfer function type: | Linear | Scale factor and offset are used in a linear equation.
`│ │ │ ├─`Name: | `FILE_NAME_BAND_3` | File name of the TIFF image containing pixel values
`│ │ │ └─`Description: | Green (OLI) |
`│ │ ├─`Attribute (4 of 8) |  |
`│ │ │ ├─`Bound units: | nm | Units in which sensor wavelengths are expressed.
`│ │ │ ├─`Peak response: | 655 |
`│ │ │ ├─`Min value: | `QUANTIZE_CAL_MIN_BAND_4` | Minimum pixel value.
`│ │ │ ├─`Max value: | `QUANTIZE_CAL_MAX_BAND_4` | Maximum pixel value.
`│ │ │ ├─`Scale factor: | `RADIANCE_MULT_BAND_4` | Multiplicative rescaling factor from pixel to radiance units.
`│ │ │ ├─`Offset: | `RADIANCE_ADD_BAND_4` | Additive rescaling factor from pixel to radiance units.
`│ │ │ ├─`Transfer function type: | Linear | Scale factor and offset are used in a linear equation.
`│ │ │ ├─`Name: | `FILE_NAME_BAND_4` | File name of the TIFF image containing pixel values
`│ │ │ └─`Description: | Red (OLI) |
`│ │ ├─`Attribute (5 of 8) |  |
`│ │ │ ├─`Bound units: | nm | Units in which sensor wavelengths are expressed.
`│ │ │ ├─`Peak response: | 865 |
`│ │ │ ├─`Min value: | `QUANTIZE_CAL_MIN_BAND_5` | Minimum pixel value.
`│ │ │ ├─`Max value: | `QUANTIZE_CAL_MAX_BAND_5` | Maximum pixel value.
`│ │ │ ├─`Scale factor: | `RADIANCE_MULT_BAND_5` | Multiplicative rescaling factor from pixel to radiance units.
`│ │ │ ├─`Offset: | `RADIANCE_ADD_BAND_5` | Additive rescaling factor from pixel to radiance units.
`│ │ │ ├─`Transfer function type: | Linear | Scale factor and offset are used in a linear equation.
`│ │ │ ├─`Name: | `FILE_NAME_BAND_5` | File name of the TIFF image containing pixel values
`│ │ │ └─`Description: | Near-Infrared (NIR) (OLI) |
`│ │ ├─`Attribute (6 of 8) |  |
`│ │ │ ├─`Bound units: | nm | Units in which sensor wavelengths are expressed.
`│ │ │ ├─`Peak response: | 1610 |
`│ │ │ ├─`Min value: | `QUANTIZE_CAL_MIN_BAND_6` | Minimum pixel value.
`│ │ │ ├─`Max value: | `QUANTIZE_CAL_MAX_BAND_6` | Maximum pixel value.
`│ │ │ ├─`Scale factor: | `RADIANCE_MULT_BAND_6` | Multiplicative rescaling factor from pixel to radiance units.
`│ │ │ ├─`Offset: | `RADIANCE_ADD_BAND_6` | Additive rescaling factor from pixel to radiance units.
`│ │ │ ├─`Transfer function type: | Linear | Scale factor and offset are used in a linear equation.
`│ │ │ ├─`Name: | `FILE_NAME_BAND_6` | File name of the TIFF image containing pixel values
`│ │ │ └─`Description: | Short Wavelength Infrared (SWIR) 1 (OLI) |
`│ │ ├─`Attribute (7 of 8) |  |
`│ │ │ ├─`Bound units: | nm | Units in which sensor wavelengths are expressed.
`│ │ │ ├─`Peak response: | 2200 |
`│ │ │ ├─`Min value: | `QUANTIZE_CAL_MIN_BAND_7` | Minimum pixel value.
`│ │ │ ├─`Max value: | `QUANTIZE_CAL_MAX_BAND_7` | Maximum pixel value.
`│ │ │ ├─`Scale factor: | `RADIANCE_MULT_BAND_7` | Multiplicative rescaling factor from pixel to radiance units.
`│ │ │ ├─`Offset: | `RADIANCE_ADD_BAND_7` | Additive rescaling factor from pixel to radiance units.
`│ │ │ ├─`Transfer function type: | Linear | Scale factor and offset are used in a linear equation.
`│ │ │ ├─`Name: | `FILE_NAME_BAND_7` | File name of the TIFF image containing pixel values
`│ │ │ └─`Description: | SWIR 2 (OLI) |
`│ │ └─`Attribute (8 of 8) |  |
`│ │ ├─`Bound units: | nm | Units in which sensor wavelengths are expressed.
`│ │ ├─`Peak response: | 1375 |
`│ │ ├─`Min value: | `QUANTIZE_CAL_MIN_BAND_9` | Minimum pixel value.
`│ │ ├─`Max value: | `QUANTIZE_CAL_MAX_BAND_9` | Maximum pixel value.
`│ │ ├─`Scale factor: | `RADIANCE_MULT_BAND_9` | Multiplicative rescaling factor from pixel to radiance units.
`│ │ ├─`Offset: | `RADIANCE_ADD_BAND_9` | Additive rescaling factor from pixel to radiance units.
`│ │ ├─`Transfer function type: | Linear | Scale factor and offset are used in a linear equation.
`│ │ ├─`Name: | `FILE_NAME_BAND_9` | File name of the TIFF image containing pixel values
`│ │ └─`Description: | Cirrus (OLI) |
`│ ├─`Attribute group (2 of 3) |  | Panchromatic band
`│ │ ├─`Content type: | Physical measurement | The types of information represented by the values.
`│ │ └─`Attribute (8 of 11) |  |
`│ │ ├─`Bound units: | nm | Units in which sensor wavelengths are expressed.
`│ │ ├─`Peak response: | 590 |
`│ │ ├─`Min value: | `QUANTIZE_CAL_MIN_BAND_8` | Minimum pixel value.
`│ │ ├─`Max value: | `QUANTIZE_CAL_MAX_BAND_8` | Maximum pixel value.
`│ │ ├─`Scale factor: | `RADIANCE_MULT_BAND_8` | Multiplicative rescaling factor from pixel to radiance units.
`│ │ ├─`Offset: | `RADIANCE_ADD_BAND_8` | Additive rescaling factor from pixel to radiance units.
`│ │ ├─`Transfer function type: | Linear | Scale factor and offset are used in a linear equation.
`│ │ ├─`Name: | `FILE_NAME_BAND_8` | File name of the TIFF image containing pixel values
`│ │ └─`Description: | Panchromatic (OLI) |
`│ └─`Attribute group (3 of 3) |  | Thermal bands
`│ ├─`Content type: | Physical measurement | The types of information represented by the values.
`│ ├─`Attribute (10 of 11) |  |
`│ │ ├─`Bound units: | nm | Units in which sensor wavelengths are expressed.
`│ │ ├─`Peak response: | 10800 |
`│ │ ├─`Min value: | `QUANTIZE_CAL_MIN_BAND_10` | Minimum pixel value.
`│ │ ├─`Max value: | `QUANTIZE_CAL_MAX_BAND_10` | Maximum pixel value.
`│ │ ├─`Scale factor: | `RADIANCE_MULT_BAND_10` | Multiplicative rescaling factor from pixel to radiance units.
`│ │ ├─`Offset: | `RADIANCE_ADD_BAND_10` | Additive rescaling factor from pixel to radiance units.
`│ │ ├─`Transfer function type: | Linear | Scale factor and offset are used in a linear equation.
`│ │ ├─`Name: | `FILE_NAME_BAND_10` | File name of the TIFF image containing pixel values
`│ │ └─`Description: | Thermal Infrared Sensor (TIRS) 1 |
`│ └─`Attribute (11 of 11) |  |
`│ ├─`Bound units: | nm | Units in which sensor wavelengths are expressed.
`│ ├─`Peak response: | 12000 |
`│ ├─`Min value: | `QUANTIZE_CAL_MIN_BAND_11` | Minimum pixel value.
`│ ├─`Max value: | `QUANTIZE_CAL_MAX_BAND_11` | Maximum pixel value.
`│ ├─`Scale factor: | `RADIANCE_MULT_BAND_11` | Multiplicative rescaling factor from pixel to radiance units.
`│ ├─`Offset: | `RADIANCE_ADD_BAND_11` | Additive rescaling factor from pixel to radiance units.
`│ ├─`Transfer function type: | Linear | Scale factor and offset are used in a linear equation.
`│ ├─`Name: | `FILE_NAME_BAND_11` | File name of the TIFF image containing pixel values
`│ └─`Description: | Thermal Infrared Sensor (TIRS) 2 |
`├─`Acquisition information |  |
`│ ├─`Acquisition requirement |  |
`│ │ └─`Identifier: | `REQUEST_ID` | Product Request ID.
`│ ├─`Operation |  |
`│ │ ├─`Status: | Completed | Status of the data acquisition.
`│ │ ├─`Type: | Real | Collection technique for the operation.
`│ │ └─`Significant event |  |
`│ │ ├─`Context: | Acquisition | Meaning of the event.
`│ │ └─`Time: | `DATE_ACQUIRED + SCENE_CENTER_TIME` | Duplication of above "Start time" metadata.
`│ └─`Platform |  |
`│ ├─`Identifier: | `SPACECRAFT_ID` | Spacecraft from which the data were captured.
`│ └─`Instrument |  |
`│ └─`Identifier: | `SENSOR_ID` | Sensor used to capture this scene.
`└─`Date info: | `FILE_DATE` | Duplication of above "Citation date" metadata.
`└─`Date type: | Creation | Hard-coded ISO 19115 value to be set only if `dateInfo/date` exists.