clientConfigFile<-"~/.usgs/lcmap.ini"
clientSection<-"LCMAP Client"
#' Read the LCMAP client configuration file
#'
#' @param filename filename
#' @export
#' @family config
#' @examples
#' getIni()
#' getIni("~/.usgs/lcmap.ini")
getIni<-function (filename) {
if (missing(filename)) {
filename<-clientConfigFile
}
iniData<-raster::readIniFile(filename)
matches<-c(which(outer(iniData[,"section"], clientSection, "==")),
arr.ind=TRUE)
return(iniData[1:nrow(iniData) %in% matches, ])
}
#' Get the LCMAP client configuration as a hashmap
#'
#' @param filename filename
#' @export
#' @family config
#' @examples
#' getCfg()
#' getCfg("~/.usgs/lcmap.ini")
getCfg<-function (filename) {
clientIniData<-getIni(filename)
return(hash::hash(keys=clientIniData[,"name"],
values=clientIniData[,"value"]))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.