Skip to content

stac-extensions/sentinel-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentinel-2 Extension Specification

This document explains the Sentinel-2 Extension to the SpatioTemporal Asset Catalog (STAC) specification.

The intention of the first version of the specification is to define the existing behavior of the properties prefixed with s2 as created by the stactools-sentinel2 package and used by Earth Search and Microsoft Planetary Computer. Future versions will aspire to standardize fields such as the numerous coverage calculations into separate extensions that are not specific to Sentinel-2.

Fields

The fields in the table below can be used in these parts of STAC documents:

  • Catalogs
  • Collections
  • Item Properties (incl. Summaries in Collections)
  • Assets (for both Collections and Items, incl. Item Asset Definitions in Collections)
  • Links
Field Name Type Description
s2:tile_id string Tile Identifier
s2:datatake_id string Datatake Identifier
s2:product_uri string Product URI
s2:datastrip_id string Datastrip Identifier
s2:datatake_type string Datatake Type
s2:reflectance_conversion_factor number Reflectance Conversion Factor
s2:water_percentage number DEPRECATED in favor of statistics. Water Percentage
s2:vegetation_percentage number DEPRECATED in favor of statistics. Vegetation Percentage
s2:thin_cirrus_percentage number DEPRECATED in favor of statistics. Thin Cirrus Percentage
s2:cloud_shadow_percentage number DEPRECATED in favor of statistics. Cloud Shadow Percentage
s2:nodata_pixel_percentage number DEPRECATED in favor of statistics. No Data Pixel Percentage
s2:unclassified_percentage number DEPRECATED in favor of statistics. Unclassified Percentage
s2:dark_features_percentage number DEPRECATED in favor of statistics. Dark Features Percentage
s2:not_vegetated_percentage number DEPRECATED in favor of statistics. Not Vegetated Percentage
s2:degraded_msi_data_percentage number DEPRECATED in favor of statistics. Degraded MSI Data Percentage
s2:high_proba_clouds_percentage number DEPRECATED in favor of statistics. High Probability Clouds Percentage
s2:medium_proba_clouds_percentage number DEPRECATED in favor of statistics. Medium Probability Clouds Percentage
s2:saturated_defective_pixel_percentage number DEPRECATED in favor of statistics. Saturated Defective Pixel Percentage
s2:product_type string DEPRECATED in favor of product:type. Product Type
s2:snow_ice_percentage number DEPRECATED in favor of eo:snow_cover. Snow and Ice Percentage
s2:generation_time datetime DEPRECATED in favor of processing:datetime. Generation Time
s2:processing_baseline string DEPRECATED in favor of processing:version. Processing Baseline
s2:granule_id string DEPRECATED in favor of s2:tile_id. Granule Identifier
s2:mgrs_tile string DEPRECATED in favor of the MGRS Extension fields and grid:code. Sentinel-2 MGRS Tile Identifier
s2:mean_solar_zenith number DEPRECATED in favor of view:sun_elevation. Mean Solar Zenith
s2:mean_solar_azimuth number DEPRECATED in favor of view:sun_azimuth. Mean Solar Azimuth

The fields with the _percentage suffix should be provided in the statistics field as defined in common metadata. Ideally remove the s2: prefix and the _percentage suffix and use the remainders as the key name in the Statistics Object, so for example high_proba_clouds instead of s2:high_proba_clouds_percentage.

Relation types

None

Contributing

All contributions are subject to the STAC Specification Code of Conduct. For contributions, please follow the STAC specification contributing guide Instructions for running tests are copied here for convenience.

Running tests

The same checks that run as checks on PR's are part of the repository and can be run locally to verify that changes are valid. To run tests locally, you'll need npm, which is a standard part of any node.js installation.

First you'll need to install everything with npm once. Just navigate to the root of this repository and on your command line run:

npm install

Then to check markdown formatting and test the examples against the JSON schema, you can run:

npm test

This will spit out the same texts that you see online, and you can then go and fix your markdown or examples.

If the tests reveal formatting problems with the examples, you can fix them with:

npm run format-examples