From 035b2a0d932958e6a3f9e56072970237263fe2dc Mon Sep 17 00:00:00 2001 From: Andrew Gene Brown Date: Wed, 5 Jun 2024 14:42:50 -0700 Subject: [PATCH 1/2] get_extended_data_from_NASIS_db: fix conversion of codes to labels for microrelief --- R/get_extended_data_from_NASIS_db.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/get_extended_data_from_NASIS_db.R b/R/get_extended_data_from_NASIS_db.R index cb18d36f..275f3809 100644 --- a/R/get_extended_data_from_NASIS_db.R +++ b/R/get_extended_data_from_NASIS_db.R @@ -459,6 +459,7 @@ LEFT OUTER JOIN ( d.rf.data <- uncode(d.rf.data, dsn = dsn) d.art.data <- uncode(d.art.data, dsn = dsn) d.hz.texmod <- uncode(d.hz.texmod, dsn = dsn) + d.geomorph <- uncode(d.geomorph, dsn = dsn) # ensure that taxhistory is always character d.taxhistory[] <- lapply(uncode(d.taxhistory, dsn = dsn), function(x) if (is.factor(x)) as.character(x) else x) From 3ba6fdf7dcd9b43ee6b3454bc78e9b64850a90bb Mon Sep 17 00:00:00 2001 From: Andrew Gene Brown Date: Wed, 5 Jun 2024 14:51:08 -0700 Subject: [PATCH 2/2] fetchNASIS/.formatLandformString: append `geomfmod` column to landscape, landform, and microfeature strings where present; thanks to Gabriel Benitez for suggestion --- R/utils.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/utils.R b/R/utils.R index d6908f4d..606dd185 100644 --- a/R/utils.R +++ b/R/utils.R @@ -209,10 +209,10 @@ } # landscape - landsc.string <- paste0(unique(i.ls$geomfname), collapse = name.sep) + landsc.string <- paste0(unique(trimws(paste(i.ls$geomfmod[!is.na(i.ls$geomfmod)], i.ls$geomfname))), collapse = name.sep) # microfeature - mf.string <- paste0(unique(i.mf$geomfname[!is.na(i.mf$geomfname)]), collapse = name.sep) + mf.string <- paste0(unique(trimws(paste(i.mf$geomfmod[!is.na(i.mf$geomfmod)], i.mf$geomfname[!is.na(i.mf$geomfname)]))), collapse = name.sep) # 2d hillslope position hspp <- unique(paste0(i.gm$hillslopeprof, ifelse(i.gm$cosurfmorphhpprv, "*",""))[!is.na(i.gm$hillslopeprof)]) @@ -246,7 +246,7 @@ if(getOption('soilDB.verbose', default=FALSE)) message(paste0('Using row-order. NA in geomfeatid:', soiliid)) - ft.string <- paste(unique(i.gm$geomfname), collapse = name.sep) + ft.string <- paste(unique(trimws(paste(i.gm$geomfmod[!is.na(i.gm$geomfmod)], i.gm$geomfname))), collapse = name.sep) return(data.frame( peiid = soiliid, landform_string = ft.string,