STAC#
Let’s use EOReader to create SpatioTemporal Asset Catalog (STAC) items.
Note: This is experimental for now, use it at your own risk !
Warning:
You will need to install pystac[validation]
,
folium
and eodag
(version != 2.6.0) to run this notebook
Imports#
# Imports
import os
import pystac
import geopandas as gpd
from tempfile import TemporaryDirectory
from shapely.geometry import mapping
from eodag import setup_logging
from eodag.api.core import EODataAccessGateway
from eoreader.reader import Reader
Create logger#
# Create logger
import logging
from sertit import logs
logger = logging.getLogger("eoreader")
logs.init_logger(logger)
Linking some data#
Let’s take 3 products covering approximately the same area (over DAX city in France):
One Landsat-8 OLI-TIRS collection 2
One Landsat-5 TM collection 2
One Sentinel-2 L1C
prod_folder = os.path.join("/home", "data", "DATA", "PRODS")
paths = [
# Landsat-8 OLI-TIRS collection 2
os.path.join(prod_folder, "LANDSATS_COL2", "LC08_L1TP_200030_20201220_20210310_02_T1.tar"),
# Landsat-5 TM collection 2
os.path.join(prod_folder, "LANDSATS_COL2", "LT05_L1TP_200030_20111110_20200820_02_T1.tar"),
# Sentinel-2 L2A
os.path.join(prod_folder, "S2", "PB 02.07+", "S2A_MSIL1C_20191215T110441_N0208_R094_T30TXP_20191215T114155.SAFE"),
]
Create STAC catalog#
Create a STAC catalog and add 3 STAC items to it.
# Create the reader
reader = Reader()
# Work in a temporary directory
tmp = TemporaryDirectory()
# Create STAC catalog
catalog_path = os.path.join(tmp.name, "catalog.json")
catalog = pystac.Catalog(
id='SERTIT_101',
description="SERTIT's Catalog",
title='SERTIT Catalog',
href=catalog_path
)
# Add all the products into the STAC catalog
for path in paths:
logger.info(f"*** {os.path.basename(path)} ***")
# Open the product
prod = reader.open(path, remove_tmp=True)
# Get item
item = prod.stac.create_item()
# Add item to catalogue
catalog.add_item(item)
2023-11-02 14:48:59,420 - [INFO] - *** LC08_L1TP_200030_20201220_20210310_02_T1.tar ***
2023-11-02 14:49:03,568 - [WARNING] - No quicklook found in 20201220T104856_L8_200030_OLI_TIRS
2023-11-02 14:49:04,214 - [INFO] - *** LT05_L1TP_200030_20111110_20200820_02_T1.tar ***
2023-11-02 14:49:06,214 - [INFO] - *** S2A_MSIL1C_20191215T110441_N0208_R094_T30TXP_20191215T114155.SAFE ***
# Save catalog
catalog.describe()
catalog.normalize_and_save(tmp.name, catalog_type=pystac.CatalogType.SELF_CONTAINED)
* <Catalog id=SERTIT_101>
* <Item id=20201220T104856_L8_200030_OLI_TIRS>
* <Item id=20111110T103612_L5_200030_TM>
* <Item id=20191215T110441_S2_T30TXP_L1C_114155>
list(catalog.get_items())[0]
- type "Feature"
- stac_version "1.0.0"
- id "20201220T104856_L8_200030_OLI_TIRS"
properties
- tilename "200030"
- eo:cloud_cover 16.36
- proj:epsg 32630
- proj:wkt2 "PROJCS["WGS 84 / UTM zone 30N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","32630"]]"
proj:geometry
- type "Polygon"
coordinates [] 1 items
0 [] 38 items
0 [] 2 items
- 0 704535.0
- 1 4665915.0
1 [] 2 items
- 0 703755.0
- 1 4666095.0
2 [] 2 items
- 0 690465.0
- 1 4669185.0
3 [] 2 items
- 0 630855.0
- 1 4683045.0
4 [] 2 items
- 0 526215.0
- 1 4707375.0
5 [] 2 items
- 0 523635.0
- 1 4707975.0
6 [] 2 items
- 0 523125.0
- 1 4708095.0
7 [] 2 items
- 0 523005.0
- 1 4708125.0
8 [] 2 items
- 0 522945.0
- 1 4708155.0
9 [] 2 items
- 0 522945.0
- 1 4708275.0
10 [] 2 items
- 0 522975.0
- 1 4708425.0
11 [] 2 items
- 0 523185.0
- 1 4709355.0
12 [] 2 items
- 0 566355.0
- 1 4898205.0
13 [] 2 items
- 0 566445.0
- 1 4898595.0
14 [] 2 items
- 0 566475.0
- 1 4898715.0
15 [] 2 items
- 0 566505.0
- 1 4898715.0
16 [] 2 items
- 0 567045.0
- 1 4898595.0
17 [] 2 items
- 0 567975.0
- 1 4898385.0
18 [] 2 items
- 0 573405.0
- 1 4897155.0
19 [] 2 items
- 0 586515.0
- 1 4894185.0
20 [] 2 items
- 0 697485.0
- 1 4869045.0
21 [] 2 items
- 0 748335.0
- 1 4857525.0
22 [] 2 items
- 0 748575.0
- 1 4857465.0
23 [] 2 items
- 0 748575.0
- 1 4857375.0
24 [] 2 items
- 0 748455.0
- 1 4856835.0
25 [] 2 items
- 0 747285.0
- 1 4851675.0
26 [] 2 items
- 0 747135.0
- 1 4851015.0
27 [] 2 items
- 0 745305.0
- 1 4842975.0
28 [] 2 items
- 0 744675.0
- 1 4840215.0
29 [] 2 items
- 0 742125.0
- 1 4829055.0
30 [] 2 items
- 0 741315.0
- 1 4825515.0
31 [] 2 items
- 0 739995.0
- 1 4819755.0
32 [] 2 items
- 0 738825.0
- 1 4814655.0
33 [] 2 items
- 0 729945.0
- 1 4775955.0
34 [] 2 items
- 0 705225.0
- 1 4668735.0
35 [] 2 items
- 0 704685.0
- 1 4666395.0
36 [] 2 items
- 0 704565.0
- 1 4665915.0
37 [] 2 items
- 0 704535.0
- 1 4665915.0
proj:bbox [] 4 items
- 0 521085.0
- 1 4664985.0
- 2 751515.0
- 3 4899315.0
proj:centroid
- lat 43.183607660455536
- lon -1.3295876133318103
proj:shape [] 2 items
- 0 7811
- 1 7681
proj:transform [] 9 items
- 0 30.0
- 1 0.0
- 2 521085.0
- 3 0.0
- 4 -30.0
- 5 4899315.0
- 6 0.0
- 7 0.0
- 8 1.0
- view:sun_azimuth 161.76832577
- view:sun_elevation 68.76909132
- title "20201220T104856_L8_200030_OLI_TIRS"
- description "No description available"
- created "2023-11-02T14:49:03.641851Z"
- updated "2023-11-02T14:49:03.641861Z"
- start_datetime "2020-12-20T10:48:56Z"
- end_datetime "2020-12-20T10:48:56Z"
instruments [] 1 items
- 0 "OLI-TIRS"
- constellation "landsat-8"
- gsd 30.0
- datetime "2020-12-20T10:48:56Z"
geometry
- type "Polygon"
coordinates [] 1 items
0 [] 38 items
0 [] 2 items
- 0 -0.5257721442427716
- 1 42.11867021947156
1 [] 2 items
- 0 -0.53513640800301
- 1 42.120492891025584
2 [] 2 items
- 0 -0.6947690400264263
- 1 42.15164048628753
3 [] 2 items
- 0 -1.4127880648104656
- 1 42.28864791606437
4 [] 2 items
- 0 -2.6808583122777816
- 1 42.518305124564385
5 [] 2 items
- 0 -2.712242059444966
- 1 42.523791726024534
6 [] 2 items
- 0 -2.7184464223068505
- 1 42.52488783683325
7 [] 2 items
- 0 -2.719906233168643
- 1 42.52516158897307
8 [] 2 items
- 0 -2.720635541529546
- 1 42.52543354406634
9 [] 2 items
- 0 -2.720630726301183
- 1 42.526514231852744
10 [] 2 items
- 0 -2.7202594350822302
- 1 42.52786420023843
11 [] 2 items
- 0 -2.7176648128543817
- 1 42.53623324954717
12 [] 2 items
- 0 -2.169091178236048
- 1 44.23405498280795
13 [] 2 items
- 0 -2.1679148250686007
- 1 44.23755763269748
14 [] 2 items
- 0 -2.167523945041018
- 1 44.238635157453494
15 [] 2 items
- 0 -2.1671482900725656
- 1 44.23863241913889
16 [] 2 items
- 0 -2.160401872211217
- 1 44.2375026584875
17 [] 2 items
- 0 -2.1487840927522264
- 1 44.23552602264769
18 [] 2 items
- 0 -2.080967686499834
- 1 44.22392670072793
19 [] 2 items
- 0 -1.9173469656964803
- 1 44.19575376924487
20 [] 2 items
- 0 -0.5389745349691696
- 1 43.948029298314694
21 [] 2 items
- 0 0.08852945578784056
- 1 43.829063241061384
22 [] 2 items
- 0 0.09148216498872173
- 1 43.828443135837155
23 [] 2 items
- 0 0.09144036204853527
- 1 43.827633976897175
24 [] 2 items
- 0 0.08969944706596057
- 1 43.822819354198174
25 [] 2 items
- 0 0.07278964438778793
- 1 43.77681882314968
26 [] 2 items
- 0 0.07062444021986937
- 1 43.7709348921475
27 [] 2 items
- 0 0.044250999738701065
- 1 43.69925410652834
28 [] 2 items
- 0 0.03519076985731035
- 1 43.674645853503
29 [] 2 items
- 0 -0.0013956191453797012
- 1 43.57513331934392
30 [] 2 items
- 0 -0.01298797638838677
- 1 43.543564389891124
31 [] 2 items
- 0 -0.03184757736291297
- 1 43.4921950647179
32 [] 2 items
- 0 -0.04853306393917747
- 1 43.44670850445551
33 [] 2 items
- 0 -0.17430296264350253
- 1 43.10143406279936
34 [] 2 items
- 0 -0.5164412323805064
- 1 42.14386431506819
35 [] 2 items
- 0 -0.5237909963149087
- 1 42.12295015525843
36 [] 2 items
- 0 -0.5254095665105432
- 1 42.11866239601142
37 [] 2 items
- 0 -0.5257721442427716
- 1 42.11867021947156
links [] 3 items
0
- rel "root"
- href "/tmp/tmpjupgyero/catalog.json"
- type "application/json"
- title "SERTIT Catalog"
1
- rel "self"
- href "/tmp/tmpjupgyero/20201220T104856_L8_200030_OLI_TIRS/20201220T104856_L8_200030_OLI_TIRS.json"
- type "application/json"
2
- rel "parent"
- href "/tmp/tmpjupgyero/catalog.json"
- type "application/json"
- title "SERTIT Catalog"
assets
Coastal aerosol
- href "/vsitar//home/data/DATA/PRODS/LANDSATS_COL2/LC08_L1TP_200030_20201220_20210310_02_T1.tar/LC08_L1TP_200030_20201220_20210310_02_T1_B1.TIF"
- type "image/tiff; application=geotiff"
- title "Coastal aerosol"
- description "Coastal and aerosol studies"
- eoreader_name "COASTAL_AEROSOL"
eo:bands [] 1 items
0
- name "Coastal aerosol"
- common_name "coastal"
- description "Coastal and aerosol studies"
- center_wavelength 0.44
- full_width_half_max 0.02
- created "2023-11-02T14:49:03.641151Z"
- updated "2023-11-02T14:49:03.641176Z"
- start_datetime "2020-12-20T10:48:56Z"
- end_datetime "2020-12-20T10:48:56Z"
instruments [] 1 items
- 0 "OLI-TIRS"
- constellation "landsat-8"
- gsd 30
roles [] 1 items
- 0 "reflectance"
Blue
- href "/vsitar//home/data/DATA/PRODS/LANDSATS_COL2/LC08_L1TP_200030_20201220_20210310_02_T1.tar/LC08_L1TP_200030_20201220_20210310_02_T1_B2.TIF"
- type "image/tiff; application=geotiff"
- title "Blue"
- description "Bathymetric mapping, distinguishing soil from vegetation and deciduous from coniferous vegetation"
- eoreader_name "BLUE"
eo:bands [] 1 items
0
- name "Blue"
- common_name "blue"
- description "Bathymetric mapping, distinguishing soil from vegetation and deciduous from coniferous vegetation"
- center_wavelength 0.48
- full_width_half_max 0.06
- created "2023-11-02T14:49:03.641242Z"
- updated "2023-11-02T14:49:03.641249Z"
- start_datetime "2020-12-20T10:48:56Z"
- end_datetime "2020-12-20T10:48:56Z"
instruments [] 1 items
- 0 "OLI-TIRS"
- constellation "landsat-8"
- gsd 30
roles [] 1 items
- 0 "reflectance"
Green
- href "/vsitar//home/data/DATA/PRODS/LANDSATS_COL2/LC08_L1TP_200030_20201220_20210310_02_T1.tar/LC08_L1TP_200030_20201220_20210310_02_T1_B3.TIF"
- type "image/tiff; application=geotiff"
- title "Green"
- description "Emphasizes peak vegetation, which is useful for assessing plant vigor"
- eoreader_name "GREEN"
eo:bands [] 1 items
0
- name "Green"
- common_name "green"
- description "Emphasizes peak vegetation, which is useful for assessing plant vigor"
- center_wavelength 0.56
- full_width_half_max 0.06
- created "2023-11-02T14:49:03.641294Z"
- updated "2023-11-02T14:49:03.641302Z"
- start_datetime "2020-12-20T10:48:56Z"
- end_datetime "2020-12-20T10:48:56Z"
instruments [] 1 items
- 0 "OLI-TIRS"
- constellation "landsat-8"
- gsd 30
roles [] 1 items
- 0 "reflectance"
Red
- href "/vsitar//home/data/DATA/PRODS/LANDSATS_COL2/LC08_L1TP_200030_20201220_20210310_02_T1.tar/LC08_L1TP_200030_20201220_20210310_02_T1_B4.TIF"
- type "image/tiff; application=geotiff"
- title "Red"
- description "Discriminates vegetation slopes"
- eoreader_name "RED"
eo:bands [] 1 items
0
- name "Red"
- common_name "red"
- description "Discriminates vegetation slopes"
- center_wavelength 0.655
- full_width_half_max 0.03
- created "2023-11-02T14:49:03.641342Z"
- updated "2023-11-02T14:49:03.641348Z"
- start_datetime "2020-12-20T10:48:56Z"
- end_datetime "2020-12-20T10:48:56Z"
instruments [] 1 items
- 0 "OLI-TIRS"
- constellation "landsat-8"
- gsd 30
roles [] 1 items
- 0 "reflectance"
Near Infrared (NIR)
- href "/vsitar//home/data/DATA/PRODS/LANDSATS_COL2/LC08_L1TP_200030_20201220_20210310_02_T1.tar/LC08_L1TP_200030_20201220_20210310_02_T1_B5.TIF"
- type "image/tiff; application=geotiff"
- title "Near Infrared (NIR)"
- description "Emphasizes biomass content and shorelines"
- eoreader_name "NARROW_NIR"
eo:bands [] 1 items
0
- name "Near Infrared (NIR)"
- common_name "nir08"
- description "Emphasizes biomass content and shorelines"
- center_wavelength 0.865
- full_width_half_max 0.03
- created "2023-11-02T14:49:03.641429Z"
- updated "2023-11-02T14:49:03.641434Z"
- start_datetime "2020-12-20T10:48:56Z"
- end_datetime "2020-12-20T10:48:56Z"
instruments [] 1 items
- 0 "OLI-TIRS"
- constellation "landsat-8"
- gsd 30
roles [] 1 items
- 0 "reflectance"
Cirrus
- href "/vsitar//home/data/DATA/PRODS/LANDSATS_COL2/LC08_L1TP_200030_20201220_20210310_02_T1.tar/LC08_L1TP_200030_20201220_20210310_02_T1_B9.TIF"
- type "image/tiff; application=geotiff"
- title "Cirrus"
- description "Improved detection of cirrus cloud contamination"
- eoreader_name "CIRRUS"
eo:bands [] 1 items
0
- name "Cirrus"
- common_name "cirrus"
- description "Improved detection of cirrus cloud contamination"
- center_wavelength 1.37
- full_width_half_max 0.02
- created "2023-11-02T14:49:03.641473Z"
- updated "2023-11-02T14:49:03.641478Z"
- start_datetime "2020-12-20T10:48:56Z"
- end_datetime "2020-12-20T10:48:56Z"
instruments [] 1 items
- 0 "OLI-TIRS"
- constellation "landsat-8"
- gsd 30
roles [] 1 items
- 0 "reflectance"
SWIR 1
- href "/vsitar//home/data/DATA/PRODS/LANDSATS_COL2/LC08_L1TP_200030_20201220_20210310_02_T1.tar/LC08_L1TP_200030_20201220_20210310_02_T1_B6.TIF"
- type "image/tiff; application=geotiff"
- title "SWIR 1"
- description "Discriminates moisture content of soil and vegetation; penetrates thin clouds"
- eoreader_name "SWIR_1"
eo:bands [] 1 items
0
- name "SWIR 1"
- common_name "swir16"
- description "Discriminates moisture content of soil and vegetation; penetrates thin clouds"
- center_wavelength 1.61
- full_width_half_max 0.08
- created "2023-11-02T14:49:03.641523Z"
- updated "2023-11-02T14:49:03.641529Z"
- start_datetime "2020-12-20T10:48:56Z"
- end_datetime "2020-12-20T10:48:56Z"
instruments [] 1 items
- 0 "OLI-TIRS"
- constellation "landsat-8"
- gsd 30
roles [] 1 items
- 0 "reflectance"
SWIR 2
- href "/vsitar//home/data/DATA/PRODS/LANDSATS_COL2/LC08_L1TP_200030_20201220_20210310_02_T1.tar/LC08_L1TP_200030_20201220_20210310_02_T1_B7.TIF"
- type "image/tiff; application=geotiff"
- title "SWIR 2"
- description "Improved moisture content of soil and vegetation; penetrates thin clouds"
- eoreader_name "SWIR_2"
eo:bands [] 1 items
0
- name "SWIR 2"
- common_name "swir22"
- description "Improved moisture content of soil and vegetation; penetrates thin clouds"
- center_wavelength 2.2
- full_width_half_max 0.18
- created "2023-11-02T14:49:03.641566Z"
- updated "2023-11-02T14:49:03.641571Z"
- start_datetime "2020-12-20T10:48:56Z"
- end_datetime "2020-12-20T10:48:56Z"
instruments [] 1 items
- 0 "OLI-TIRS"
- constellation "landsat-8"
- gsd 30
roles [] 1 items
- 0 "reflectance"
Thermal Infrared (TIRS) 1
- href "/vsitar//home/data/DATA/PRODS/LANDSATS_COL2/LC08_L1TP_200030_20201220_20210310_02_T1.tar/LC08_L1TP_200030_20201220_20210310_02_T1_B10.TIF"
- type "image/tiff; application=geotiff"
- title "Thermal Infrared (TIRS) 1"
- description "100 meter resolution, thermal mapping and estimated soil moisture"
- eoreader_name "THERMAL_IR_1"
eo:bands [] 1 items
0
- name "Thermal Infrared (TIRS) 1"
- common_name "lwir11"
- description "100 meter resolution, thermal mapping and estimated soil moisture"
- center_wavelength 10.895
- full_width_half_max 0.59
- created "2023-11-02T14:49:03.641605Z"
- updated "2023-11-02T14:49:03.641611Z"
- start_datetime "2020-12-20T10:48:56Z"
- end_datetime "2020-12-20T10:48:56Z"
instruments [] 1 items
- 0 "OLI-TIRS"
- constellation "landsat-8"
- gsd 100
roles [] 1 items
- 0 "brightness_temperature"
Thermal Infrared (TIRS) 2
- href "/vsitar//home/data/DATA/PRODS/LANDSATS_COL2/LC08_L1TP_200030_20201220_20210310_02_T1.tar/LC08_L1TP_200030_20201220_20210310_02_T1_B11.TIF"
- type "image/tiff; application=geotiff"
- title "Thermal Infrared (TIRS) 2"
- description "100 meter resolution, improved thermal mapping and estimated soil moisture"
- eoreader_name "THERMAL_IR_2"
eo:bands [] 1 items
0
- name "Thermal Infrared (TIRS) 2"
- common_name "lwir12"
- description "100 meter resolution, improved thermal mapping and estimated soil moisture"
- center_wavelength 12.005
- full_width_half_max 1.01
- created "2023-11-02T14:49:03.641643Z"
- updated "2023-11-02T14:49:03.641647Z"
- start_datetime "2020-12-20T10:48:56Z"
- end_datetime "2020-12-20T10:48:56Z"
instruments [] 1 items
- 0 "OLI-TIRS"
- constellation "landsat-8"
- gsd 100
roles [] 1 items
- 0 "brightness_temperature"
Panchromatic
- href "/vsitar//home/data/DATA/PRODS/LANDSATS_COL2/LC08_L1TP_200030_20201220_20210310_02_T1.tar/LC08_L1TP_200030_20201220_20210310_02_T1_B8.TIF"
- type "image/tiff; application=geotiff"
- title "Panchromatic"
- description "15 meter resolution, sharper image definition"
- eoreader_name "PANCHROMATIC"
eo:bands [] 1 items
0
- name "Panchromatic"
- common_name "pan"
- description "15 meter resolution, sharper image definition"
- center_wavelength 0.59
- full_width_half_max 0.18
- created "2023-11-02T14:49:03.641679Z"
- updated "2023-11-02T14:49:03.641684Z"
- start_datetime "2020-12-20T10:48:56Z"
- end_datetime "2020-12-20T10:48:56Z"
instruments [] 1 items
- 0 "OLI-TIRS"
- constellation "landsat-8"
- gsd 15
roles [] 1 items
- 0 "reflectance"
bbox [] 4 items
- 0 -2.744857724803896
- 1 42.09665285173287
- 2 0.14785265624107427
- 3 44.2467651307631
stac_extensions [] 3 items
- 0 "https://stac-extensions.github.io/eo/v1.1.0/schema.json"
- 1 "https://stac-extensions.github.io/projection/v1.1.0/schema.json"
- 2 "https://stac-extensions.github.io/view/v1.0.0/schema.json"
Query the catalog#
EODAG
is an opensource python library that implements STAC and allows you to query your local STAC catalog.
Look at here for a detailed tutorial.
# Create an EODAG custom STAC provider
dag = EODataAccessGateway()
# Set EODAG logging level to WARNING
setup_logging(verbose=1)
# Add the custom STAC provider, exactly like in the tutorial mentioned above
dag.update_providers_config("""
stac_http_provider:
search:
type: StaticStacSearch
api_endpoint: %s
products:
GENERIC_PRODUCT_TYPE:
productType: '{productType}'
download:
type: HTTPDownload
base_uri: %s
flatten_top_dirs: True
outputs_prefix: %s
""" % (catalog_path, tmp.name, tmp.name))
# Set the custom STAC provider as preferred
dag.set_preferred_provider("stac_http_provider")
# Query every product from inside the catalog
all_products, _ = dag.search()
# Load an AOI
aoi_path = os.path.join("/home", "data", "DATA", "AOIs", "DAX.geojson")
aoi = gpd.read_file(aoi_path)
aoi_geojson = mapping(aoi.geometry.values[0])
# Query spatially with the AOI and temporally with a time period
query_args = {"start": "2020-05-01", "end": "2022-05-06", "geom": aoi.geometry.values[0]}
query_products, _ = dag.search(**query_args)
query_products[0]
EOProduct(id=20201220T104856_L8_200030_OLI_TIRS, provider=stac_http_provider)
query_products[0].assets['Blue']
{'href': '/vsitar//home/data/DATA/PRODS/LANDSATS_COL2/LC08_L1TP_200030_20201220_20210310_02_T1.tar/LC08_L1TP_200030_20201220_20210310_02_T1_B2.TIF',
'type': 'image/tiff; application=geotiff',
'title': 'Blue',
'description': 'Bathymetric mapping, distinguishing soil from vegetation and deciduous from coniferous vegetation',
'eoreader_name': 'BLUE',
'eo:bands': [{'name': 'Blue',
'common_name': 'blue',
'description': 'Bathymetric mapping, distinguishing soil from vegetation and deciduous from coniferous vegetation',
'center_wavelength': 0.48,
'full_width_half_max': 0.06}],
'created': '2023-11-02T14:49:03.641242Z',
'updated': '2023-11-02T14:49:03.641249Z',
'start_datetime': '2020-12-20T10:48:56Z',
'end_datetime': '2020-12-20T10:48:56Z',
'instruments': ['OLI-TIRS'],
'constellation': 'landsat-8',
'gsd': 30,
'roles': ['reflectance']}
Display the results#
We can use folium
to display the results geometry over a map.
import folium
# Create a map zoomed over the search area
fmap = folium.Map((43.2, -1.05), zoom_start=7)
# Add a layer green layer for the query over the AOI
folium.GeoJson(
data=all_products.as_geojson_object(),
tooltip = "All products stored in the catalog",
style_function=lambda x: {'color': 'green'}
).add_to(fmap)
# Add a layer green layer for the query over the AOI
folium.GeoJson(
data=query_products.as_geojson_object(),
tooltip = "Retrieved products with the query",
style_function=lambda x: {'color': 'red'}
).add_to(fmap)
# Add a layer blue layer for the AOI
folium.GeoJson(
data=aoi_geojson,
tooltip = "DAX AOI",
style_function=lambda x: {'color': 'blue'}
).add_to(fmap)
fmap
Make this Notebook Trusted to load map: File -> Trust Notebook
# Clean the tmp directory
tmp.cleanup()