3  Subcatchments, catchments and network relationships

3.1 Table subcs (subcatchments)

The subcatchments layer (subcs table in the database) contains 131,298 subcatchments. Subcatchments were derived from a 5-m digital elevation model, by selecting ‘pourpoints’ just upstream of each confluence of stream lines and of major stormwater drains with stream lines using an automated process. Pourpoints were also placed between confluences to avoid reaches exceeding 500 m long. Pourpoints were added near the uppermost point of most streams to permit delineation of headwater catchments, and the length of stream segment in these subcatchments can be short (<5 m). Excluding headwater catchments, the mean reach length is 248 (1st and 99th percentiles 27 and 500 m respectively. Some longer reaches persist in the dataset (maximum length 1326 m) as a result of manual corrections and additions1.

Every subcatchment has a unique reach code matching the reach code of the stream lines flowing through it, and a unique integer code named site. The field nextds contains the next downstream subcatchment’s ‘site’ code. Subcatchments of reaches that flow to the sea have a nextds value of -1.2 The relationships between site and nextds permit network calculations such as aggregating statistics for all upstream or downstream subcatchments/reaches.

mwstr_network_functions.R (see the mwstr downloads page) contains two helper functions for retrieving all sites upstream or downstream of a given site (or a vector of sites). For instance, to retrieve all 50 sites upstream, and the 474 sites downstream of site 68169 (the most downstream reach on Lyrebird Gully Creek, as an example). These functions convert the site and nextds fields into an igraph object (Csardi and Nepusz 2006), allowing rapid network calculations.

source("https://tools.thewerg.unimelb.edu.au/data/mwstr_v13/mwstr_network_functions.R")
# db_m is the connection to the database as in Section 1.2
allus_61689 <- as.numeric(all_us(68169, mwstr_connection = db_m))
allus_61689
 [1]  68169  68432  68755  69095  69089  69081  69289  69275  69048  69047
[11]  69588  69631  69632  69297  69298 130894  69840  69793  69954  69310
[21]  69318  69462 131081 131068  70187 130945 130963  69737  70440  69902
[31]  70689  70691  69866  70648  70890  69765  69768 131245 361015  69630
[41]  70029  71419  69486  70305  71508 131004  70603 131364  70786 131273
allds_61689 <- as.numeric(all_ds(68169, mwstr_connection = db_m))

Other fields in the subcs table (other than reach, site, and nextds) are:

  • strcode, the three-character stream code for the line flowing through the subcatchment. See stream_names table below.

  • scarea, the area of the subcatchment polygon in m2. This is used to calculate upstream catchment areas (see below).

  • nus, The number of subcatchments upstream of each subcatchment

  • agg_order, aggregation order, used for rapid catchment calculations (see Calculating catchment statistics section)

  • carea_km2, the total area of all subcatchments including and upstream of each reach in km2 (Figure 4.1). This was calculated using the agg_order method described above;

  • nds, analogous to nus, the number of subcatchments/reaches downstream;

  • reach_v11, where possible, the nearest matching reach code from version 1.1 of the network.

  • stream_length_m, estuary_length_m, channel_length_m, pipe_length_m, and connector_length_m, the total length of line segments of each type in each reach in m;

  • tot_length_m, the total length in m of all line segment types in each reach.

  • geom, the polygon geometry.

3.2 Table cats (catchment boundaries)

This table contains the full upstream catchment for every reach in the network. I calculated the catchment boundary for each reach by selecting its subcatchment and all subcatchments upstream, and calculating the union of the subcatchments.

The stream explorer app allows downloading of catchment polygons for each site. However, I do not recommend reading or selecting the full cats table. You are less likely to cause your computer stress by using an SQL query to select the subset of catchments of interest. If site or reach codes are known for a set of study sites, the cats table provides a rapid means of producing a map of study catchments. For instance, the following code extracts the catchment boundaries of the 9 study sites of Walsh et al. (2023) and produces a map of the sites, streams and catchments (Figure 3.1).

sites <- data.frame(
        reach = c('BLI_2492','DNG_7141','BRS_1572','OLN_5632',
                  'FER_2210','MNB_3032','HVD_7836','EUM_5211','SCO_1555'),
        mgae = c(343855.99,343414.66,350856.96,355507.06,346701.42,
                 346662.57,347447.11,344887.14,333389.49),
        mgan = c(5806881.01,5810670.16,5817376.65,5824027.09,5803760.22,
                 5803370.57,5790462.91,5790487.08,5804483.51))
# These data were generated using the old projection used by mwstr v1.1
sites <- sf::st_as_sf(sites, coords = c("mgae","mgan"), crs = 28355)
sites <- sf::st_transform(sites, crs = 7855)

# db_m is the connection to the database as in Section 1.2
  # But note if using SQLite connection to the gpkg packages,
  # the connection object for cats is named db_c
streams <- sf::st_read(db_m, 
                       query = "SELECT * FROM streams WHERE sampleable = 1;")
coast <- sf::st_read(db_m, "coast")
cats_sql <- paste0("SELECT * FROM cats WHERE reach IN ('",
                      paste(sites$reach, collapse = "','"), "');")
cats <- sf::st_read(db_m, query = cats_sql)
par(mar = c(0,0,0,0))
plot(cats$geom, border = "white")
plot(streams$geom, col = "lightblue", add = TRUE)
plot(cats$geom, border = "darkgreen", add = TRUE)
plot(sites$geom, pch = 21, bg = "red", add = TRUE)
plot(coast$geom, add = TRUE)
box()

Figure 3.1: A map of 9 study sites (from Walsh et al. (2023)) and their catchments to illustrate extraction of reach catchments from the cats table.

3.3 Raster tables: r_site, r_dem, r_d2ol, r_d2str

The 5-m gridcell raster used to derive the subcs polygons is stored as a raster table, r_site, in the database. All the gridcells in each subcatchment are identified by site code (e.g. Figure 4.3A). The original digital elevation model raster r_dem, and its derivations r_d2ol (flow distance in m to outlet, i.e. terminal node of each catchment’s network) and r_d2str (flow distance in m to a stream line) are also stored. Collectively, these tables are useful for calculating reach and catchment environmental variables from raster-based land-cover data. See the next chapter for examples of extracting, plotting and analysing the raster tables, and Chapters 6, 7 and 8 for their further use for calculation of environmental variables.

The specifications of all raster tables are as follows:

# output from terra::rast(paste0(mwstr_dir,"r_site.tif"))
# Where mwstr_dir is the path to the rasters as in seciton 1.2
dimensions  : 29965, 36333, 1  (nrow, ncol, nlyr)
resolution  : 5, 5  (x, y)
extent      : 244745.5, 426410.5, 5729926, 5879751  (xmin, xmax, ymin, ymax)
coord. ref. : GDA2020 / MGA zone 55 (EPSG:7855) 

3.4 Table subc_pps (subcatchment pourpoints)

A spatial point layer recording the location of the pourpoint for each subcatchment. This table contains a single field, site, linking to the site field in the subcs table. Because the subcatchments were calculated on a 5-m gridcell raster, the pourpoints are not an exact match for the most downstream point on each stream line (which more accurately portrays the channel location. e.g. Figure 4.3 in the next chapter). The pourpoints are useful for calculations involving the stream network rasters from which the subcs layer was calculated.

3.5 Table stream_names

Christopher J Walsh and Michael J Sammonds

The table stream_names contains summary information about each of the 35,589 streams of the region.

Past stream map data for the Melbourne region lacked a systematic, unambiguous approach to naming streams. We ensured, in compiling the stream network data, that every stream (a continuous collection of lines from a headwater reach to a most downstream reach before it flows into another stream or to the sea) has a unique name that is consistent with its ‘official’ name, if it has one.

For instance, there are eight ‘Deep Creeks’ in the region. We have given each of them a unique name describing their locality (str_nm) and a unique three-digit stream code (strcode, Table 3.1).

Table 3.1: A subset of the stream_names table showing details of the eight streams variously referred to as “Deep Creek”.

fid

strcode

str_nm

nextds_strcode

termreach

headreach

nonheadwater

length_km

92

DPE

DEEP CREEK (KOOWEERUP)

Westernport North

98032

134544

0

33

164

USJ

DEEP CREEK (WESTERNPORT NEAR CORINELLA)

Westernport Southeast

107643

138676

0

4.8

392

DP2

DEEP CREEK SOUTH D.S.

DPE

92507

92507

0

0.029

1,867

IC6

DEEP CREEK CATCH DRAIN

DPE

97702

348331

0

9.5

3,208

DPC

DEEP CREEK (TRIB OF OSHANNASSY)

OSH

29722

120247

0

12

7,447

DPW

DEEP CREEK (TRIB OF MARIBYRNONG)

MRB

44243

347931

0

154

20,264

XWS

DEEP CREEK (TRIB OF DRY IN MARIBYRNONG CAT)

DRM

1223

111773

0

5.2

21,223

Y66

DEEP CREEK (TRIB OF RUNNING IN DIAMOND CAT)

RUN

25195

115748

0

10

The stream_names table also lists:

  • nextds_strcode, the strcode of the stream to which each stream flows. If the stream’s outlet is not another stream in the network, nextds_strcode is a descriptor of the marine segment or other feature to which it drains. There are 16 such descriptors (Table 3.2).

  • headreach, the most upstream reachcode (linked to tables subcs, streams) of each stream.

  • termreach, the most downstream reachcode of each stream.

  • nonheadwater, = FALSE for most streams, but = TRUE for those for which headreach is not a headwater. For instance, the Maribyrnong River is a non-headwater stream because it is the product of Deep and Jacksons Creeks (their termreaches flow to the headreach of the Maribyrnong).

  • length_km, the total length of all reaches of each stream in km.

The all_us() function, used above to retrieve all upstream sites from a given site, can also be used to retrieve all the upstream tributaries of a given stream. For instance Table 3.3 illustrates code to return the names of all tributaries of Scotchmans Creek

Table 3.2: Marine Segments, and 3 non-marine terminal segments listed in the nextds_strcode field of the stream_names table, and their definitions.

Marine.segment

Note

Bass Strait

Streams draining southern coast of the Mornington Peninsula

Bass Strait (Phillip Island)

Streams draining southern coast of Phillip Island

Goulburn catchment

Wallaby Creek, north of the Plenty River catchment

Maroondah Aqueduct

Small streams east of Sugarloaf Reservoir, draining to the Maroondah Aqueduct

Port Phillip Bay East

Streams draining into Port Phillip south of Ricketts Point to Kananook Ck

Port Phillip Bay North (Yarra plume)

The Yarra River and drains south to Ricketts Point

Port Phillip Bay Northwest

Streams west of Hobsons Bay

Port Phillip Bay South

Streams draining to the bay on the west coast of the Mornington Peninsula

Steeles Creek Floodplain

Small streams draining to the Steeles Creek Floodplain

Westernport North

Streams draining from the north into Westernport

Westernport North (French I)

Streams draining the north and eastern coasts of French Island

Westernport Southeast

Streams draining the mainland to the southeast of Westernport

Westernport Southeast (French I)

Streams draining the southern coast of French Island

Westernport Southeast (Phillip I)

Streams draining the east coast of Phillip Island

Westernport Southwest

Streams draining the east cost of the Mornington Peninsula

Westernport Southwest (Phillip I)

Streams draining the west coast of Phillip Island

allus_sco <- all_us("SCO", mwstr_connection = db_m, identifier = "strcode")
sco_trib_names <- DBI::dbGetQuery(db_m, 
                paste0("SELECT str_nm FROM stream_names WHERE strcode in ('",
                       paste(allus_sco, collapse = "','"), "');"))
ft <- flextable::flextable(data.frame(strcode = allus_sco, 
                                      str_nm = sco_trib_names))
ft <- flextable::autofit(ft)
ft
Table 3.3: All tributaries of Scotchmans Creek (strcode SCO), retrieved with the above code

strcode

str_nm

SCO

SCOTCHMANS CREEK (TRIB OF GARDINERS)

I3P

MACRINA ST DRAIN

I3Q

MONTCLAIR AVE DRAIN

HTA

OAKLEIGH NORTH DRAIN

YLU

GLEN WAVERLEY DRAIN

MTD

MOUNT WAVERLEY DRAIN

R62

TRIB (R62) OF MOUNT WAVERLEY DRAIN


  1. The version 1.2 DEM was extended to include the Wallaby Creek catchment: while outside the Melbourne Water region, these streams are the source of water flowing to Tourrourong Reservoir in the upper Plenty catchment, and have been sampled for biota by Melbourne Water in the past.↩︎

  2. There are a few streams that are treated as terminal in the dataset, and have terminal segments (nextds = -1) that do not drain to the sea. These are: Wallaby Creek, which drains to the Goulburn River; several small tributaries east of Sugarloaf reservoir that drain to the Maroondah aqueduct; and several small streams that drain to the Steeles Creek floodplain without any clear drainage connection to Steeles Creek (see Table 3.2).↩︎