Returns the raw data source habitatsprings as an sf point layer in the Belgian Lambert 72 CRS (EPSG-code 31370). Optionally, a derived sf object of type-7220-locations can be returned at the population unit level, through aggregation by unit_id.

read_habitatsprings(
  file = file.path(fileman_up("n2khab_data"),
    "10_raw/habitatsprings/habitatsprings.geojson"),
  filter_hab = FALSE,
  units_7220 = FALSE,
  version = "habitatsprings_2020v2"
)

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.

filter_hab

If TRUE, only points with (potential) habitat are returned. The default value is FALSE.

units_7220

If TRUE, an sf object of type-7220-locations is returned at the population unit level. To accomplish this, the data source is aggregated by unit_id. Multiple points belonging to the same unit are replaced by their centroid, their area attribute is summed (if all values are known) and for other attributes the maximum value is returned.

version

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

Value

A Simple feature collection of type POINT, with attribute variables:

  • point_id

  • name: site name.

  • system_type: environmental typology of 7220: mire, rivulet or unknown (non-7220 types are NA)

  • code_orig: original type code in raw habitatsprings.

  • type: habitat type listed in types.

  • certain: TRUE when the type is certain and FALSE when the type is uncertain.

  • unit_id: population unit id for large scale sampling events. Spatially close points have the same value.

  • area_m2: area as square meters.

  • year: year of field inventory.

  • in_sac: logical. Is the site situated within a Special Area of Conservation?

  • source: original data source of the record.

Note that the type and system_type variables have implicit NA values (i.e. there is no factor level to represent the missing values). If you want this category to appear in certain results, you can add it as a level with forcats::fct_explicit_na().

With units_7220 = TRUE, variable point_id is dropped and an extra attribute variable nr_of_points is added. It represents the number of points that belong to each unit.

Details

The data source habitatsprings is a GeoJSON file (conforming to the RFC7946 specifications), available at Zenodo. It represents sites that correspond with presence or absence of the Natura 2000 habitat type 7220 (Petrifying springs with tufa formation (Cratoneurion)) in springs and streaming water segments in the Flemish Region, Belgium.

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 'habitatsprings'
# 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.

hs <- read_habitatsprings()
hs
hs2 <- read_habitatsprings(units_7220 = TRUE)
hs2
}