Skip to contents

This function downloads and loads the spatial format of the weather warnings provided by Senamhi. These geometries represent preventive forecasts for severe events, indicating the areas that may be affected and the level of danger. For more information, please visit the following link: https://www.Senamhi.gob.pe/?&p=aviso-meteorologico

Usage

senamhi_get_spatial_alerts(
  data = NULL,
  nro = NULL,
  year = NULL,
  dsn = NULL,
  show_progress = TRUE,
  quiet = TRUE
)

Arguments

data

A data frame containing information on weather warnings provided by Senamhi.

nro

A numeric value representing the weather warning number.

year

A numeric value indicating the year of publication of the weather warning.

dsn

A character string specifying the output filename with the spatial format. If missing, a temporary file will be created.

show_progress

A logical value indicating whether to suppress the progress bar.

quiet

A logical value indicating whether to suppress informational messages.

Value

An sf object containing the spatial geometries of the weather alerts.

Examples

# \donttest{
library(geoidep)
data <- senamhi_get_spatial_alerts(nro = 295, year = 2024, show_progress = FALSE)
head(data)
#> Simple feature collection with 4 features and 13 fields
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -81.32823 ymin: -18.35093 xmax: -68.65228 ymax: -0.03860597
#> Geodetic CRS:  WGS 84
#>     gid nro_aviso nro_mapa   nivel  fecha_emi cod_fen cod_even   fech_ini
#> 1 15063       295        1 Nivel 1 2024-10-08       1       01 2024-10-10
#> 2 15060       295        1 Nivel 1 2024-10-08       1       01 2024-10-10
#> 3 15062       295        1 Nivel 2 2024-10-08       1       01 2024-10-10
#> 4 15061       295        1 Nivel 3 2024-10-08       1       01 2024-10-10
#>     fech_fin cod_sede respons pub cap                       geometry
#> 1 2024-10-10       00  JMESIA   3   0 POLYGON ((-80.28521 -3.4127...
#> 2 2024-10-10       00  JMESIA   3   0 POLYGON ((-73.16392 -13.652...
#> 3 2024-10-10       00  JMESIA   3   0 POLYGON ((-73.15807 -13.655...
#> 4 2024-10-10       00  JMESIA   3   0 POLYGON ((-77.83104 -6.8805...
# }