| gisco_id_api | R Documentation |
Functions to interact with the GISCO ID service API, which returns attributes and, optionally, geometry for different datasets at specified longitude and latitude coordinates.
Each available endpoint is implemented through a specific function. See Details.
gisco_id_api_geonames(
x = NULL,
y = NULL,
xmin = NULL,
ymin = NULL,
xmax = NULL,
ymax = NULL,
verbose = FALSE
)
gisco_id_api_nuts(
x = NULL,
y = NULL,
year = 2024,
epsg = c(4326, 4258, 3035),
verbose = FALSE,
nuts_id = NULL,
nuts_level = NULL,
geometry = TRUE
)
gisco_id_api_lau(
x,
y,
year = 2024,
epsg = c(4326, 4258, 3035),
verbose = FALSE,
geometry = TRUE
)
gisco_id_api_country(
x,
y,
year = 2024,
epsg = c(4326, 4258, 3035),
verbose = FALSE,
geometry = TRUE
)
gisco_id_api_river_basin(
x,
y,
year = 2019,
epsg = c(4326, 4258, 3035),
verbose = FALSE,
geometry = TRUE
)
gisco_id_api_biogeo_region(
x,
y,
year = 2016,
epsg = c(4326, 4258, 3035),
verbose = FALSE,
geometry = TRUE
)
gisco_id_api_census_grid(
x,
y,
year = 2021,
epsg = c(4326, 4258, 3035),
verbose = FALSE,
geometry = TRUE
)
x, y |
A character string or numeric value with the longitude and latitude coordinates to identify. |
xmin, ymin, xmax, ymax |
A character string or numeric value with bounding box coordinates to identify all geonames within the box. |
verbose |
A logical value. If |
year |
A character string or numeric value with the dataset year, see Details. |
epsg |
A character string or numeric value with the EPSG code for the coordinate reference system. |
nuts_id |
A character value with the NUTS ID code. |
nuts_level |
A character string with the NUTS level. One of |
geometry |
A logical value indicating whether to return geometry. If
|
The available endpoints are:
gisco_id_api_geonames(): Get geographic placenames from longitude and
latitude coordinates or a bounding box.
gisco_id_api_nuts(): Return NUTS regions from longitude and latitude
coordinates or an ID. Accepted values for year are
\Sexpr[stage=render,results=rd]{giscoR:::docs_id_years("nuts")}.
gisco_id_api_lau(): Return the ID and, optionally, geometry for Local
Administrative Units (LAU) at specified longitude and latitude coordinates.
Accepted values for year are
\Sexpr[stage=render,results=rd]{giscoR:::docs_id_years("lau")}.
gisco_id_api_country(): Return the ID and, optionally, geometry for
countries at specified longitude and latitude coordinates. Accepted values
for year are
\Sexpr[stage=render,results=rd]{giscoR:::docs_id_years("country")}.
gisco_id_api_river_basin(): Return the ID and, optionally, geometry
for river basins at specified longitude and latitude coordinates, based on
the Water Framework Directive (WFD) reference spatial datasets. Accepted
values for year are
\Sexpr[stage=render,results=rd]{giscoR:::docs_id_years("riverbasin")}.
gisco_id_api_biogeo_region(): Return the ID and, optionally,
geometry for biogeographical regions at specified longitude and latitude
coordinates. The biogeographical regions dataset contains the official
delineations used in the Habitats Directive (92/43/EEC) and for the
EMERALD Network. Accepted values for year are
\Sexpr[stage=render,results=rd]{giscoR:::docs_id_years("biogeoregion")}.
gisco_id_api_census_grid(): Return the ID and, optionally, geometry
for census grid cells at specified longitude and latitude coordinates.
Accepted values for year are
\Sexpr[stage=render,results=rd]{giscoR:::docs_id_years("censusgrid")}.
A tibble or a sf object.
https://gisco-services.ec.europa.eu/id/api-docs/.
gisco_get_nuts(), gisco_get_lau(), gisco_get_countries(),
gisco_get_census().
Other API tools:
gisco_address_api
gisco_id_api_geonames(x = -2.5, y = 43.06)
lau <- gisco_id_api_lau(x = -2.5, y = 43.06)
nuts3 <- gisco_id_api_nuts(x = -2.5, y = 43.06, nuts_level = 3)
if (all(!is.null(lau), !is.null(nuts3))) {
library(ggplot2)
ggplot(nuts3) +
geom_sf(fill = "lightblue", color = "black") +
geom_sf(data = lau, fill = "orange", color = "red") +
labs(
title = "NUTS 3 and LAU boundaries",
subtitle = "Arrasate, Basque Country, Spain",
caption = "Source: GISCO ID service API"
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.