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

regGeometry(
  ...,
  subset = NULL,
  gSeries = NULL,
  label = NULL,
  ancillary = NULL,
  layer = NULL,
  archive = NULL,
  archiveLink = NULL,
  downloadDate = NULL,
  updateFrequency = NULL,
  notes = NULL,
  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.

ancillary

[list(.)]
optinal list of columns containing ancillary information. Must be of the form list(attribute = columnName), where attribute can be one or several of

  • "name_ltn" (the english name in latin letters)

  • "name_lcl" (the name in local language and letters)

  • "code" (any code describing the unit)

  • "type" (the type of territorial unit)

  • "uri" (the semantic web URI) or

  • "flag" (any flag attributed to the unit).

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.

downloadDate

[character(1)]
value describing the download date 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.

overwrite

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

Value

Returns a tibble of the entry that is appended to 'inv_geometries.csv'.

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.

See also

Other register functions: regDataseries(), regTable()

Examples

if(dev.interactive()){
  # build the example database
  adb_exampleDB(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")

  # 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"),
              ancillary = list(name_lcl = "VARNAME_1", code = "GID_1", type = "TYPE_1"),
              layer = "example_geom2",
              archive = "example_geom.7z|example_geom2.gpkg",
              archiveLink = "https://gadm.org/",
              nextUpdate = "2019-10-01",
              updateFrequency = "quarterly")
}