RasterFlow Overview
Reference
build_zarr_multiscales API documentationRasterFlow Datasets
Run as a Job
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 predict_mosaic and its recipe variants, 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
- Access to RasterFlow in your Organization.
- A Wherobots notebook, a VS Code Extension workspace, or a Job Run with
rasterflow_remoteavailable. - The Micro runtime is sufficient. RasterFlow manages its own compute, so runtime size 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 workflow, or a georeferenced Zarr store of your own. - Write access to the destination bucket.
Build a multiscale Zarr store
Get the URI of the source store
MosaicResult. Its first_row_mosaic attribute is the URI of the store for the first mosaic location, which is what you want when your Area of Interest has a single geometry.mosaic_index.mosaic_index_gdf to see every output store and call build_zarr_multiscales once per store you want to visualize.Build the visualization-ready store
UriOutput. Its uri attribute points at the new multiscale Zarr store.Open the result on the map
UriOutput also exposes a map_url attribute that links directly to the store in the Wherobots Cloud map viewer. It is None when no viewer URL is available for the store.Build a visualization-ready store from a model output
Inference and change detection outputs are Zarr stores too, so the workflow is identical; build the pyramid on the prediction store.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 as None 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
Passbucket to write the visualization-ready store under an S3 URI prefix other than your configured Wherobots Managed Storage bucket:
Troubleshooting
WorkflowExecutionError
WorkflowExecutionError
source_store URI that RasterFlow cannot read or a destination bucket it cannot write to.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
optimized_store.urioroptimized_store.map_url, 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 build_gti_mosaics.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, iterate over the stores in mosaic_index_gdf and call the method for each one.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.The resampling method is fixed
The resampling method is fixed
build_zarr_multiscales downsamples each overview level with a fixed resampling method and takes no resampling parameter. This is separate from build_mosaics, which does let you set resampling when the mosaic itself is built. If you need a different method for overview levels, contact support@wherobots.com.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 the Micro runtime: RasterFlow manages its own compute, so a larger runtime adds cost without speeding up the build.
Next steps
Building NAIP mosaics
Run RasterFlow as a Job
Client API reference
build_zarr_multiscales.API reference
For detailed API documentation, see:- Client API Reference -
RasterflowClientmethods - Data Models Reference - Enums and configuration objects
- Exceptions Reference - Error handling

