Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentinel 2 L2A: Add band assets for lower spatial res versions #88

Merged
merged 7 commits into from
May 27, 2021

Conversation

lossyrob
Copy link
Member

@lossyrob lossyrob commented Apr 7, 2021

Fixes #87

Assets for bands that are the highest spatial resolution available (e.g. B01_10m, B05_20m) are keyed by the band name; for assets that are lower resolution than the highest resolution for that band, the resolution is added to the asset key, e.g. for B03 there are asset keys B03 (10 meter resolution), B03_20m, and B03_60m.

@jonas-eberle thanks for reporting the issue!

if asset_res == BANDS_TO_RESOLUTIONS[band_id][0]:
asset_key = band_id
else:
asset_key = f'{band_id}_{asset_res}m'
asset = pystac.Asset(href=asset_href,
media_type=asset_media_type,
title=band.description,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lossyrob for your work. Does it make sense to include the spatial resolution in the asset title?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Also set the gsd correctly - gsd is based on the sensor, not spatial resolution, so that is set the same across all band assets.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gsd is based on the sensor, not spatial resolution, so that is set the same across all band assets.

Can you clarify this? There are no examples in the PR so it's hard to tell what the implication is without trying to follow all the code. Do you mean that the asset named B03_60m would have a res of 10 instead of 60?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got the same question @kylebarron but wasn't quite grokking what was going on here. For the purposes of STAC, gsd is the same as what might be referred to as resolution

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah wait, now I see, you are referring to the actual downsampled assets. B03 is a 10m band, but they provide 20m and 60m versions.
I personally don't see the reason for storing these downsampled files, especially with the STAC tools being developed.
But, even in the case of downsampled imagery I'd say the gsd should also change to indicate the pixel size in the asset, since for all purposes that's the effective resolution of that asset. It also clearly distinguishes it from the regular asset object.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthewhanson I thought the same thing about the gsd, but https://github.com/radiantearth/stac-spec/blob/master/item-spec/common-metadata.md#gsd states that the value of this field should be related to the spatial resolution at the sensor, rather than the pixel size of images after orthorectification, pansharpening, or scaling.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it's time to add resampling_factor to the common specs ;-)

As @kylebarron mentioned, having a GSD of 10 for band that are 20m resolution fully respect the spec but is not really user friendly. I would tend to argue that since there is already the proj extension, maybe just don't add the GSD field which might be confusing for users.

@lossyrob
Copy link
Member Author

lossyrob commented Apr 9, 2021

@kylebarron yep, here's a sample item:

{
    "type": "Feature",
    "stac_version": "1.0.0-beta.2",
    "id": "S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE",
    "properties": {
        "providers": [
            {
                "name": "ESA",
                "roles": [
                    "producer",
                    "processor",
                    "licensor"
                ],
                "url": "https://earth.esa.int/web/guest/home"
            }
        ],
        "platform": "Sentinel-2B",
        "constellation": "Sentinel 2",
        "instruments": [
            "msi"
        ],
        "eo:cloud_cover": 0.447807,
        "sat:orbit_state": "descending",
        "sat:relative_orbit": 81,
        "proj:epsg": 32722,
        "s2:product_uri": "S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE",
        "s2:generation_time": "2021-01-22T15:55:00.000000Z",
        "s2:processing_baseline": "02.14",
        "s2:product_type": "S2MSI2A",
        "s2:datatake_id": "GS2B_20210122T133229_020270_N02.14",
        "s2:datatake_type": "INS-NOBS",
        "s2:datastrip_id": "S2B_OPER_MSI_L2A_DS_VGS2_20210122T155500_S20210122T133224_N02.14",
        "s2:granule_id": "S2B_OPER_MSI_L2A_TL_VGS2_20210122T155500_A020270_T22HBD_N02.14",
        "s2:mgrs_tile": "22HBD",
        "s2:reflectance_conversion_factor": 1.03305092950356,
        "s2:degraded_msi_data_percentage": 0.0,
        "s2:nodata_pixel_percentage": 0.913129,
        "s2:saturated_defective_pixel_percentage": 0.0,
        "s2:dark_features_percentage": 0.0,
        "s2:cloud_shadow_percentage": 0.0,
        "s2:vegetation_percentage": 3e-05,
        "s2:not_vegetated_percentage": 0.0,
        "s2:water_percentage": 99.552161,
        "s2:unclassified_percentage": 0.0,
        "s2:medium_proba_clouds_percentage": 0.308523,
        "s2:high_proba_clouds_percentage": 0.137727,
        "s2:thin_sirrus_percentage": 0.001557,
        "s2:snow_ice_percentage": 0.0,
        "s2:mean_solar_zenith": 32.3712311857264,
        "s2:mean_solar_azimuth": 64.9495240978383,
        "datetime": "2021-01-22T13:32:29.024000Z"
    },
    "geometry": {
        "type": "Polygon",
        "coordinates": [
            [
                [
                    -54.140594,
                    -37.992633567956354
                ],
                [
                    -54.36606,
                    -37.94656022356872
                ],
                [
                    -54.36615,
                    -37.94688023507225
                ],
                [
                    -54.36624,
                    -37.94686630132775
                ],
                [
                    -54.366302,
                    -37.94713307472404
                ],
                [
                    -54.366608,
                    -37.94706907623826
                ],
                [
                    -54.367493,
                    -37.94996854053076
                ],
                [
                    -54.39499,
                    -37.944374799703326
                ],
                [
                    -54.41397,
                    -37.94049216728527
                ],
                [
                    -54.371307,
                    -36.99812815291658
                ],
                [
                    -53.13849,
                    -37.02676719440734
                ],
                [
                    -53.161438,
                    -37.825301614522395
                ],
                [
                    -53.193024,
                    -37.93500445123628
                ],
                [
                    -53.215973,
                    -38.014598910476074
                ],
                [
                    -54.140594,
                    -37.992633567956354
                ]
            ]
        ]
    },
    "links": [
        {
            "rel": "license",
            "href": "https://sentinel.esa.int/documents/247904/690755/Sentinel_Data_Legal_Notice"
        },
        {
            "rel": "self",
            "href": "/opt/src/s2-item.json",
            "type": "application/json"
        }
    ],
    "assets": {
        "safe-manifest": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/manifest.safe",
            "type": "application/xml",
            "roles": [
                "metadata"
            ]
        },
        "product-metadata": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/./MTD_MSIL2A.xml",
            "type": "application/xml",
            "roles": [
                "metadata"
            ]
        },
        "granule-metadata": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/./GRANULE/L2A_T22HBD_A020270_20210122T133224/MTD_TL.xml",
            "type": "application/xml",
            "roles": [
                "metadata"
            ]
        },
        "inspire-metadata": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/./INSPIRE.xml",
            "type": "application/xml",
            "roles": [
                "metadata"
            ]
        },
        "datastrip-metadata": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/./DATASTRIP/DS_VGS2_20210122T155500_S20210122T133224/MTD_DS.xml",
            "type": "application/xml",
            "roles": [
                "metadata"
            ]
        },
        "B02": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R10m/T22HBD_20210122T133229_B02_10m.jp2",
            "type": "image/jp2",
            "title": "Band 2 - Blue - 10m",
            "eo:bands": [
                {
                    "name": "B02",
                    "common_name": "blue",
                    "description": "Band 2 - Blue",
                    "center_wavelength": 0.49,
                    "full_width_half_max": 0.098
                }
            ],
            "gsd": 10,
            "proj:shape": [
                10980,
                10980
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                10.0,
                0.0,
                199980.0,
                0.0,
                -10.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B03": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R10m/T22HBD_20210122T133229_B03_10m.jp2",
            "type": "image/jp2",
            "title": "Band 3 - Green - 10m",
            "eo:bands": [
                {
                    "name": "B03",
                    "common_name": "green",
                    "description": "Band 3 - Green",
                    "center_wavelength": 0.56,
                    "full_width_half_max": 0.045
                }
            ],
            "gsd": 10,
            "proj:shape": [
                10980,
                10980
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                10.0,
                0.0,
                199980.0,
                0.0,
                -10.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B04": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R10m/T22HBD_20210122T133229_B04_10m.jp2",
            "type": "image/jp2",
            "title": "Band 4 - Red - 10m",
            "eo:bands": [
                {
                    "name": "B04",
                    "common_name": "red",
                    "description": "Band 4 - Red",
                    "center_wavelength": 0.665,
                    "full_width_half_max": 0.038
                }
            ],
            "gsd": 10,
            "proj:shape": [
                10980,
                10980
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                10.0,
                0.0,
                199980.0,
                0.0,
                -10.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B08": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R10m/T22HBD_20210122T133229_B08_10m.jp2",
            "type": "image/jp2",
            "title": "Band 8 - NIR - 10m",
            "eo:bands": [
                {
                    "name": "B08",
                    "common_name": "nir",
                    "description": "Band 8 - NIR",
                    "center_wavelength": 0.842,
                    "full_width_half_max": 0.145
                }
            ],
            "gsd": 10,
            "proj:shape": [
                10980,
                10980
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                10.0,
                0.0,
                199980.0,
                0.0,
                -10.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "visual-10m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R10m/T22HBD_20210122T133229_TCI_10m.jp2",
            "type": "image/jp2",
            "title": "True color image",
            "eo:bands": [
                {
                    "name": "B04",
                    "common_name": "red",
                    "description": "Band 4 - Red",
                    "center_wavelength": 0.665,
                    "full_width_half_max": 0.038
                },
                {
                    "name": "B03",
                    "common_name": "green",
                    "description": "Band 3 - Green",
                    "center_wavelength": 0.56,
                    "full_width_half_max": 0.045
                },
                {
                    "name": "B02",
                    "common_name": "blue",
                    "description": "Band 2 - Blue",
                    "center_wavelength": 0.49,
                    "full_width_half_max": 0.098
                }
            ],
            "gsd": null,
            "proj:shape": [
                10980,
                10980
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                10.0,
                0.0,
                199980.0,
                0.0,
                -10.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "AOT-10m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R10m/T22HBD_20210122T133229_AOT_10m.jp2",
            "type": "image/jp2",
            "title": "Aerosol optical thickness (AOT)",
            "gsd": null,
            "proj:shape": [
                10980,
                10980
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                10.0,
                0.0,
                199980.0,
                0.0,
                -10.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "WVP-10m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R10m/T22HBD_20210122T133229_WVP_10m.jp2",
            "type": "image/jp2",
            "title": "Water vapour (WVP)",
            "gsd": null,
            "proj:shape": [
                10980,
                10980
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                10.0,
                0.0,
                199980.0,
                0.0,
                -10.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B02_20m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_B02_20m.jp2",
            "type": "image/jp2",
            "title": "Band 2 - Blue - 20m",
            "eo:bands": [
                {
                    "name": "B02",
                    "common_name": "blue",
                    "description": "Band 2 - Blue",
                    "center_wavelength": 0.49,
                    "full_width_half_max": 0.098
                }
            ],
            "gsd": 10,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B03_20m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_B03_20m.jp2",
            "type": "image/jp2",
            "title": "Band 3 - Green - 20m",
            "eo:bands": [
                {
                    "name": "B03",
                    "common_name": "green",
                    "description": "Band 3 - Green",
                    "center_wavelength": 0.56,
                    "full_width_half_max": 0.045
                }
            ],
            "gsd": 10,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B04_20m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_B04_20m.jp2",
            "type": "image/jp2",
            "title": "Band 4 - Red - 20m",
            "eo:bands": [
                {
                    "name": "B04",
                    "common_name": "red",
                    "description": "Band 4 - Red",
                    "center_wavelength": 0.665,
                    "full_width_half_max": 0.038
                }
            ],
            "gsd": 10,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B05": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_B05_20m.jp2",
            "type": "image/jp2",
            "title": "Band 5 - Vegetation red edge 1 - 20m",
            "eo:bands": [
                {
                    "name": "B05",
                    "common_name": "rededge",
                    "description": "Band 5 - Vegetation red edge 1",
                    "center_wavelength": 0.704,
                    "full_width_half_max": 0.019
                }
            ],
            "gsd": 20,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B06": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_B06_20m.jp2",
            "type": "image/jp2",
            "title": "Band 6 - Vegetation red edge 2 - 20m",
            "eo:bands": [
                {
                    "name": "B06",
                    "common_name": "rededge",
                    "description": "Band 6 - Vegetation red edge 2",
                    "center_wavelength": 0.74,
                    "full_width_half_max": 0.018
                }
            ],
            "gsd": 20,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B07": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_B07_20m.jp2",
            "type": "image/jp2",
            "title": "Band 7 - Vegetation red edge 3 - 20m",
            "eo:bands": [
                {
                    "name": "B07",
                    "common_name": "rededge",
                    "description": "Band 7 - Vegetation red edge 3",
                    "center_wavelength": 0.783,
                    "full_width_half_max": 0.028
                }
            ],
            "gsd": 20,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B8A": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_B8A_20m.jp2",
            "type": "image/jp2",
            "title": "Band 8A - Vegetation red edge 4 - 20m",
            "eo:bands": [
                {
                    "name": "B8A",
                    "common_name": "rededge",
                    "description": "Band 8A - Vegetation red edge 4",
                    "center_wavelength": 0.865,
                    "full_width_half_max": 0.033
                }
            ],
            "gsd": 20,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B11": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_B11_20m.jp2",
            "type": "image/jp2",
            "title": "Band 11 - SWIR (1.6) - 20m",
            "eo:bands": [
                {
                    "name": "B11",
                    "common_name": "swir16",
                    "description": "Band 11 - SWIR (1.6)",
                    "center_wavelength": 1.61,
                    "full_width_half_max": 0.143
                }
            ],
            "gsd": 20,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B12": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_B12_20m.jp2",
            "type": "image/jp2",
            "title": "Band 12 - SWIR (2.2) - 20m",
            "eo:bands": [
                {
                    "name": "B12",
                    "common_name": "swir22",
                    "description": "Band 12 - SWIR (2.2)",
                    "center_wavelength": 2.19,
                    "full_width_half_max": 0.242
                }
            ],
            "gsd": 20,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "visual-20m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_TCI_20m.jp2",
            "type": "image/jp2",
            "title": "True color image",
            "eo:bands": [
                {
                    "name": "B04",
                    "common_name": "red",
                    "description": "Band 4 - Red",
                    "center_wavelength": 0.665,
                    "full_width_half_max": 0.038
                },
                {
                    "name": "B03",
                    "common_name": "green",
                    "description": "Band 3 - Green",
                    "center_wavelength": 0.56,
                    "full_width_half_max": 0.045
                },
                {
                    "name": "B02",
                    "common_name": "blue",
                    "description": "Band 2 - Blue",
                    "center_wavelength": 0.49,
                    "full_width_half_max": 0.098
                }
            ],
            "gsd": null,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "AOT-20m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_AOT_20m.jp2",
            "type": "image/jp2",
            "title": "Aerosol optical thickness (AOT)",
            "gsd": null,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "WVP-20m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_WVP_20m.jp2",
            "type": "image/jp2",
            "title": "Water vapour (WVP)",
            "gsd": null,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "SCL-20m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_SCL_20m.jp2",
            "type": "image/jp2",
            "title": "Scene classfication map (SCL)",
            "gsd": null,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B01": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B01_60m.jp2",
            "type": "image/jp2",
            "title": "Band 1 - Coastal aerosol - 60m",
            "eo:bands": [
                {
                    "name": "B01",
                    "common_name": "coastal",
                    "description": "Band 1 - Coastal aerosol",
                    "center_wavelength": 0.443,
                    "full_width_half_max": 0.027
                }
            ],
            "gsd": 60,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B02_60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B02_60m.jp2",
            "type": "image/jp2",
            "title": "Band 2 - Blue - 60m",
            "eo:bands": [
                {
                    "name": "B02",
                    "common_name": "blue",
                    "description": "Band 2 - Blue",
                    "center_wavelength": 0.49,
                    "full_width_half_max": 0.098
                }
            ],
            "gsd": 10,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B03_60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B03_60m.jp2",
            "type": "image/jp2",
            "title": "Band 3 - Green - 60m",
            "eo:bands": [
                {
                    "name": "B03",
                    "common_name": "green",
                    "description": "Band 3 - Green",
                    "center_wavelength": 0.56,
                    "full_width_half_max": 0.045
                }
            ],
            "gsd": 10,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B04_60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B04_60m.jp2",
            "type": "image/jp2",
            "title": "Band 4 - Red - 60m",
            "eo:bands": [
                {
                    "name": "B04",
                    "common_name": "red",
                    "description": "Band 4 - Red",
                    "center_wavelength": 0.665,
                    "full_width_half_max": 0.038
                }
            ],
            "gsd": 10,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B05_60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B05_60m.jp2",
            "type": "image/jp2",
            "title": "Band 5 - Vegetation red edge 1 - 60m",
            "eo:bands": [
                {
                    "name": "B05",
                    "common_name": "rededge",
                    "description": "Band 5 - Vegetation red edge 1",
                    "center_wavelength": 0.704,
                    "full_width_half_max": 0.019
                }
            ],
            "gsd": 20,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B06_60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B06_60m.jp2",
            "type": "image/jp2",
            "title": "Band 6 - Vegetation red edge 2 - 60m",
            "eo:bands": [
                {
                    "name": "B06",
                    "common_name": "rededge",
                    "description": "Band 6 - Vegetation red edge 2",
                    "center_wavelength": 0.74,
                    "full_width_half_max": 0.018
                }
            ],
            "gsd": 20,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B07_60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B07_60m.jp2",
            "type": "image/jp2",
            "title": "Band 7 - Vegetation red edge 3 - 60m",
            "eo:bands": [
                {
                    "name": "B07",
                    "common_name": "rededge",
                    "description": "Band 7 - Vegetation red edge 3",
                    "center_wavelength": 0.783,
                    "full_width_half_max": 0.028
                }
            ],
            "gsd": 20,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B8A_60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B8A_60m.jp2",
            "type": "image/jp2",
            "title": "Band 8A - Vegetation red edge 4 - 60m",
            "eo:bands": [
                {
                    "name": "B8A",
                    "common_name": "rededge",
                    "description": "Band 8A - Vegetation red edge 4",
                    "center_wavelength": 0.865,
                    "full_width_half_max": 0.033
                }
            ],
            "gsd": 20,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B09": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B09_60m.jp2",
            "type": "image/jp2",
            "title": "Band 9 - Water vapor - 60m",
            "eo:bands": [
                {
                    "name": "B09",
                    "description": "Band 9 - Water vapor",
                    "center_wavelength": 0.945,
                    "full_width_half_max": 0.026
                }
            ],
            "gsd": 60,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B11_60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B11_60m.jp2",
            "type": "image/jp2",
            "title": "Band 11 - SWIR (1.6) - 60m",
            "eo:bands": [
                {
                    "name": "B11",
                    "common_name": "swir16",
                    "description": "Band 11 - SWIR (1.6)",
                    "center_wavelength": 1.61,
                    "full_width_half_max": 0.143
                }
            ],
            "gsd": 20,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B12_60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B12_60m.jp2",
            "type": "image/jp2",
            "title": "Band 12 - SWIR (2.2) - 60m",
            "eo:bands": [
                {
                    "name": "B12",
                    "common_name": "swir22",
                    "description": "Band 12 - SWIR (2.2)",
                    "center_wavelength": 2.19,
                    "full_width_half_max": 0.242
                }
            ],
            "gsd": 20,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "visual-60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_TCI_60m.jp2",
            "type": "image/jp2",
            "title": "True color image",
            "eo:bands": [
                {
                    "name": "B04",
                    "common_name": "red",
                    "description": "Band 4 - Red",
                    "center_wavelength": 0.665,
                    "full_width_half_max": 0.038
                },
                {
                    "name": "B03",
                    "common_name": "green",
                    "description": "Band 3 - Green",
                    "center_wavelength": 0.56,
                    "full_width_half_max": 0.045
                },
                {
                    "name": "B02",
                    "common_name": "blue",
                    "description": "Band 2 - Blue",
                    "center_wavelength": 0.49,
                    "full_width_half_max": 0.098
                }
            ],
            "gsd": null,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "AOT-60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_AOT_60m.jp2",
            "type": "image/jp2",
            "title": "Aerosol optical thickness (AOT)",
            "gsd": null,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "WVP-60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_WVP_60m.jp2",
            "type": "image/jp2",
            "title": "Water vapour (WVP)",
            "gsd": null,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "SCL-60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_SCL_60m.jp2",
            "type": "image/jp2",
            "title": "Scene classfication map (SCL)",
            "gsd": null,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "preview": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/./GRANULE/L2A_T22HBD_A020270_20210122T133224/QI_DATA/T22HBD_20210122T133229_PVI.jp2",
            "type": "image/tiff; application=geotiff; profile=cloud-optimized",
            "roles": [
                "thumbnail"
            ]
        }
    },
    "bbox": [
        -54.41397,
        -38.014598910476074,
        -53.13849,
        -36.99812815291658
    ],
    "stac_extensions": [
        "eo",
        "sat",
        "projection"
    ]
}

@codecov-io
Copy link

codecov-io commented Apr 9, 2021

Codecov Report

Merging #88 (8284d6d) into master (0c66a85) will increase coverage by 0.00%.
The diff coverage is 93.75%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #88   +/-   ##
=======================================
  Coverage   85.25%   85.25%           
=======================================
  Files          81       81           
  Lines        2421     2428    +7     
=======================================
+ Hits         2064     2070    +6     
- Misses        357      358    +1     
Impacted Files Coverage Δ
stactools_sentinel2/stactools/sentinel2/stac.py 88.34% <93.33%> (-0.32%) ⬇️
...actools_sentinel2/stactools/sentinel2/constants.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c66a85...8284d6d. Read the comment docs.

@kylebarron
Copy link
Contributor

kylebarron commented Apr 9, 2021

    "assets": {
        "B02_20m": {
            "gsd": 10,

I don't know the STAC spec perfectly, so you might be right this conforms to the spec, but I'm 👎 on this because it would make it harder for clients to interpret the Item and choose which asset to use. Asset names can be anything, so a client can't parse those directly. If all the B02 assets have the same gsd, then a client might just pick one at random to draw data from, and this makes it easy to choose the wrong asset and load 60m pixelated data unintentionally.

@jonas-eberle
Copy link

I don't know the STAC spec perfectly, so you might be right this conforms to the spec, but I'm 👎 on this because it would make it harder for clients to interpret the Item and choose which asset to use.

I agree with you. It is confusing when the original sensor resolution is mentioned in the asset and not the spatial resolution of the asset itself. If it is clear in the STAC item specification that it is just the sensor resolution, then I would suggest skipping that property here, since the resolution is still available via the transform property.

@lossyrob
Copy link
Member Author

Thanks for the review folks. I agree that the gsd not matching the resolution is confusing. A couple ways forward here are A. to change the spec, and then to update the values here with the GSD which matches the raster spatial resolution and not the sensor value, or B. drop GSD from the asset properties where the spatial resolution doesn't match the sensor ground sample distance. It seems like B is a workaround that ends up choosing not to encapsulate valid information, which makes me suspect of the value of the property itself as defined in the spec - are people are looking at gsd as the raster spatial resolution, and not interested in the sensor gsd, and because gsd is in "common metadata" it's in practice overloaded for spatial resolution effectively? I think this is worth an issue against the 1.0 RC for the STAC spec, as it's in common metadata and if is causing confusion/being used differently then we should figure out how best to use that property.

@matthewhanson
Copy link
Member

See the stac-spec issue on this: radiantearth/stac-spec#1096

Ok, we just discussed this when pushing on an rc.3 release and here's what we concluded:

  • gsd should be defined in Item properties and represent the best resolution of the sensor
  • if you want to specify resolution of an asset it is strongly encouraged that you use the projection extension and include the proj:transform field as it's much more complete and useful than gsd alone. The proj:transform field is clearly defined to be the pixel size within the asset itself, and this is what clients should use.

We think, as Best Practice, gsd should not be included on assets. But the question still remains, if you do include it on an asset what does it mean?

My originally intention with gsd when it was in the EO extension was to have it be the resolution in the file, even if it has been resampled, and I would lean toward that still because I think that's what the majority of folks would expect it to be when looking at the metadata.

@lossyrob
Copy link
Member Author

Thanks @matthewhanson. While it's true the resolution is on the proj transform, it might be a bit harder to parse out for folks, which made the gsd more attractive. Also if the projection doesn't match a distance unit, there wouldn't be a sense of the spatial resolution in meters. It also seems like valuable enough information to put per-asset that some instances are baking in the meter resolution into the asset keys, as I'm doing here....

I'm not too attached to gsd on assets though, so taking the guidance it seems like the work left on this PR is to add the gsd of 10m onto the Item properties and removing gsd from all assets.

@kylebarron
Copy link
Contributor

kylebarron commented Apr 23, 2021

  • include the proj:transform field as it's much more complete and useful than gsd alone. The proj:transform field is clearly defined to be the pixel size within the asset itself, and this is what clients should use

Also if the projection doesn't match a distance unit, there wouldn't be a sense of the spatial resolution in meters

For the web, in my opinion, proj:transform isn't amazing because you have to understand the EPSG code, and it's undesirable to bring in more dependencies just to parse that. In a few special cases you might be able to tell the asset is in UTM, and then interpret the transform accordingly, but in general seems hard to parse the transform to gsd when you don't have the GDAL/PROJ ecosystem at your fingertips.

@cholmes
Copy link
Contributor

cholmes commented Apr 23, 2021

For the web, in my opinion, proj:transform isn't amazing because you have to understand the EPSG code, and it's undesirable to bring in more dependencies just to parse that.

Ah, that's a fair point - indeed I was thinking you may have a good reason why just proj:transform wouldn't work. I'm convinced we should have 'something' here then.

I see two options:

  1. We let gsd have a slightly different meaning if it's used at the asset level. If it's on properties it's the sensor, if it's on assets it's the processing.
  2. We have a new field for 'spatial resolution' (not sure the right name) that is not about the sensor, but the processing. Having it in the new raster extension seems like a fairly logical place to have it start, or we could have it in EO.

I don't love the first option, having to know the context of it to understand exactly what it means. Matt pointed out that our created and updated fields do have that - on the properties they're about when the STAC json changed, and on assets they're when the asset changed. But that one is way more intuitive, this seems more of a stretch to me.

The second might be interesting, indeed the gsd definition in STAC points to an alternate value - if there was a 'resolution' field Planet could use it to say 3.125, and then have a gsd of 3.7.

Thoughts? Second option seems good to me, but I'm probably missing something obvious...

@cholmes
Copy link
Contributor

cholmes commented Apr 26, 2021

Ok, we discussed this extensively on the call today. The tl;dr conclusion is to go with option 2), with a new field called raster:spatial_resolution in the new raster extension.

We'll keep the main gsd definition, and recommend that people not use it at the asset level unless it is actually describing a sensor with a different resolution - aster is one that may make sense to do this for. And raster:spatial_resolution should be used for any upsampling / downsampling of information.

There was debate on if it should be actual pixel sizes, in an array, for times when those might be different. But the conclusion was use the proj extension for that, and this should be a single value in meters, representing the meters per pixel the raster was processed to. So this should be as easy to use as the gsd field. So for the example that this issue started with, we would just replace raster:spatial_resolution for gsd at the asset level, using the 20m and 60m values for the downsampled ones. It could also include the gsd, which would be 10m for all of them (but doing that is optional, since that would be captured at the properties level as well).

@lossyrob
Copy link
Member Author

Instead of waiting for the spatial_resolution in the raster extension, I think this should be good to go with the last change I pushed up, which removes GSD from assets in which the spatial_resolution does not match the GSD.

Latest Item example
{
    "type": "Feature",
    "stac_version": "1.0.0-beta.2",
    "id": "S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE",
    "properties": {
        "providers": [
            {
                "name": "ESA",
                "roles": [
                    "producer",
                    "processor",
                    "licensor"
                ],
                "url": "https://earth.esa.int/web/guest/home"
            }
        ],
        "platform": "Sentinel-2B",
        "constellation": "Sentinel 2",
        "instruments": [
            "msi"
        ],
        "eo:cloud_cover": 0.447807,
        "sat:orbit_state": "descending",
        "sat:relative_orbit": 81,
        "proj:epsg": 32722,
        "s2:product_uri": "S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE",
        "s2:generation_time": "2021-01-22T15:55:00.000000Z",
        "s2:processing_baseline": "02.14",
        "s2:product_type": "S2MSI2A",
        "s2:datatake_id": "GS2B_20210122T133229_020270_N02.14",
        "s2:datatake_type": "INS-NOBS",
        "s2:datastrip_id": "S2B_OPER_MSI_L2A_DS_VGS2_20210122T155500_S20210122T133224_N02.14",
        "s2:granule_id": "S2B_OPER_MSI_L2A_TL_VGS2_20210122T155500_A020270_T22HBD_N02.14",
        "s2:mgrs_tile": "22HBD",
        "s2:reflectance_conversion_factor": 1.03305092950356,
        "s2:degraded_msi_data_percentage": 0.0,
        "s2:nodata_pixel_percentage": 0.913129,
        "s2:saturated_defective_pixel_percentage": 0.0,
        "s2:dark_features_percentage": 0.0,
        "s2:cloud_shadow_percentage": 0.0,
        "s2:vegetation_percentage": 3e-05,
        "s2:not_vegetated_percentage": 0.0,
        "s2:water_percentage": 99.552161,
        "s2:unclassified_percentage": 0.0,
        "s2:medium_proba_clouds_percentage": 0.308523,
        "s2:high_proba_clouds_percentage": 0.137727,
        "s2:thin_sirrus_percentage": 0.001557,
        "s2:snow_ice_percentage": 0.0,
        "s2:mean_solar_zenith": 32.3712311857264,
        "s2:mean_solar_azimuth": 64.9495240978383,
        "datetime": "2021-01-22T13:32:29.024000Z"
    },
    "geometry": {
        "type": "Polygon",
        "coordinates": [
            [
                [
                    -54.140594,
                    -37.992633567956354
                ],
                [
                    -54.36606,
                    -37.94656022356872
                ],
                [
                    -54.36615,
                    -37.94688023507225
                ],
                [
                    -54.36624,
                    -37.94686630132775
                ],
                [
                    -54.366302,
                    -37.94713307472404
                ],
                [
                    -54.366608,
                    -37.94706907623826
                ],
                [
                    -54.367493,
                    -37.94996854053076
                ],
                [
                    -54.39499,
                    -37.944374799703326
                ],
                [
                    -54.41397,
                    -37.94049216728527
                ],
                [
                    -54.371307,
                    -36.99812815291658
                ],
                [
                    -53.13849,
                    -37.02676719440734
                ],
                [
                    -53.161438,
                    -37.825301614522395
                ],
                [
                    -53.193024,
                    -37.93500445123628
                ],
                [
                    -53.215973,
                    -38.014598910476074
                ],
                [
                    -54.140594,
                    -37.992633567956354
                ]
            ]
        ]
    },
    "links": [
        {
            "rel": "license",
            "href": "https://sentinel.esa.int/documents/247904/690755/Sentinel_Data_Legal_Notice"
        },
        {
            "rel": "self",
            "href": "/opt/src/s2-item.json",
            "type": "application/json"
        }
    ],
    "assets": {
        "safe-manifest": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/manifest.safe",
            "type": "application/xml",
            "roles": [
                "metadata"
            ]
        },
        "product-metadata": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/./MTD_MSIL2A.xml",
            "type": "application/xml",
            "roles": [
                "metadata"
            ]
        },
        "granule-metadata": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/./GRANULE/L2A_T22HBD_A020270_20210122T133224/MTD_TL.xml",
            "type": "application/xml",
            "roles": [
                "metadata"
            ]
        },
        "inspire-metadata": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/./INSPIRE.xml",
            "type": "application/xml",
            "roles": [
                "metadata"
            ]
        },
        "datastrip-metadata": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/./DATASTRIP/DS_VGS2_20210122T155500_S20210122T133224/MTD_DS.xml",
            "type": "application/xml",
            "roles": [
                "metadata"
            ]
        },
        "B02": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R10m/T22HBD_20210122T133229_B02_10m.jp2",
            "type": "image/jp2",
            "title": "Band 2 - Blue - 10m",
            "eo:bands": [
                {
                    "name": "B02",
                    "common_name": "blue",
                    "description": "Band 2 - Blue",
                    "center_wavelength": 0.49,
                    "full_width_half_max": 0.098
                }
            ],
            "gsd": 10,
            "proj:shape": [
                10980,
                10980
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                10.0,
                0.0,
                199980.0,
                0.0,
                -10.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B03": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R10m/T22HBD_20210122T133229_B03_10m.jp2",
            "type": "image/jp2",
            "title": "Band 3 - Green - 10m",
            "eo:bands": [
                {
                    "name": "B03",
                    "common_name": "green",
                    "description": "Band 3 - Green",
                    "center_wavelength": 0.56,
                    "full_width_half_max": 0.045
                }
            ],
            "gsd": 10,
            "proj:shape": [
                10980,
                10980
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                10.0,
                0.0,
                199980.0,
                0.0,
                -10.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B04": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R10m/T22HBD_20210122T133229_B04_10m.jp2",
            "type": "image/jp2",
            "title": "Band 4 - Red - 10m",
            "eo:bands": [
                {
                    "name": "B04",
                    "common_name": "red",
                    "description": "Band 4 - Red",
                    "center_wavelength": 0.665,
                    "full_width_half_max": 0.038
                }
            ],
            "gsd": 10,
            "proj:shape": [
                10980,
                10980
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                10.0,
                0.0,
                199980.0,
                0.0,
                -10.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B08": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R10m/T22HBD_20210122T133229_B08_10m.jp2",
            "type": "image/jp2",
            "title": "Band 8 - NIR - 10m",
            "eo:bands": [
                {
                    "name": "B08",
                    "common_name": "nir",
                    "description": "Band 8 - NIR",
                    "center_wavelength": 0.842,
                    "full_width_half_max": 0.145
                }
            ],
            "gsd": 10,
            "proj:shape": [
                10980,
                10980
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                10.0,
                0.0,
                199980.0,
                0.0,
                -10.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "visual-10m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R10m/T22HBD_20210122T133229_TCI_10m.jp2",
            "type": "image/jp2",
            "title": "True color image",
            "eo:bands": [
                {
                    "name": "B04",
                    "common_name": "red",
                    "description": "Band 4 - Red",
                    "center_wavelength": 0.665,
                    "full_width_half_max": 0.038
                },
                {
                    "name": "B03",
                    "common_name": "green",
                    "description": "Band 3 - Green",
                    "center_wavelength": 0.56,
                    "full_width_half_max": 0.045
                },
                {
                    "name": "B02",
                    "common_name": "blue",
                    "description": "Band 2 - Blue",
                    "center_wavelength": 0.49,
                    "full_width_half_max": 0.098
                }
            ],
            "gsd": null,
            "proj:shape": [
                10980,
                10980
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                10.0,
                0.0,
                199980.0,
                0.0,
                -10.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "AOT-10m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R10m/T22HBD_20210122T133229_AOT_10m.jp2",
            "type": "image/jp2",
            "title": "Aerosol optical thickness (AOT)",
            "gsd": null,
            "proj:shape": [
                10980,
                10980
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                10.0,
                0.0,
                199980.0,
                0.0,
                -10.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "WVP-10m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R10m/T22HBD_20210122T133229_WVP_10m.jp2",
            "type": "image/jp2",
            "title": "Water vapour (WVP)",
            "gsd": null,
            "proj:shape": [
                10980,
                10980
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                10.0,
                0.0,
                199980.0,
                0.0,
                -10.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B02_20m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_B02_20m.jp2",
            "type": "image/jp2",
            "title": "Band 2 - Blue - 20m",
            "eo:bands": [
                {
                    "name": "B02",
                    "common_name": "blue",
                    "description": "Band 2 - Blue",
                    "center_wavelength": 0.49,
                    "full_width_half_max": 0.098
                }
            ],
            "gsd": 10,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B03_20m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_B03_20m.jp2",
            "type": "image/jp2",
            "title": "Band 3 - Green - 20m",
            "eo:bands": [
                {
                    "name": "B03",
                    "common_name": "green",
                    "description": "Band 3 - Green",
                    "center_wavelength": 0.56,
                    "full_width_half_max": 0.045
                }
            ],
            "gsd": 10,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B04_20m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_B04_20m.jp2",
            "type": "image/jp2",
            "title": "Band 4 - Red - 20m",
            "eo:bands": [
                {
                    "name": "B04",
                    "common_name": "red",
                    "description": "Band 4 - Red",
                    "center_wavelength": 0.665,
                    "full_width_half_max": 0.038
                }
            ],
            "gsd": 10,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B05": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_B05_20m.jp2",
            "type": "image/jp2",
            "title": "Band 5 - Vegetation red edge 1 - 20m",
            "eo:bands": [
                {
                    "name": "B05",
                    "common_name": "rededge",
                    "description": "Band 5 - Vegetation red edge 1",
                    "center_wavelength": 0.704,
                    "full_width_half_max": 0.019
                }
            ],
            "gsd": 20,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B06": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_B06_20m.jp2",
            "type": "image/jp2",
            "title": "Band 6 - Vegetation red edge 2 - 20m",
            "eo:bands": [
                {
                    "name": "B06",
                    "common_name": "rededge",
                    "description": "Band 6 - Vegetation red edge 2",
                    "center_wavelength": 0.74,
                    "full_width_half_max": 0.018
                }
            ],
            "gsd": 20,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B07": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_B07_20m.jp2",
            "type": "image/jp2",
            "title": "Band 7 - Vegetation red edge 3 - 20m",
            "eo:bands": [
                {
                    "name": "B07",
                    "common_name": "rededge",
                    "description": "Band 7 - Vegetation red edge 3",
                    "center_wavelength": 0.783,
                    "full_width_half_max": 0.028
                }
            ],
            "gsd": 20,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B8A": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_B8A_20m.jp2",
            "type": "image/jp2",
            "title": "Band 8A - Vegetation red edge 4 - 20m",
            "eo:bands": [
                {
                    "name": "B8A",
                    "common_name": "rededge",
                    "description": "Band 8A - Vegetation red edge 4",
                    "center_wavelength": 0.865,
                    "full_width_half_max": 0.033
                }
            ],
            "gsd": 20,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B11": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_B11_20m.jp2",
            "type": "image/jp2",
            "title": "Band 11 - SWIR (1.6) - 20m",
            "eo:bands": [
                {
                    "name": "B11",
                    "common_name": "swir16",
                    "description": "Band 11 - SWIR (1.6)",
                    "center_wavelength": 1.61,
                    "full_width_half_max": 0.143
                }
            ],
            "gsd": 20,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B12": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_B12_20m.jp2",
            "type": "image/jp2",
            "title": "Band 12 - SWIR (2.2) - 20m",
            "eo:bands": [
                {
                    "name": "B12",
                    "common_name": "swir22",
                    "description": "Band 12 - SWIR (2.2)",
                    "center_wavelength": 2.19,
                    "full_width_half_max": 0.242
                }
            ],
            "gsd": 20,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "visual-20m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_TCI_20m.jp2",
            "type": "image/jp2",
            "title": "True color image",
            "eo:bands": [
                {
                    "name": "B04",
                    "common_name": "red",
                    "description": "Band 4 - Red",
                    "center_wavelength": 0.665,
                    "full_width_half_max": 0.038
                },
                {
                    "name": "B03",
                    "common_name": "green",
                    "description": "Band 3 - Green",
                    "center_wavelength": 0.56,
                    "full_width_half_max": 0.045
                },
                {
                    "name": "B02",
                    "common_name": "blue",
                    "description": "Band 2 - Blue",
                    "center_wavelength": 0.49,
                    "full_width_half_max": 0.098
                }
            ],
            "gsd": null,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "AOT-20m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_AOT_20m.jp2",
            "type": "image/jp2",
            "title": "Aerosol optical thickness (AOT)",
            "gsd": null,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "WVP-20m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_WVP_20m.jp2",
            "type": "image/jp2",
            "title": "Water vapour (WVP)",
            "gsd": null,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "SCL-20m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R20m/T22HBD_20210122T133229_SCL_20m.jp2",
            "type": "image/jp2",
            "title": "Scene classfication map (SCL)",
            "gsd": null,
            "proj:shape": [
                5490,
                5490
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                20.0,
                0.0,
                199980.0,
                0.0,
                -20.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B01": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B01_60m.jp2",
            "type": "image/jp2",
            "title": "Band 1 - Coastal aerosol - 60m",
            "eo:bands": [
                {
                    "name": "B01",
                    "common_name": "coastal",
                    "description": "Band 1 - Coastal aerosol",
                    "center_wavelength": 0.443,
                    "full_width_half_max": 0.027
                }
            ],
            "gsd": 60,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B02_60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B02_60m.jp2",
            "type": "image/jp2",
            "title": "Band 2 - Blue - 60m",
            "eo:bands": [
                {
                    "name": "B02",
                    "common_name": "blue",
                    "description": "Band 2 - Blue",
                    "center_wavelength": 0.49,
                    "full_width_half_max": 0.098
                }
            ],
            "gsd": 10,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B03_60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B03_60m.jp2",
            "type": "image/jp2",
            "title": "Band 3 - Green - 60m",
            "eo:bands": [
                {
                    "name": "B03",
                    "common_name": "green",
                    "description": "Band 3 - Green",
                    "center_wavelength": 0.56,
                    "full_width_half_max": 0.045
                }
            ],
            "gsd": 10,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B04_60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B04_60m.jp2",
            "type": "image/jp2",
            "title": "Band 4 - Red - 60m",
            "eo:bands": [
                {
                    "name": "B04",
                    "common_name": "red",
                    "description": "Band 4 - Red",
                    "center_wavelength": 0.665,
                    "full_width_half_max": 0.038
                }
            ],
            "gsd": 10,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B05_60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B05_60m.jp2",
            "type": "image/jp2",
            "title": "Band 5 - Vegetation red edge 1 - 60m",
            "eo:bands": [
                {
                    "name": "B05",
                    "common_name": "rededge",
                    "description": "Band 5 - Vegetation red edge 1",
                    "center_wavelength": 0.704,
                    "full_width_half_max": 0.019
                }
            ],
            "gsd": 20,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B06_60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B06_60m.jp2",
            "type": "image/jp2",
            "title": "Band 6 - Vegetation red edge 2 - 60m",
            "eo:bands": [
                {
                    "name": "B06",
                    "common_name": "rededge",
                    "description": "Band 6 - Vegetation red edge 2",
                    "center_wavelength": 0.74,
                    "full_width_half_max": 0.018
                }
            ],
            "gsd": 20,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B07_60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B07_60m.jp2",
            "type": "image/jp2",
            "title": "Band 7 - Vegetation red edge 3 - 60m",
            "eo:bands": [
                {
                    "name": "B07",
                    "common_name": "rededge",
                    "description": "Band 7 - Vegetation red edge 3",
                    "center_wavelength": 0.783,
                    "full_width_half_max": 0.028
                }
            ],
            "gsd": 20,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B8A_60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B8A_60m.jp2",
            "type": "image/jp2",
            "title": "Band 8A - Vegetation red edge 4 - 60m",
            "eo:bands": [
                {
                    "name": "B8A",
                    "common_name": "rededge",
                    "description": "Band 8A - Vegetation red edge 4",
                    "center_wavelength": 0.865,
                    "full_width_half_max": 0.033
                }
            ],
            "gsd": 20,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B09": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B09_60m.jp2",
            "type": "image/jp2",
            "title": "Band 9 - Water vapor - 60m",
            "eo:bands": [
                {
                    "name": "B09",
                    "description": "Band 9 - Water vapor",
                    "center_wavelength": 0.945,
                    "full_width_half_max": 0.026
                }
            ],
            "gsd": 60,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B11_60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B11_60m.jp2",
            "type": "image/jp2",
            "title": "Band 11 - SWIR (1.6) - 60m",
            "eo:bands": [
                {
                    "name": "B11",
                    "common_name": "swir16",
                    "description": "Band 11 - SWIR (1.6)",
                    "center_wavelength": 1.61,
                    "full_width_half_max": 0.143
                }
            ],
            "gsd": 20,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "B12_60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_B12_60m.jp2",
            "type": "image/jp2",
            "title": "Band 12 - SWIR (2.2) - 60m",
            "eo:bands": [
                {
                    "name": "B12",
                    "common_name": "swir22",
                    "description": "Band 12 - SWIR (2.2)",
                    "center_wavelength": 2.19,
                    "full_width_half_max": 0.242
                }
            ],
            "gsd": 20,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "visual-60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_TCI_60m.jp2",
            "type": "image/jp2",
            "title": "True color image",
            "eo:bands": [
                {
                    "name": "B04",
                    "common_name": "red",
                    "description": "Band 4 - Red",
                    "center_wavelength": 0.665,
                    "full_width_half_max": 0.038
                },
                {
                    "name": "B03",
                    "common_name": "green",
                    "description": "Band 3 - Green",
                    "center_wavelength": 0.56,
                    "full_width_half_max": 0.045
                },
                {
                    "name": "B02",
                    "common_name": "blue",
                    "description": "Band 2 - Blue",
                    "center_wavelength": 0.49,
                    "full_width_half_max": 0.098
                }
            ],
            "gsd": null,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "AOT-60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_AOT_60m.jp2",
            "type": "image/jp2",
            "title": "Aerosol optical thickness (AOT)",
            "gsd": null,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "WVP-60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_WVP_60m.jp2",
            "type": "image/jp2",
            "title": "Water vapour (WVP)",
            "gsd": null,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "SCL-60m": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/GRANULE/L2A_T22HBD_A020270_20210122T133224/IMG_DATA/R60m/T22HBD_20210122T133229_SCL_60m.jp2",
            "type": "image/jp2",
            "title": "Scene classfication map (SCL)",
            "gsd": null,
            "proj:shape": [
                1830,
                1830
            ],
            "proj:bbox": [
                199980.0,
                5790220.0,
                309780.0,
                5900020.0
            ],
            "proj:transform": [
                60.0,
                0.0,
                199980.0,
                0.0,
                -60.0,
                5900020.0
            ],
            "roles": [
                "data"
            ]
        },
        "preview": {
            "href": "/opt/src/tests/data-files/sentinel2/esa_S2B_MSIL2A_20210122T133229_N0214_R081_T22HBD_20210122T155500.SAFE/./GRANULE/L2A_T22HBD_A020270_20210122T133224/QI_DATA/T22HBD_20210122T133229_PVI.jp2",
            "type": "image/tiff; application=geotiff; profile=cloud-optimized",
            "roles": [
                "thumbnail"
            ]
        }
    },
    "bbox": [
        -54.41397,
        -38.014598910476074,
        -53.13849,
        -36.99812815291658
    ],
    "stac_extensions": [
        "eo",
        "sat",
        "projection"
    ]
}

@gadomski gadomski merged commit 0e7509b into master May 27, 2021
@gadomski gadomski deleted the fix/rde/s2-bands branch May 27, 2021 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sentinel-2 band assets with multiple spatial resolutions
8 participants