direnv
, Node.js, GDAL, gettext (for
envsubst
), and PostgreSQL with PostGIS:brew bundle
npm install
sample.env
to .env
(and update it if necessary):cp sample.env .env
direnv
(to set environment variables and to update PATH
):direnv allow
reaches
table1709
(the Willamette).reaches
table by intersecting WBD with reaches
to filter
for access points in that HU4nhdflowline
nhdarea
, nhdwaterbody
, and
nhdplusflowlinevaa
for the selected 4-digit hydrologic unit.nhdfcode
(if not already imported).snapped_putins
) with nhdplusid
, fdate
,
number of candidate flowlines, point on closest flowline, point on
associated polygon, original point, and link from original to snapped
location.snapped_takeouts
) with nhdplusid
,
fdate
, number of candidate flowlines, point on closest flowline, point
on associated polygon, original point, and link from original to snapped
location.reach_segments
.These steps can be executed for a given HU4 (e.g. 1709
) using:
make -j $(nproc) wbd/1709
This will download 3GB or more of data from USGS, depending on the hydrologic units processed.
Step 9 can be repeated as necessary:
make db/correct_putins
Steps 10-12 can also be repeated, in case snapped put-in or take-out locations have been corrected:
make db/reach_segments.1709
Questionable reach segments (i.e. where the segment is something other than a
LineString, where snapped flowline points are not on the generated
segment, or where snapped put-ins are downstream of take-outs) are marked
using the questionable
column on reach_segments
.