create_spatialVector generates a EML entity of type spatialVector

create_spatialVector(
  svname,
  description,
  geoDescription,
  baseURL = "https://data.gios.asu.edu/datasets/cap/",
  projectNaming = TRUE
)

Arguments

svname

(character) The unquoted name of the spatial data object in the R environment.

description

(character) Description of the vector resource.

geoDescription

(character) A textual description of the geographic study area of the vector. This parameter allows the user to overwrite the geographicDesciption value provided in the project config.yaml.

baseURL

(character) The base path of the web-accessible location of the data file; the name of the resulting file will be passed to the base path to generate a web-resolvable file path. This parameter is required with the default set to the CAP LTER file path

projectNaming

(logical) Logical indicating if the vector file (or parent directory if zipFiles == TRUE) should be renamed per the style used by the CAP LTER (default) with the project id + base file name + md5sum + file extension. The passed file or directory name will be used if this parameter is set to FALSE.

Value

EML spatialVector object is returned. Additionally, the spatial data entity is written to file as type kml, and renamed with the project id + base file name + file extension (kml in this case).

Details

create_spatialVector creates a EML spatialVector object from a spatial data object (shapefile, kml) that is read into the R environment. The function reads the attributes and classes contained within a supporting yaml file generated from the capeml::write_attributes function - create_spatialVector will look for a file in the working directory with a name of type spatialEntityName_attrs.yaml. Because all attributes written to a kml (the output of create_spatialVector are of type character, factors are not considered in this workflow). Note that this functionality is predicated on the existence of a file containing metadata about the attributes, that that file is in the working directory, and that the file matches the name of the spatial data entity precisely. In addition to generating a EML entity of type spatialVector, create_spatialVector writes the spatial entity in the R environment to file as type kml. Unless projectNaming is set to false, the output file is renamed with the file with project id + base file name + file extension (kml in this case).

Note

create_spatialVector will look for a package number (packageNum) in config.yaml; this parameter is not passed to the function and it must exist.

create_spatialVector currently accepts an argument for a base url path to which the new file name will be appended so as to be a web-resolvable file; the package defaults to a URL specific to the CAP LTER.

Because file name metadata is incorporated into the kml generated from the sf::st_write function, including the md5 hash of the object in the file name sensu other products generated by capeml* packages is not feasible for spatialVector objects.

All vector objects are transformed to epsg 4326 (WGS 1984)