RasterFlow_S2_Mosaic.ipynb), but swaps satellite imagery for NAIP’s sub-meter aerial imagery.
Built-in NAIP datasets
RasterFlow ships two built-in NAIP configurations, selectable throughDatasetEnum. Both provide four bands — red, green, blue, and near-infrared — as 8-bit (Byte) values:
NAIP_30CM— NAIP aerial imagery at 30 cm resolution.NAIP_60CM— NAIP aerial imagery at 60 cm resolution.
<dataset>:<band> — for example naip_30cm:red, naip_30cm:green, naip_30cm:blue, naip_30cm:nir.
NAIP is flown state-by-state on a multi-year cycle, and the available resolution varies by state and year. RasterFlow selects imagery for the requested resolution and date window from its built-in NAIP index; if a location has no imagery at the requested resolution in that window, the mosaic will be empty. We use two AOIs below, each chosen because it has coverage at the target resolution:
- 30 cm → College Park, MD (2023) — the AOI from the SAM3 notebook.
- 60 cm → Nashua, NH (2021) — the AOI from the CHM notebook.
Setup and Imports
Initializing the RasterFlow client
30 cm NAIP mosaic — College Park, MD
We build a 30 cm NAIP mosaic over College Park, Maryland using the built-inNAIP_30CM dataset. College Park has 30 cm NAIP coverage in 2023, so we use a date window covering that year. (This is the same AOI used in the SAM3 notebook, RasterFlow_SAM3.ipynb.)
Preview: example mosaic
A pre-generated NAIP 30 cm optimized mosaic over College Park is available in the Wherobots Cloud map viewer, so you can see the kind of output this section builds without waiting for the build to finish. View the interactive map here.Note: NAIP mosaics are 4-band (red, green, blue, and near-infrared) — this preview renders only the RGB bands, but the NIR band is present in the store for indices like NDVI or false-color views. This pre-generated sample was built via the GTI approach (seeRasterFlow_Bring_Your_Own_Rasters_NAIP.ipynb) with its bands labeledr/g/b/ir; a mosaic you build with the built-inNAIP_30CMdataset labels themnaip_30cm:red/naip_30cm:green/naip_30cm:blue/naip_30cm:nirinstead.
Selecting the Area of Interest (AOI)
We use College Park, Maryland — an urban/suburban area in the Northeastern US with recent 30 cm NAIP coverage.Building the 30 cm mosaic
This step builds a NAIP mosaic at 30 cm resolution using the built-inNAIP_30CM dataset. RasterFlow queries its built-in NAIP index for 30 cm imagery intersecting the AOI within the date window, reprojects/resamples into the target CRS, and mosaics the tiles into a Zarr store with red, green, blue, and NIR bands.
Note: This step can take several minutes to complete. If you already have a pre-built mosaic store, you can skip this build by assigning its URI directly in the next cell.
Build an optimized Zarr and visualize the output
RasterFlow writes its outputs as Zarr stores at native resolution, which isn’t ideal for interactive viewing — every pan or zoom would have to stream full-resolution pixels.build_zarr_multiscales adds downsampled overview levels (image pyramids) so the map can stream coarse tiles when zoomed out and full-resolution pixels when zoomed in. This typically takes a few minutes for large outputs.
Once built, open it in the Wherobots Cloud map viewer via the store’s map_url. (build_zarr_multiscales returns a UriOutput, whose map_url property links to the map viewer for that store.)
60 cm NAIP mosaic — Nashua, NH
TheNAIP_60CM dataset builds a mosaic from NAIP’s 60 cm imagery. Pick 60 cm over 30 cm when:
- You need coverage for a year or location that wasn’t flown at 30 cm — 60 cm imagery is available for more states and more years.
- You’re mosaicking a large area and want smaller outputs and faster builds — 60 cm imagery is roughly a quarter of the pixels of 30 cm.
RasterFlow_CHM.ipynb.)
Preview: example mosaic
A pre-generated 60 cm NAIP mosaic over Nashua, NH is available in the Wherobots Cloud map viewer. View the interactive map here.Selecting the AOI and building the mosaic
We build the Nashua mosaic withNAIP_60CM the same way as the 30 cm mosaic above. As in the 30cm example above, you can add an additional cell to pass the resulting store to build_zarr_multiscales and open its map_url in the Wherobots Cloud map viewer to view your freshly built output.
Summary
This notebook demonstrated how to:- Build a 30 cm NAIP aerial mosaic over College Park, MD with the built-in
DatasetEnum.NAIP_30CMdataset - Optimize the Zarr store with overviews and open it in the Wherobots Cloud map viewer
- Build a 60 cm NAIP mosaic over Nashua, NH with
DatasetEnum.NAIP_60CM
Next steps
- Compare a NAIP mosaic with the Sentinel-2 mosaic over the same AOI (see
RasterFlow_S2_Mosaic.ipynb) - Run a model on the NAIP mosaic — for example text-prompted object detection with SAM3 on the College Park mosaic (
RasterFlow_SAM3.ipynb) or tree canopy height with Meta CHM on the Nashua mosaic (RasterFlow_CHM.ipynb) - Use the mosaic as input for model inference using predict_mosaic

