Skip to content

About

Rainbow visualizations of river network adjacency

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rivers-in-rainbows

Rainbow visualizations of river network adjacency

Every river network in North America, colored by where it reaches the sea. Colors cycle around the coastline like a color wheel, so neighbouring outlets get neighbouring hues: yellow at the Colorado, green up the Pacific Northwest, blue and purple across the Arctic and Hudson Bay, magenta and red down the Atlantic and the Gulf of Mexico, and orange through Central America. Gray networks drain to inland sinks.

River networks colored by where they reach the coast

Maps

File What it shows
maps/networks_rivers.png All networks with basins over 100 km², Strahler order 2+, tapered by upstream area
maps/networks_mosaic_100km_trunk_rivers.png Voronoi "stained glass": every point on land takes the color of the nearest river; ~100 km tiles, rivers draining >20,000 km² on top
maps/networks_mosaic_100km_all_rivers.png Same mosaic with every river on top
maps/networks_mosaic_40km_all_rivers.png Finer ~40 km tiles with every river on top

Each map also has:

  • Proportional circles at each river mouth (area ~ drainage area), nudged out to sea so they overlap neither land nor each other (see below).
  • Two nested rings as the legend: every sea-reaching network as a slice in coastal order, the Nelson at 12 o'clock. Inner ring = drainage area, outer ring = mean discharge. Thin white lines mark the slices of the named rivers.

Data

  • HydroRIVERS v1.0 (Lehner & Grill 2013), North America and Arctic regions: 1.31M river segments with downstream links (NEXT_DOWN), basin IDs (MAIN_RIV), Strahler order, upstream area and modeled long-term mean discharge (WaterGAP, 1971–2000).
  • Natural Earth 1:50m countries for the land mask and coastline.

Natural Earth's own river layers were tested first but are not topologically connected (thousands of disconnected pieces, no flow attributes), so HydroRIVERS is used for the networks.

Method

  1. Mouths (scripts/prep.py): the downstream end of each outlet segment (NEXT_DOWN == 0), kept for basins over 100 km² (6,891 mouths: 5,728 reach the sea, 1,163 end in inland sinks).
  2. Coastal position: each mouth is projected onto a lightly smoothed outline of the mainland (Hudson Bay included) and measured clockwise from the Panama–Colombia border. Island mouths take the position of the nearest mainland coast. That 0–1 position drives the color wheel.
  3. Circle placement (scripts/place_circles.py): one circle at a time, largest first, random small steps — while on land a step is kept only if it reduces land overlap (ties step toward the nearest water), once off land only if it stays off land and reduces overlap with circles already placed. A circle stuck for 2,000 tries jumps to the nearest open spot; a final pass pulls each circle back toward its mouth wherever that stays clear. Seeded, so the layout is reproducible.
  4. Mosaic (scripts/networks_map.py mosaic): river points thinned to one per grid square (the largest river wins the square), Voronoi tiles clipped to land, each tinted with a random lightness.

Running it

pip install -r requirements.txt
scripts/download.sh .                               # ~90 MB of downloads into ne/ and hr/
python3 scripts/prep.py .                           # mouths + river segments -> out/
python3 scripts/place_circles.py .                  # circle positions -> out/ (~5–10 min)
python3 scripts/networks_map.py . plain             # -> out/networks_wheel_ord2.png
python3 scripts/networks_map.py . mosaic 100 20000  # tile size (km), min drainage of rivers drawn (km²)

Caveats

  • Discharge values are modeled, not gauged; they are unreliable in arid regions (the Colorado and Rio Grande come out far too low).
  • Eastern Panama's rivers are in HydroRIVERS' South America file, which isn't downloaded, so that corner of the mosaic has no river nearby.

Stained-glass mosaic

Every point on land takes the color of the nearest river (~100 km Voronoi tiles, rivers draining more than 20,000 km² drawn on top).

Voronoi stained-glass mosaic of North American river networks

About

Rainbow visualizations of river network adjacency

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages