geedim.mask.MaskedImage.download

MaskedImage.download(filename: Path | str, overwrite: bool = False, num_threads: int | None = None, max_tile_size: float | None = None, max_tile_dim: int | None = None, **kwargs)

Download the encapsulated image to a GeoTiff file.

Images larger than the Earth Engine size limit are split and downloaded as separate tiles, then re-assembled into a single GeoTIFF. Downloaded image files are populated with metadata from the Earth Engine image and STAC.

Image bounds and resolution can be specified with region and scale / shape, or crs_transform and shape. If no bounds are specified (with either region, or crs_transform & shape), the entire image granule is downloaded.

When crs, scale, crs_transform & shape are not specified, the pixel grid of the exported image will coincide with that of the encapsulated image.

Parameters:
  • filename (pathlib.Path, str) – Name of the destination file.

  • overwrite (bool, optional) – Overwrite the destination file if it exists.

  • num_threads (int, optional) – Number of tiles to download concurrently. Defaults to a sensible auto value.

  • max_tile_size (int, optional) – Maximum tile size (MB). If None, defaults to the Earth Engine download size limit (32 MB).

  • max_tile_dim (int, optional) – Maximum tile width/height (pixels). If None, defaults to Earth Engine download limit (10000).

  • crs (str, optional) – WKT or EPSG specification of CRS to export to. Where image bands have different CRSs, all are re-projected to this CRS. Defaults to use the CRS of the minimum scale band if available.

  • crs_transform (tuple of float, list of float, rio.Affine, optional) – List of 6 numbers specifying an affine transform in the specified CRS. In row-major order: [xScale, xShearing, xTranslation, yShearing, yScale, yTranslation]. All bands are re-projected to this transform.

  • shape (tuple of int, optional) – (height, width) dimensions to export (pixels).

  • region (dict, geojson, ee.Geometry, optional) – Region of interest (WGS84) to export. Defaults to the image footprint, when available.

  • scale (float, optional) – Pixel scale (m) to export to. Where image bands have different scales, all are re-projected to this scale. Ignored if crs and crs_transform are specified. Defaults to use the minimum scale of image bands if available.

  • resampling (ResamplingMethod, optional) – Resampling method - see ResamplingMethod for available options.

  • dtype (str, optional) – Convert to this data type (uint8, int8, uint16, int16, uint32, int32, float32 or float64). Defaults to auto select a minimal type that can represent the range of pixel values.

  • scale_offset (bool, optional) – Whether to apply any EE band scales and offsets to the image.

  • bands (list of str, optional) – List of band names to download.