NATIONAL DEM 01 02 03 04 Download DEM tiles for the area Fill sinks (depression filling) Compute flow direction raster Compute watershed raster Repeating this for every site blocks rapid simulation
upstream watershed appears in seconds ・ Works anywhere in Japan — the largest basin included ・ Small streams: under a second ・ No downloads, no preprocessing on the user side
The University of Tokyo Resolution 1 arcsec (~30 m) Coverage All of Japan Distribution 1°×1° GeoTIFF tiles Encoding D8 flow direction Nationwide mosaic 97,200 × 79,200 px = 7.7 billion cells Flow directions are hydrologically corrected, so river networks stay connected. Ready for watershed extraction anywhere in Japan.
TOUCH THE DATA IT ACTUALLY READS Unpredictable Tiny The search can reach anywhere Even the Tone touches under 1% of it: upstream, so the whole nationwide grid 114 chunks of 512². A small stream has to be available reads one. Everything within reach, almost nothing read
the parts you need, the moment you need them, without downloading 7.7 billion cells ・ Both formats store the raster as a grid of chunks ・ Any chunk is retrievable via HTTP range requests ・ 7.7B cells stay on Amazon S3; each request reads only a fraction of them
COULD BE CHANGING IT ~20 s for the Tone ・ Chunk size 20 million cells, no preprocessing. A small stream comes back in under a ・ Watershed size second. So I measured it ・ File format
chunk size, both formats read the same chunks, decompress the same bytes, and run the same BFS. Only the fetching differs. MEASURED AT CHUNK SIZE 512, TONE BASIN COG Zarr DATA GETS 114 — one per chunk 114 — one per chunk HTTP ROUND TRIPS 114 251 — a HEAD per GET READER STACK C++ (GDAL) Python (zarr-python + s3fs) Both costs scale with request count, so they only bite at small chunks. At the sizes you'd actually tune to, the two formats sit within 4%.
pay for the extra bytes · a whole 4 MB chunk, 1.9× slower at 2048 Zarr · AWS Lambda, same region as S3 · warm But 1.9× of a tenth of a second is still a tenth of a second
can be extracted anywhere in the country 02 COG and Zarr are cloud-optimized, so the search can fetch just what it needs, as it needs it 03 In practice, choosing the right chunk size matters more than choosing the format
MERIT Hydro — global hydrography, 3 arcsec (~90 m), same flow-direction lineage ・ The same approach should apply to any river in the world ・ Lower resolution cells and much larger basins, so the right chunk size may differ by region — worth measuring again Try it on your rivers.
a shard-index fetch, then still a GET per chunk Tone River basin (20M cells) · AWS Lambda, same region as S3 · warm · median of 3 runs Sharding is a write-side optimization, not a read-side one
vCPU with it · runtime unchanged within a second Tone River basin (20M cells) · AWS Lambda, warm · single-core bound The extraction is single-threaded — extra cores just idle