wxee.image.Image.to_tif
- Image.to_tif(out_dir: str = '.', description: 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, progress: bool = True, max_attempts: int = 10) List[str] [source]
Download an image to geoTIFF.
- Parameters:
out_dir (str, default ".") – The directory to save the image to.
description (str, optional) – The name to save the file as with no file extension. If none is provided, the
system:id
of the image will be used.region (ee.Geometry, optional) – The region to download the image within. If none is provided, the
geometry
of the image will be used.scale (int, optional) – The scale to download the image at in the CRS units. If none is provided, the
projection.nominalScale
of the image will be used.crs (str, default "EPSG:4326") – The coordinate reference system to download the image in.
file_per_band (bool, default False) – If true, one file will be downloaded per band. If false, one multiband file will be downloaded instead.
masked (bool, default True) – If true, the nodata value of the image will be set in the image metadata.
nodata (int, default -32,768) – The value to set as nodata in the image. Any masked pixels in the image will be filled with this value.
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
>>> img = ee.Image("COPERNICUS/S2_SR/20200803T181931_20200803T182946_T11SPA") >>> img.wx.to_tif(description="las_vegas", scale=200, crs="EPSG:5070", nodata=-9999)