Page Summary
-
ee.Image.loadZarrV2Arrayloads a Zarr v2 array as an Image. -
The array attributes must contain the
_ARRAY_DIMENSIONSfield, listing dimension names with the last two being Y and X. -
Supported compression codecs include 'blosc', 'gzip', 'lz4', 'zlib', and 'zstd'.
-
The
urimust point to a Cloud Storage.zarrayfile, requiring a.zmetadatafile in the parent directory and specific Cloud Storage permissions and region. -
Optional
startsandendsarguments can specify inclusive and exclusive slicing indices for non-spatial dimensions respectively.
| Usage | Returns |
|---|---|
ee.Image.loadZarrV2Array(uri, proj, starts, ends) | Image |
| Argument | Type | Details |
|---|---|---|
uri | String | The Cloud Storage URI of the .zarray file to load. A .zmetadata file must be present in the parent directory of the array's directory (e.g., for 'gs://b/o/.zarray', 'gs://b/.zmetadata' must be present). The bucket metadata must be accessible (requires the `storage.buckets.get` permission which is provided by the role "Storage Legacy Bucket Reader" among others, see https://cloud.google.com/storage/docs/access-control/iam-roles) and the bucket must be located in the US multi-region, a dual-region including US-CENTRAL1, or the US-CENTRAL1 region. |
proj | Projection | The projection of the array. |
starts | List, default: null | The indices (inclusive) at which to start taking slices along each non-spatial dimension. If null, slices will start at index 0 for all non-spatial dimensions. If specified, this list must have a length equal to the number of non-spatial dimensions (total dimensions - 2). An individual element within the list may be null, which defaults to 0 for that dimension. Negative indices are counted from the end of the dimension (e.g., -1 is the last element). |
ends | List, default: null | The indices (exclusive) at which to stop taking slices along each non-spatial dimension. If null, slices will extend to the end of each corresponding non-spatial dimension (i.e., defaults to the length of the dimension). If specified, this list must have a length equal to the number of non-spatial dimensions (total dimensions - 2). An individual element within the list may be null, which also defaults to the length of that dimension. Negative indices are counted from the end of the dimension (e.g., -1 is the last element). |
Examples
Code Editor (JavaScript)
var timeStart = 1000000; var timeEnd = 1000010; // Load a 2m temperature Zarr v2 array. var temperature = ee.Image.loadZarrV2Array({ uri: 'gs://gcp-public-data-arco-era5/ar/' + 'full_37-1h-0p25deg-chunk-1.zarr-v3/2m_temperature/.zarray', proj: 'EPSG:4326', starts: [timeStart], ends: [timeEnd] }); print(temperature); Map.addLayer(temperature, {min: 220, max: 350}, '2m Temperature');
import ee import geemap.core as geemap
Colab (Python)
time_start = 1000000 time_end = 1000010 # Load a 2m temperature Zarr v2 array. temperature = ee.Image.loadZarrV2Array( uri=( 'gs://gcp-public-data-arco-era5/ar/' 'full_37-1h-0p25deg-chunk-1.zarr-v3/2m_temperature/.zarray' ), proj='EPSG:4326', starts=[time_start], ends=[time_end], ) display(temperature) m.add_layer(temperature, {'min': 220, 'max': 350}, '2m Temperature') m