wxee.collection.ImageCollection.to_tif
- ImageCollection.to_tif(out_dir: str = '.', prefix: str | None = None, region: Geometry | None = None, scale: int | None = None, crs: str = 'EPSG:4326', file_per_band: bool = False, masked: bool = True, nodata: int = -32768, num_cores: int = -1, progress: bool = True, max_attempts: int = 10) List[str] [source]
Download all images in the collection to geoTIFF. Image file names will be the
system:id
of each image after replacing invalid characters with underscores, with an optional user-defined prefix.- Parameters:
out_dir (str, default ".") – The directory to save the images to.
prefix (str, optional) – A description to prefix to all image file names. If none is provided, no prefix will be added.
region (ee.Geometry, optional) – The region to download the image within. If none is provided, the
geometry
of each image will be used.scale (int, optional) – The scale to download each image at in the CRS units. If none is provided, the
projection.nominalScale
of each image will be used.crs (str, default "EPSG:4326") – The coordinate reference system to download each image in.
file_per_band (bool, default False) – If true, one file will be downloaded per band per image. If false, one multiband file will be downloaded per image instead.
masked (bool, default True) – If true, the nodata value of each image will be set in the image metadata.
nodata (int, default -32,768) – The value to set as nodata in each image. Any masked pixels in the images will be filled with this value.
num_cores (int, default -1) – The number of CPU cores to use for parallel operations. Defaults to -1 which will use all available cores.
progress (bool, default True) – If true, a progress bar will be displayed to track download progress.
max_attempts (int, default 10) – Download requests to Earth Engine may intermittently fail. Failed attempts will be retried up to max_attempts. Must be between 1 and 99.
- Returns:
Paths to downloaded images.
- Return type:
list[str]
- Raises:
DownloadError – Raised if the image cannot be successfully downloaded after the maximum number of attempts.
Example
>>> col = ee.ImageCollection("IDAHO_EPSCOR/GRIDMET").filterDate("2020-09-08", "2020-09-15") >>> col.wx.to_tif(scale=40000, crs="EPSG:5070", nodata=-9999)