search_iterator
in the code below finds two sentinel2 files as SAFE format (S2A_MSIL2A_20231114T110311_N0509_R094_T31UDQ_20231114T143858.SAFE
and S2A_MSIL2A_20231114T110311_N0509_R094_T31UDR_20231114T143858.SAFE
):
import os
import datetime
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import requests
import getpass
from sentinelhub import (
SHConfig,
DataCollection,
SentinelHubCatalog,
SentinelHubRequest,
BBox,
bbox_to_dimensions,
CRS,
MimeType,
Geometry,
MosaickingOrder,
)
config = SHConfig("myprofile")
aoi_coords_wgs84 = [2, 49, 2.5, 49.7]
resolution = 10
aoi_bbox = BBox(bbox=aoi_coords_wgs84, crs=CRS.WGS84)
aoi_size = bbox_to_dimensions(aoi_bbox, resolution=resolution)
print(f"Image shape at {resolution} m resolution: {aoi_size} pixels")
catalog = SentinelHubCatalog(config=config)
time_interval = "2023-11-14", "2023-11-14"
search_iterator = catalog.search(
DataCollection.SENTINEL2_L2A,
bbox=aoi_bbox,
time=time_interval,
fields={"include": ["id", "properties.datetime"], "exclude": []},
)
How can I directly download the items (two SENTINEL2 products in SAFE format) stored by search_iterator
?