xyztile_of_array(arr, x, y, z, interpolation='linear', tilesize=256)¶
Slice an XYZ tile out of a DataArray. Returns None if the tile does not overlap.
zshould follow the “slippy map” tiling scheme used by OSM/Google (the standard scheme for most web maps).
mercantilepackage (installed automatically with
This method is very slow on large arrays due to inefficiencies in generating the dask graphs. (The graphs should compute quickly, but generating and optimizing them is very slow.)
DataArray) – DataArray to extract a map tile from. Must have
y, and the
int) – X index of the tile
int) – Y index of the tile
int) – Zoom level of the tile
Literal[‘linear’, ‘nearest’]) – Interpolation method to use while reprojecting:
"linear"for continuous data, such as imagery, SAR, DEMs, weather data, etc. Use
"nearest"for discrete/categorical data, such as classification maps.
tilesize (int) – The length of the edge of the tile, in pixels.
Reprojected slice of
arrcorresponding to the tile, or None if
arrdidn’t overlap the tile.
- Return type
xarray.DataArray or None