| Title: | Get French Data on Tiger Mosquito Colonisation |
|---|---|
| Description: | Get French Data on Tiger Mosquito (Aedes Albopictus) colonisation in France from the online map at <https://signalement-moustique.anses.fr/signalement_albopictus/colonisees>. |
| Authors: | Egor Kotov [aut, cre] (ORCID: <https://orcid.org/0000-0001-6690-5345>) |
| Maintainer: | Egor Kotov <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.0.9000 |
| Built: | 2026-09-26 09:55:29 UTC |
| Source: | https://github.com/e-kotov/alboFr |
Downloads the HTML source code from the official ANSES tiger mosquito map with configurable connection timeout, automatic retries with exponential backoff and jitter, and a descriptive User-Agent header.
fetch_tiger_mosquito_page( url = source_url_tiger_mosquito, timeout = 60, max_retries = 3, retry_delay = 5, user_agent = NULL, sleep_func = Sys.sleep )fetch_tiger_mosquito_page( url = source_url_tiger_mosquito, timeout = 60, max_retries = 3, retry_delay = 5, user_agent = NULL, sleep_func = Sys.sleep )
url |
The URL of the webpage to fetch. Defaults to the official ANSES tiger mosquito colonisation page. |
timeout |
Connection timeout in seconds. Default is |
max_retries |
Maximum number of fetch attempts. Default is |
retry_delay |
Base delay in seconds between retries (uses exponential backoff with jitter). Default is |
user_agent |
Custom User-Agent header string. Defaults to |
sleep_func |
Internal function used for delays during backoff. Defaults to |
A single character string containing the raw HTML content encoded in UTF-8.
## Not run: # Fetch page with custom timeout and retries page_html <- fetch_tiger_mosquito_page(timeout = 30, max_retries = 2) # Reuse fetched page across data and metadata extraction data <- get_tiger_mosquito_colonisation_in_france(page = page_html, output = "geojson") meta <- get_tiger_mosquito_colonisation_metadata(page = page_html) ## End(Not run)## Not run: # Fetch page with custom timeout and retries page_html <- fetch_tiger_mosquito_page(timeout = 30, max_retries = 2) # Reuse fetched page across data and metadata extraction data <- get_tiger_mosquito_colonisation_in_france(page = page_html, output = "geojson") meta <- get_tiger_mosquito_colonisation_metadata(page = page_html) ## End(Not run)
Get latest tiger mosquito colonisation data in France from the online map at https://signalement-moustique.anses.fr/signalement_albopictus/colonisees.
get_tiger_mosquito_colonisation_in_france( output = c("sf", "geojson"), page = NULL, timeout = 60, max_retries = 3, retry_delay = 5, user_agent = NULL )get_tiger_mosquito_colonisation_in_france( output = c("sf", "geojson"), page = NULL, timeout = 60, max_retries = 3, retry_delay = 5, user_agent = NULL )
output |
The output format. Can be either |
page |
Optional pre-fetched HTML page source code (as a character vector of lines or a single string). If |
timeout |
Connection timeout in seconds when downloading the page. Default is |
max_retries |
Maximum number of download attempts. Default is |
retry_delay |
Base delay in seconds between retries (exponential backoff with jitter). Default is |
user_agent |
Custom User-Agent header string. Defaults to |
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.
## Not run: # 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") } ## End(Not run)## Not run: # 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") } ## End(Not run)
Fetch metadata from the ANSES online map page, including the official update date displayed on the page when it can be parsed.
get_tiger_mosquito_colonisation_metadata( page = NULL, timeout = 60, max_retries = 3, retry_delay = 5, user_agent = NULL )get_tiger_mosquito_colonisation_metadata( page = NULL, timeout = 60, max_retries = 3, retry_delay = 5, user_agent = NULL )
page |
Optional pre-fetched HTML page source code (as a character vector of lines or a single string). If |
timeout |
Connection timeout in seconds when downloading the page. Default is |
max_retries |
Maximum number of download attempts. Default is |
retry_delay |
Base delay in seconds between retries (exponential backoff with jitter). Default is |
user_agent |
Custom User-Agent header string. Defaults to |
A named list with source_url, source_official_update_date, and
fetched_at.
## Not run: # Fetch metadata directly meta <- get_tiger_mosquito_colonisation_metadata() # Reuse a pre-fetched page page_html <- fetch_tiger_mosquito_page() meta <- get_tiger_mosquito_colonisation_metadata(page = page_html) ## End(Not run)## Not run: # Fetch metadata directly meta <- get_tiger_mosquito_colonisation_metadata() # Reuse a pre-fetched page page_html <- fetch_tiger_mosquito_page() meta <- get_tiger_mosquito_colonisation_metadata(page = page_html) ## End(Not run)
Compute a SHA-256 hash for the set of GeoJSON features. The hash is stable to feature order, whitespace, and JSON formatting changes.
get_tiger_mosquito_dataset_hash(x)get_tiger_mosquito_dataset_hash(x)
x |
A GeoJSON string or path to a GeoJSON file. |
Individual feature SHA-256 hashes are computed (using 15-digit coordinate
precision and radix-sorted properties) and then sorted in byte-wise order
using sort(..., method = "radix"). A SHA-256 digest is then computed over
the resulting canonical FeatureCollection structure.
A SHA-256 hash as a character vector of length 1.
Compute one SHA-256 hash per GeoJSON feature after normalising JSON object ordering and excluding archive-added fields.
get_tiger_mosquito_feature_hashes(x)get_tiger_mosquito_feature_hashes(x)
x |
A GeoJSON string or path to a GeoJSON file. |
Canonical feature hashing follows these normalization rules:
Radix key ordering: Object keys are sorted using
order(..., method = "radix") to ensure byte-wise (C-locale)
deterministic ordering regardless of session LC_COLLATE settings.
15-digit coordinate precision: Geometry coordinates are
serialized with digits = 15, preserving IEEE-754 double precision
for stable coordinate representation across platforms while absorbing
minor floating-point printing artifacts across snapshots.
Excluded metadata: Archive-added and metadata attributes
(feature_hash, source_url,
source_official_update_date, fetched_at,
data_canonical_sha256, and
previous_data_canonical_sha256) are removed prior to hashing.
A character vector of SHA-256 hashes, one per feature.