Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions R/RomFeature.R
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ RomFeature <- R6Class(
get_raster_ts = function(
varkey = 'prism_mod_daily',
starttime = FALSE,
endtime = '2025-10-13',
endtime = FALSE,
band = '1',
aggregate = FALSE,
metric = 'mean'
Expand All @@ -244,10 +244,10 @@ RomFeature <- R6Class(
startclause = "(1 = 1)"
endclause = "(1 = 1)"
if (!is.logical(starttime)) {
startclause = fn$paste0("met.tstime >= extract(epoch from '$starttime'::date)")
startclause = paste0("met.tstime >= extract(epoch from '",starttime,"'::date)")
}
if (!is.logical(endtime)) {
endclause = fn$paste0("met.tsendtime <= extract(epoch from '$endtime'::date)")
endclause = paste0("met.tsendtime <= extract(epoch from '",endtime,"'::date)")
}
if (!is.logical(aggregate)) {
rastercalc = fn$paste0("$aggregate((ST_summarystats(st_clip(met.rast, fgeo.dh_geofield_geom), 1, TRUE)).$metric)")
Expand Down
22 changes: 21 additions & 1 deletion R/cia_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -801,4 +801,24 @@ is.empty <- function (x, ...)
return(FALSE)
}
else sapply(x, is.empty, trim = trim, ...)
}
}

fn_handletimestamp <- function(ts) {
# don't do date_received as this is a field and is handled there
if ( (ts != '') & !is.null(ts)) {
orig = ts;
# if a valid unix epoch style timestamp has been submitted
# this next will try to convert a string
if (is.na(as.numeric(ts))) {
# must be a formatted date, not a timestamp integer/float
# not a valid unix timestamp, so try to convert from some date format
if (!is.na(ymd(ts))) {
ts=ymd(ts)
} else if (!is.na(mdy(ts))) {
ts=mdy(ts)
}
message(paste("Converted orig to Epoch:", ts))
}
}
return(ts)
}
Binary file added wa_13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wa_pre_alloc_50pct.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.