regGeometry {arealDB}R Documentation

Register a new geometry entry

Description

This function registers a new geometry of territorial units into the geospatial database.

Usage

regGeometry(
  ...,
  subset = NULL,
  gSeries = NULL,
  label = NULL,
  layer = NULL,
  archive = NULL,
  archiveLink = NULL,
  nextUpdate = NULL,
  updateFrequency = NULL,
  notes = NULL,
  update = FALSE,
  overwrite = FALSE
)

Arguments

...

[character(1)]
optional named argument selecting the main territory into which this geometry is nested. The name of this must be a class of the gazetteer and the value must be one of the territory names of that class, e.g. nation = "Estonia".

subset

[character(1)]
optional argument to specify which subset the file contains. This could be a subset of territorial units (e.g. only one municipality) or of a target variable.

gSeries

[character(1)]
the name of the geometry dataseries (see regDataseries).

label

[list(.)]
list of as many columns as there are in common in the ontology and this geometry. Must be of the form list(class = columnName), with 'class' as the class of the ontology corresponding to the respective column name in the geometry.

layer

[character]
the name of the file's layer from which the geometry should be created (if applicable).

archive

[character(1)]
the original file (perhaps a *.zip) from which the geometry emerges.

archiveLink

[character(1)]
download-link of the archive.

nextUpdate

[character(1)]
value describing the next anticipated update of this dataset (in YYYY-MM-DD format).

updateFrequency

[character(1)]
value describing the frequency with which the dataset is updated, according to the ISO 19115 Codelist, MD_MaintenanceFrequencyCode. Possible values are: 'continual', 'daily', 'weekly', 'fortnightly', 'quarterly', 'biannually', 'annually', 'asNeeded', 'irregular', 'notPlanned', 'unknown', 'periodic', 'semimonthly', 'biennially'.

notes

[character(1)]
optional notes that are assigned to all features of this geometry.

update

[logical(1)]
whether or not the file 'inv_geometries.csv' should be updated.

overwrite

[logical(1)]
whether or not the geometry to register shall overwrite a potentially already existing older version.

Details

When processing geometries to which areal data shall be linked, carry out the following steps:

  1. Determine the main territory (such as a nation, or any other polygon), a subset (if applicable), the dataseries of the geometry and the ontology label, and provide them as arguments to this function.

  2. Run the function.

  3. Export the shapefile with the following properties:

    • Format: GeoPackage

    • File name: What is provided as message by this function

    • CRS: EPSG:4326 - WGS 84

    • make sure that 'all fields are exported'

  4. Confirm that you have saved the file.

Value

Returns a tibble of the entry that is appended to 'inv_geometries.csv' in case update = TRUE.

See Also

Other register functions: regDataseries(), regTable()

Examples

if(dev.interactive()){
  # build the example database
  makeExampleDB(until = "regDataseries", path = tempdir())

  # The GADM dataset comes as *.7z archive
  regGeometry(gSeries = "gadm",
              label = list(al1 = "NAME_0"),
              layer = "example_geom1",
              archive = "example_geom.7z|example_geom1.gpkg",
              archiveLink = "https://gadm.org/",
              nextUpdate = "2019-10-01",
              updateFrequency = "quarterly",
              update = TRUE)

  # The second administrative level in GADM contains names in the columns
  # NAME_0 and NAME_1
  regGeometry(gSeries = "gadm",
              label = list(al1 = "NAME_0", al2 = "NAME_1"),
              layer = "example_geom2",
              archive = "example_geom.7z|example_geom2.gpkg",
              archiveLink = "https://gadm.org/",
              nextUpdate = "2019-10-01",
              updateFrequency = "quarterly",
              update = TRUE)
}

[Package arealDB version 0.6.3 Index]