
ChesapeakeRSC
The ChesapeakeRSC1 model is an open source segmentation model that can detect roads from high resolution imagery, even when those roads may be occluded by tree cover. This model predicts 2 classes:- background
- road
Preview: model inputs and outputs
The interactive map linked below shows the input imagery and model outputs for this notebook’s example AOI. Toggle layers in the sidebar to compare the inputs, the raster model output, and the vectorized geometries side-by-side. Layers (top layer first, as in the map’s layer list):- ChesapeakeRSC PM Tiles: Vectorized road polygons in PMTiles format, created from the vector geometries
- ChesapeakeRSC vector geometries: Vectorized road polygons derived from the raster output
- ChesapeakeRSC model outputs: Single-band raster output from the model (road class)
- ChesapeakeRSC input mosaic: the 4-band (red, green, blue, near-infrared) NAIP imagery the model runs on, shown here as RGB
Selecting an Area of Interest (AOI)
We will choose an Area of Interest (AOI) for our analysis. ChesapeakeRSC was trained on imagery and land cover labels from Maryland. We will try it out in Montgomery County, Maryland.Selecting a time range and verifying NAIP coverage
NAIP is flown state by state on a multi-year cycle at mixed resolutions, and the ChesapeakeRSC recipe sources 1m imagery. If you change the AOI or the time range, the 1m imagery the model needs may not exist. The USDA’s NAIP coverage map (PDF, 2002-2025) shows what is available where.Using the Wherobots Tasks API
Each RasterFlow step runs as a task through the Wherobots Python SDK.wb.tasks.run_and_wait starts the task, waits for it to finish, and raises an error if it fails. .results contains both recipe outputs: input_mosaic holds the imagery and prediction_mosaic holds the predictions.
Running a model
RasterFlow has pre-defined workflows to simplify orchestration of the processing steps for model inference. These steps include:- Ingesting imagery for the specified Area of Interest (AOI)
- Generating a seamless image from multiple image tiles (a mosaic)
- Running inference with the selected model
input_mosaic for the source imagery and prediction_mosaic for the predictions. Each contains a mosaic_index_uri for its GeoParquet index and a first_row_mosaic for its first Zarr store.
Note: This step will take approximately 30 minutes to complete.
(Optional) Build an optimized Zarr for visualization
RasterFlow writes its outputs as Zarr stores at native resolution. To explore them interactively on cloud.wherobots.com/map, you can build an optimized multiscale Zarr.build_zarr_multiscales adds downsampled overview levels (image pyramids) to the store so the map can stream coarse tiles when zoomed out and full-resolution pixels when zoomed in.
This step is optional and can take a few minutes for large outputs, so the code below is commented out by default — uncomment it to run it.
Pass aoi to select a chunk-aligned bounding window from a single Zarr source. It accepts polygon or multipolygon WKT in EPSG:4326, or an S3 GeoJSON or GeoParquet URI with a CRS. Pixels outside the polygon remain within that rectangular window. Omit aoi to process the full store.
Visualizing outputs
You can visualize the Zarr, GeoParquet, and other geospatial outputs using cloud.wherobots.com/map.Vectorize the raster model outputs
The output for the ChesapeakeRSC model is a raster with two classes: background and road. We can run a separate flow to convert the roads into vector geometries, based on the confidence threshold. Converting these results to geometries allows us to more easily post process the results or join the results with other vector data.Save the vectorized results to the catalog
We can store these vectorized outputs in the catalog by using WherobotsDB to persist the GeoParquet results.Visualize the vectorized results
To visualize the vectorized results, we will choose a small subset of the outputs that intersect with a bounding box around the center of the AOI. We will also filter out results with a score lower than 0.7.Generate PM Tiles for visualization
To improve visualization performance of a large number of geometries, we can use Wherobots built-in high performance PM tile generator.References
- Robinson, C., Corley, I., Ortiz, A., Dodhia, R., Lavista Ferres, J. M., & Najafirad, P. (2024). Seeing the roads through the trees: A benchmark for modeling spatial dependencies with aerial imagery. arXiv preprint arXiv:2401.06762. https://arxiv.org/abs/2401.06762

