View source: R/ogc_api_statfi.R
ogc_get_statfi_area_pop | R Documentation |
Retrieves municipality or other administrative (multi)polygons with population data from Statistics Finland's OGC API. Supports different years and coordinate reference systems for Finnish administrative boundaries at a fixed scale of 1:4,500,000.
ogc_get_statfi_area_pop(year = 2023, crs = 3067, limit = NULL, bbox = NULL)
year |
Integer. Year of the administrative borders and population data. Options: 2019, 2020, 2021. Default: 2021. |
crs |
Integer. Coordinate Reference System (EPSG code). Options: 3067 (ETRS89 / TM35FIN), 4326 (WGS84). Default: 3067. |
limit |
Integer or NULL. Maximum number of features to retrieve. If NULL, retrieves all available features. Default: NULL. |
bbox |
Character or NULL. Bounding box for spatial filtering in format "xmin,ymin,xmax,ymax" (in the specified CRS). Default: NULL. |
An sf
object containing spatial data and population statistics, pivoted to wide format with variables as columns, or NULL if no data is retrieved.
Markus Kainu markus.kainu@kapsi.fi
## Not run:
# Get population data for 2020
pop_data <- ogc_get_statfi_area_pop(year = 2020, crs = 3067)
# Get population data within a bounding box
bbox <- "200000,6600000,500000,6900000"
pop_data <- ogc_get_statfi_area_pop(year = 2021, bbox = bbox, crs = 3067)
# Limit to 10 features
pop_data <- ogc_get_statfi_area_pop(year = 2019, limit = 10, crs = 4326)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.