Skip to contents

Get latest tiger mosquito colonisation data in France from the online map at https://signalement-moustique.anses.fr/signalement_albopictus/colonisees.

Usage

get_tiger_mosquito_colonisation_in_france(
  output = c("sf", "geojson"),
  page = NULL,
  timeout = 60,
  max_retries = 3,
  retry_delay = 5,
  user_agent = NULL
)

Arguments

output

The output format. Can be either "sf" or "geojson".

page

Optional pre-fetched HTML page source code (as a character vector of lines or a single string). If NULL (the default), the page will be downloaded automatically.

timeout

Connection timeout in seconds when downloading the page. Default is 60.

max_retries

Maximum number of download attempts. Default is 3.

retry_delay

Base delay in seconds between retries (exponential backoff with jitter). Default is 5.

user_agent

Custom User-Agent header string. Defaults to alboFr/<version> (R <version>; <platform>).

Value

If output = "sf", an sf object with the tiger mosquito colonisation data in France. All polygons that exist on the map are covering the territories where the tiger mosquito (Aedes Albopictus) has alreadt been detected in France. If output = "geojson", a GeoJSON in a character vector with the tiger mosquito colonisation data in France. Using the 'geojson' option allows to use the package without the sf package. You can therefore just save the resulting string to a text file. See examples.

Examples

if (FALSE) { # \dontrun{
# get the latest data in `sf`
x <- get_tiger_mosquito_colonisation_in_france(output = "sf")

# save the data to GeoPackage file with `sf`
if (interactive()) {
  library(sf)
  st_write(x, "tiger_mosquito_colonisation_in_france.gpkg")
}

# fetch once and reuse page for both data and metadata
page_html <- fetch_tiger_mosquito_page()
x_sf <- get_tiger_mosquito_colonisation_in_france(output = "sf", page = page_html)
x_meta <- get_tiger_mosquito_colonisation_metadata(page = page_html)

# get the latest data in `geojson`
x <- get_tiger_mosquito_colonisation_in_france(output = "geojson")

# save the data to text file
if (interactive()) {
  writeLines(x, "tiger_mosquito_colonisation_in_france.geojson")
}
} # }