environmentaltools.download.download_single_sentinel2_image
- environmentaltools.download.download_single_sentinel2_image(image_info: dict[str, Any], image_index: int, total_images: int, collection: ee.ImageCollection, study_area: ee.Geometry, output_directory: Path, scale: int = 10) bool[source]
Download a single Sentinel-2 image with vegetation indices.
Extracts an image from a collection, clips it to the study area, and downloads it using geemap. Skips download if file already exists.
- Parameters:
image_info (dict) – Image metadata from Earth Engine containing properties like ‘system:index’ and ‘system:time_start’.
image_index (int) – Current image index (for progress tracking).
total_images (int) – Total number of images to process.
collection (ee.ImageCollection) – Pre-created collection containing the image.
study_area (ee.Geometry) – Study area geometry for clipping.
output_directory (Path) – Directory where files will be saved.
scale (int, optional) – Spatial resolution in meters. Defaults to 10.
- Returns:
True if download successful or file exists, False otherwise.
- Return type:
bool
Example
>>> info = {'properties': {'system:index': 'T30STG_20200601', ...}} >>> success = download_single_sentinel2_image( ... info, 0, 10, collection, area, Path("./output") ... )