We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Per noaa-onms/climate-dashboard: /scripts/get_data.R#L182-L233
# get geospatial attributes a <- ed$alldata$NC_GLOBAL |> filter( attribute_name |> str_starts("geospatial_"), data_type == "double") |> select(attribute_name, value) g <- setNames(as.numeric(a$value), a$attribute_name) |> as.list() lon_half <- g$geospatial_lon_resolution/2 lat_half <- g$geospatial_lat_resolution/2 # setup raster with potentially different xres() and yres() r_template <- rast( xmin = min(x$lon) - lon_half, xmax = max(x$lon) + lon_half, ymin = min(x$lat) - lat_half, ymax = max(x$lat) + lat_half, resolution = c( g$geospatial_lon_resolution, g$geospatial_lat_resolution), crs = "epsg:4326") df_to_rast <- function(df, r_template){ # data frame to points p <- df |> select(lon, lat, all_of(ed_row$var)) |> st_as_sf( coords = c("lon", "lat"), crs = 4326) # points to raster rasterize(p, r_template, field = ed_row$var) } x <- x |> group_by(date) |> nest(data = all_of(c("lon", "lat", ed_row$var))) |> mutate( r = map(data, df_to_rast, r_template)) stk <- rast(x$r) names(stk) <- glue("{ed_row$var}_{as.character(x$date) |> str_replace_all('-','.')}") crs(stk) <- "EPSG:4326"
extractr/R/read.R
Lines 334 to 390 in 3b8feb6
The text was updated successfully, but these errors were encountered:
test_throttling.qmd working #5, #3
2c9e358
No branches or pull requests
TODO: NEW
Per noaa-onms/climate-dashboard: /scripts/get_data.R#L182-L233
CURRENT
extractr/R/read.R
Lines 334 to 390 in 3b8feb6
The text was updated successfully, but these errors were encountered: