Skip to content

Commit

Permalink
Merge pull request #79 from addelany/main
Browse files Browse the repository at this point in the history
update bbox method
  • Loading branch information
addelany authored May 10, 2024
2 parents 22afdde + 251c83d commit 5fb6c93
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
6 changes: 2 additions & 4 deletions R/build_forecast_scores.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ build_forecast_scores <- function(table_schema,
link_items,
thumbnail_link,
thumbnail_title,
group_sites,
model_child
){

Expand Down Expand Up @@ -146,10 +147,7 @@ build_forecast_scores <- function(table_schema,
"title" = theme_title,
"extent" = list(
"spatial" = list(
'bbox' = list(list(as.numeric(catalog_config$bbox$min_lon),
as.numeric(catalog_config$bbox$min_lat),
as.numeric(catalog_config$bbox$max_lon),
as.numeric(catalog_config$bbox$max_lat)))),
'bbox' = stac4cast::get_bbox(site_metadata = catalog_config$site_metadata_url, sites = group_sites)),
"temporal" = list(
'interval' = list(list(
paste0(start_date,"T00:00:00Z"),
Expand Down
6 changes: 1 addition & 5 deletions R/build_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ build_model <- function(model_id,
"stac_extensions"= list('https://stac-extensions.github.io/table/v1.2.0/schema.json'),
"type"= "Feature",
"id"= model_id,
"bbox"=
list(list(as.numeric(catalog_config$bbox$min_lon),
as.numeric(catalog_config$bbox$max_lat),
as.numeric(catalog_config$bbox$max_lon),
as.numeric(catalog_config$bbox$max_lat))),
"bbox"= stac4cast::get_bbox(site_metadata = site_table, sites = site_values),
"geometry"= list(
"type"= catalog_config$site_type,
"coordinates"= stac4cast::get_site_coords(site_metadata = site_table, sites = site_values)
Expand Down
8 changes: 0 additions & 8 deletions R/get_bbox.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ get_bbox <-function(site_metadata, sites){

if (!is.null(sites)){

# site_lat <- site_df |>
# filter(field_site_id %in% (sites)) |>
# select(latitude)
#
# site_lon <- site_df |>
# filter(field_site_id %in% (sites)) |>
# select(longitude)

if ('site_id' %in% names(site_df) == FALSE){
site_df <- site_df |>
rename(site_id = field_site_id) ## rename the neon site_id column
Expand Down

0 comments on commit 5fb6c93

Please sign in to comment.