Returns the data source watercourse_100mseg as a list of two sf objects:

  • lines (LINESTRING geometry): represents line segments of length 100 m derived from the raw watercourses data source;

  • points (POINT geometry): represents the downstream endpoints of all segments ('downstream' as defined in watercourses).

Optionally, only one of these objects is returned. The coordinate reference system is 'BD72 / Belgian Lambert 72' (EPSG-code 31370).

read_watercourse_100mseg(
  file = file.path(locate_n2khab_data(),
    "20_processed/watercourse_100mseg/watercourse_100mseg.gpkg"),
  element = NULL,
  version = "watercourse_100mseg_20200807v1"
)

Arguments

file

The absolute or relative file path of the data source. The default follows the data management advice in the vignette on data storage (run vignette("v020_datastorage")). It uses the first n2khab_data folder that is found when sequentially climbing up 0 to 10 levels in the file system hierarchy, starting from the working directory.

element

Optional string. The string must be one of two possible values: "lines" or "points". If set, either the lines or the points object will be returned, respectively.

version

Version ID of the data source. Defaults to the latest available version defined by the package.

Value

By default, a list of two sf objects (see 'Description'). The lines and the points objects have the same number of rows. They share the same attributes:

rank

A unique, incremental number for each segment/endpoint. It just reflects the downstream-to-upstream order of segments within each original line.

vhag_code

The VHAG code from the raw watercourses data source. It distinguishes the different watercourses, so it is common to all segments/points that belong to the same watercourse.

Optionally, only one of these sf objects is returned.

Details

The data source watercourse_100mseg represents all officially known watercourses of the Flemish Region as line segments of 100 m (or < 100 m, for the most upstream segment of a watercourse). The data source can be used as a base layer of statistical population units (line segments) and corresponding anchor points, in the design of monitoring and research of watercourses.

The data source is a GeoPackage, available at Zenodo, and contains two spatial layers:

  • watercourse_100mseg_lines: the line segments;

  • watercourse_100mseg_points: the corresponding downstream endpoints.

Both layers have the same number of rows and share the same attributes.

The data source was derived from the raw watercourses data source as follows:

  1. each line ('watercourse') of watercourses is split into segments of 100 m, where the remaining segment of < 100 m (per original line) is situated most upstream. For this step, the direction of the lines has been reverted (in watercourses the direction is from upstream to downstream). A unique rank number is assigned to each segment, as well as the VHAG code from the corresponding line in watercourses.

  2. the downstream endpoint of each segment is located, and assigned the same attributes (rank and vhag_code).

The R and GRASS code for creating the watercourse_100mseg data source can be found in the n2khab-preprocessing repository.

See also

Other functions returning environmental data sets: read_shallowgroundwater(), read_soilmap(), read_watersurfaces()

Examples

if (FALSE) {
# This example supposes that your working directory or a directory up to 10
# levels above has the 'n2khab_data' folder AND that the latest version of the
# 'watercourse_100mseg' data source is present in the default subdirectory.
# In all other cases, this example won't work but at least you can
# consider what to do.

(lines <- read_watercourse_100mseg(element = "lines"))
(points <- read_watercourse_100mseg(element = "points"))
str(read_watercourse_100mseg(), give.attr = FALSE)
}