RasterFlow writes its mosaics and model outputs as Zarr stores at a single, native resolution. That is the right format for analysis and inference, but it is a poor fit for interactive viewing: every pan or zoom has to stream full-resolution pixels, even when the whole scene is on screen at once.
build_zarr_multiscales takes an existing Zarr store and writes a new, visualization-ready store that adds downsampled overview levels — an image pyramid — plus histogram statistics. A map client can then stream coarse tiles when you are zoomed out and full-resolution pixels when you zoom in.
Benefits
Interactive visualization
Interactive visualization
wherobots_gl.Map() widget render large mosaics responsively instead of pulling native-resolution pixels at every zoom level.Histogram statistics
Histogram statistics
Works on any Zarr store
Works on any Zarr store
build_mosaics and build_gti_mosaics, model outputs from run_mosaic_inference and the recipe tasks, and change-detection outputs from run_mosaics_change. It also accepts a georeferenced Zarr store you bring yourself, so you can make your own imagery visualization-ready without running it through RasterFlow first.Non-destructive
Non-destructive
Before you start
Wherobots requirements
Wherobots requirements
- A Wherobots account. RasterFlow is available to every Organization with nothing to enable.
- Outside a Wherobots notebook or job, a Wherobots API key, set as
WHEROBOTS_API_KEY. - For the Python examples, Python 3.11 or later with
wherobots-python-sdk. The API examples need onlycurl. - No Wherobots runtime. RasterFlow tasks run on RasterFlow’s own compute, so where you call them from does not affect how fast the multiscale build runs.
Input requirements
Input requirements
- A Zarr store URI that RasterFlow can read. This can be an
s3://path produced by an earlier RasterFlow task, or a georeferenced Zarr store of your own. - Write access to the destination bucket.
Build a multiscale Zarr store
curl. Outside a Wherobots notebook or job, both need a Wherobots API key in WHEROBOTS_API_KEY. Each example starts a task run; to wait for it and read its results, see Get started and Run RasterFlow Tasks.Get the URI of the source store
location column. Most AOIs produce one; if yours produces more, build multiscales for each store you want to view. To read the index outside a Wherobots notebook, see Download a task run’s results.Build the visualization-ready store
Open the result on the map
Select an area of interest
For a single Zarr source, passaoi as a GeoJSON or GeoParquet S3 URI with a CRS, or as nonempty polygon or multipolygon WKT in EPSG:4326. WKT coordinates use longitude, latitude order.
The task transforms the AOI to the source CRS and expands its bounding window to source chunk boundaries. The output retains pixels outside the polygon within that rectangular window. AOI selection requires source georeferencing and named y and x axes.
aoi to process the full spatial extent. If you also pass spatial selector ranges, the task intersects them with the AOI window. Mosaic index inputs do not accept aoi, selector, or data_var.
Control the fill value
Overview levels have to know which pixels carry no data, otherwise nodata pixels get averaged into the downsampled levels and the result looks washed out or blank at coarse zooms. By default,build_zarr_multiscales uses the source array’s fill_value. When the source store does not declare one, it falls back to NaN for floating-point types and 0 for non-floating types. Set nodata explicitly when the source store’s fill value is missing or wrong:
Control histogram statistics
Usehistogram_dims to choose the dimensions that get their own histogram. Passing ["band"] produces one histogram per band, which is what you want for multi-band imagery where each band has a different value range:
histogram_dims auto-detects: the workflow uses ["band"] if the store has a band dimension, and otherwise computes a single global histogram. The default is the right choice for most RasterFlow outputs.
Route the output to a specific bucket
When you omitstorage_uri, the task writes the visualization-ready store to Wherobots Managed Storage, under a task-specific prefix. Pass storage_uri to write it under an S3 URI prefix that you choose, such as a path in your Managed Storage or a bucket with a storage integration:
Troubleshooting
The task run ends FAILED or REJECTED
The task run ends FAILED or REJECTED
REJECTED), or the run could not finish (FAILED). Common reasons are a source_store URI that RasterFlow cannot read or a storage_uri it cannot write to. The run’s error_message (errorMessage in the REST API) says which.Solution:- Verify the
source_storeURI, including the.zarrsuffix, by printing it before the call. - Confirm your storage integration grants read access to the source and write access to the destination.
Coarse zoom levels look blank or washed out
Coarse zoom levels look blank or washed out
- Pass
nodataexplicitly to match the value your imagery actually uses for no-data pixels. - Rebuild the multiscale store after changing
nodata; overview levels are computed at build time, not at read time.
The map viewer still feels slow
The map viewer still feels slow
- Open the run’s
output_uriresult, not the URI you passed assource_store.
Limitations
Zarr input only
Zarr input only
build_zarr_multiscales reads Zarr stores. It does not build overviews for GeoTIFF or COG inputs; mosaic those into a Zarr store first with the build_gti_mosaics task.Writes a new store rather than updating in place
Writes a new store rather than updating in place
One store per call
One store per call
source_store. To build visualization-ready stores for a multi-location mosaic index, run the task once for each store in the index’s location column.Inference reads one array, not the group
Inference reads one array, not the group
s3://path/to/store.zarr/0 is the full-resolution level.Four resampling methods
Four resampling methods
resampling_method sets how each overview level is downsampled: average (the default) for continuous imagery and scores, mode or nearest to keep class values, or bilinear.Usage and best practices
- Do
- Don't
- Build multiscales for large stores: A native-resolution store still opens on the map, but the viewer renders it only once you zoom in far enough. Small stores are fine to view directly; large ones stay blank at coarse zoom until you build overview levels.
- Build only what you intend to look at: Build multiscales on the specific mosaic or prediction store you want on a map, not on every intermediate output.
- Set
nodatawhen you know it: An explicit fill value avoids nodata bleeding into coarse overview levels. - Use
modeornearestfor class maps:averageblends class values into ones that don’t exist.
Next steps
Building NAIP mosaics
Visualize RasterFlow outputs
Get a task
build_zarr_multiscales.API reference
For detailed API documentation, see:- Run a task -
POST /tasks/{taskName}/runs - Get a task run - state, results, and errors
- Wherobots Python SDK -
wb.tasksandwb.task_runs

