R functions to extract these in R (mirrors the command line functions of the same name). @COBrogan
basepath='/var/www/R';
source(paste(basepath,'config.R',sep='/'))
library('knitr')
library('dataRetrieval')
riverseg="RU2_6090_6220"
riverseg_feature <- RomFeature$new(ds,list(hydrocode=paste0('vahydrosw_wshed_',riverseg),bundle='watershed',ftype='vahydro'),TRUE)
riverseg_model <- riverseg_feature$get_prop(
riverseg_feature$propvalues(propcode='vahydro-1.0')[1,]$propname
)
landseg='H51113'
landseg_feature <- RomFeature$new(ds,list(hydrocode=landseg,bundle='landunit',ftype='cbp6_landseg'),TRUE)
landseg_model <- landseg_feature$get_prop(propcode='cbp-6.1')
version='p6'
instance='vadeq'
get_landsegs <- function(riverseg,version, instance, site='http://deq1.bse.vt.edu:81') {
uri=paste(site,version,instance,'config/seglists',paste0(riverseg,'.land'), sep='/')
segs = httr::GET(uri, encode = "text")
return(content(segs, as="text"))
}
R functions to extract these in R (mirrors the command line functions of the same name). @COBrogan
get_landsegsworks but does not parse, only returns the whole text file. If we had an R regexp to parse these, that would be ideal.get_landsegs("RU2_6090_6220",version="p6",instance="vadeq")set segments = ( H51079 H51113 L51079 N51079 N51113 )get_landsegsandget_riversegscbp_wsm#73