{"id":19551390,"url":"https://github.com/ropengov/giscor","last_synced_at":"2026-01-23T08:47:38.365Z","repository":{"id":46088920,"uuid":"298076366","full_name":"rOpenGov/giscoR","owner":"rOpenGov","description":"Download geospatial data from GISCO API - Eurostat","archived":false,"fork":false,"pushed_at":"2024-10-15T06:36:07.000Z","size":126724,"stargazers_count":72,"open_issues_count":3,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-29T22:31:51.751Z","etag":null,"topics":["api-wrapper","cran","eurostat","eurostat-data","ggplot2","gis","gisco","r","r-package","ropengov","rstats","spatial","thematic-maps"],"latest_commit_sha":null,"homepage":"https://ropengov.github.io/giscoR/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rOpenGov.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":"codemeta.json"},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"dieghernan","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-09-23T19:40:44.000Z","updated_at":"2024-10-15T06:30:05.000Z","dependencies_parsed_at":"2023-09-21T19:32:05.032Z","dependency_job_id":"24fff016-74aa-4920-badc-bf68b253c025","html_url":"https://github.com/rOpenGov/giscoR","commit_stats":{"total_commits":808,"total_committers":7,"mean_commits":"115.42857142857143","dds":0.2116336633663366,"last_synced_commit":"7cd08e54555bfce15a830a1c0a7e7dfe6dad2526"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rOpenGov%2FgiscoR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rOpenGov%2FgiscoR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rOpenGov%2FgiscoR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rOpenGov%2FgiscoR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rOpenGov","download_url":"https://codeload.github.com/rOpenGov/giscoR/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242681,"owners_count":20907134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-wrapper","cran","eurostat","eurostat-data","ggplot2","gis","gisco","r","r-package","ropengov","rstats","spatial","thematic-maps"],"created_at":"2024-11-11T04:13:43.795Z","updated_at":"2026-01-23T08:47:38.353Z","avatar_url":"https://github.com/rOpenGov.png","language":"R","funding_links":["https://ko-fi.com/dieghernan"],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  tidy = \"styler\",\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  warning = FALSE,\n  message = FALSE,\n  dev = \"ragg_png\",\n  dpi = 150,\n  out.width = \"100%\"\n)\n```\n\n# giscoR \u003ca href='https://ropengov.github.io/giscoR/'\u003e\u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"139\"/\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n\n[![rOpenGov\npackage](https://ropengov.github.io/rogtemplate/reference/figures/ropengov-badge.svg)](https://ropengov.org/)\n[![CRAN\nstatus](https://www.r-pkg.org/badges/version/giscoR)](https://CRAN.R-project.org/package=giscoR)\n[![CRAN\nresults](https://badges.cranchecks.info/worst/giscoR.svg)](https://cran.r-project.org/web/checks/check_results_giscoR.html)\n[![Downloads](https://cranlogs.r-pkg.org/badges/giscoR)](https://CRAN.R-project.org/package=giscoR)\n[![r-universe](https://ropengov.r-universe.dev/badges/giscoR)](https://ropengov.r-universe.dev/giscoR)\n[![R-CMD-check](https://github.com/rOpenGov/giscoR/actions/workflows/check-full.yaml/badge.svg)](https://github.com/rOpenGov/giscoR/actions/workflows/check-full.yaml)\n[![R-hub](https://github.com/rOpenGov/giscoR/actions/workflows/rhub.yaml/badge.svg)](https://github.com/rOpenGov/giscoR/actions/workflows/rhub.yaml)\n[![codecov](https://codecov.io/gh/ropengov/giscoR/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ropengov/giscoR)\n[![CodeFactor](https://www.codefactor.io/repository/github/ropengov/giscor/badge)](https://www.codefactor.io/repository/github/ropengov/giscor)\n[![DOI](https://img.shields.io/badge/DOI-10.32614/CRAN.package.giscoR-blue)](https://doi.org/10.32614/CRAN.package.giscoR)\n[![Project Status:\nActive](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n\n\u003c!-- badges: end --\u003e\n\n[**giscoR**](https://ropengov.github.io/giscoR//) is an **R** package that\nprovides a simple interface to [GISCO](https://ec.europa.eu/eurostat/web/gisco)\ndata from Eurostat. It allows you to download and work with global and European\ngeospatial datasets — such as country boundaries, NUTS regions, coastlines, and\nlabels — directly in **R**.\n\n## Key features\n\n-   Retrieve **GISCO files** for countries, regions, and administrative units.\n-   Access data at multiple resolutions: `60M`, `20M`, `10M`, `03M`, `01M`.\n-   Choose from three projections: **EPSG 4326**, **3035**, or **3857**.\n-   Works seamlessly with **sf** objects for spatial analysis.\n-   Includes **caching** for faster repeated access.\n\n## Installation\n\nInstall **giscoR** from [**CRAN**](https://CRAN.R-project.org/package=giscoR):\n\n```{r, eval=FALSE}\ninstall.packages(\"giscoR\")\n```\n\nYou can install the development version of **giscoR** with:\n\n```{r, eval=FALSE}\n# install.packages(\"pak\")\n\npak::pak(\"rOpenGov/giscoR\")\n```\n\nAlternatively, you can install **giscoR** via\n[r-universe](https://ropengov.r-universe.dev/giscoR):\n\n```{r, eval=FALSE}\ninstall.packages(\"giscoR\", repos = c(\"https://ropengov.r-universe.dev\", \"https://cloud.r-project.org\"))\n```\n\n## Quick Example\n\nThis script highlights some features of **giscoR** :\n\n```{r resolution-map, fig.alt=\"The Netherlands boundaries at different resolutions\"}\nlibrary(giscoR)\nlibrary(sf)\nlibrary(dplyr)\n\n# Download The Netherlands boundaries at different resolutions\nnl_all \u003c- lapply(c(\"60\", \"20\", \"10\", \"03\"), function(r) {\n  gisco_get_countries(country = \"Netherlands\", year = 2024, resolution = r) |\u003e\n    mutate(res = paste0(r, \"M\"))\n}) |\u003e\n  bind_rows()\n\nglimpse(nl_all)\n\n# Plot with ggplot2\n\nlibrary(ggplot2)\n\nggplot(nl_all) +\n  geom_sf(fill = \"#AD1D25\") +\n  facet_wrap(~res) +\n  labs(\n    title = \"The Netherlands boundaries at different resolutions\",\n    subtitle = \"Year: 2024\",\n    caption = gisco_attributions()\n  ) +\n  theme_minimal()\n```\n\n## Advanced Example: Thematic maps\n\nThis example shows a thematic map created with the **ggplot2** package. The data\nare obtained via the **eurostat** package. This follows the approach presented\nby [Milos Popovic](https://milospopovic.net/) in [this\npost](https://milospopovic.net/how-to-make-choropleth-map-in-r/).\n\nWe start by extracting the corresponding geographic data:\n\n```{r euroex, fig.asp=1.1}\nlibrary(giscoR)\nlibrary(dplyr)\nlibrary(eurostat)\nlibrary(ggplot2)\n\n# Get sf objects\nnuts3 \u003c- gisco_get_nuts(\n  year = 2021,\n  epsg = 3035,\n  resolution = 10,\n  nuts_level = 3\n)\n\n# Get country lines (NUTS 0 level)\n\ncountry_lines \u003c- gisco_get_nuts(\n  year = 2021,\n  epsg = 3035,\n  resolution = 10,\n  spatialtype = \"BN\",\n  nuts_level = 0\n)\n```\n\nWe now download the data from Eurostat:\n\n```{r}\n# Use eurostat\npopdens \u003c- get_eurostat(\"demo_r_d3dens\") |\u003e\n  filter(TIME_PERIOD == \"2021-01-01\")\n```\n\nFinally, we merge and manipulate the data to create the final plot:\n\n```{r thematic-map, fig.asp=1.1, fig.alt=\"Population density in 2021\"}\n# Merge data\nnuts3_sf \u003c- nuts3 |\u003e\n  left_join(popdens, by = \"geo\")\n\n# Breaks and labels\nbr \u003c- c(0, 25, 50, 100, 200, 500, 1000, 2500, 5000, 10000, 30000)\nlabs \u003c- prettyNum(br[-1], big.mark = \",\")\n\n# Label function used in the plot, mainly for NAs\nlabeller_plot \u003c- function(x) {\n  ifelse(is.na(x), \"No Data\", x)\n}\nnuts3_sf \u003c- nuts3_sf |\u003e\n  # Cut with labels\n  mutate(values_cut = cut(values, br, labels = labs))\n\n\n# Palette\npal \u003c- hcl.colors(length(labs), \"Lajolla\")\n\n\n# Plot\nggplot(nuts3_sf) +\n  geom_sf(aes(fill = values_cut), linewidth = 0, color = NA, alpha = 0.9) +\n  geom_sf(data = country_lines, col = \"black\", linewidth = 0.1) +\n  # Center in Europe: EPSG 3035\n  coord_sf(\n    xlim = c(2377294, 7453440),\n    ylim = c(1313597, 5628510)\n  ) +\n  # Legends\n  scale_fill_manual(\n    values = pal,\n    # Label for NA\n    labels = labeller_plot,\n    drop = FALSE, guide = guide_legend(direction = \"horizontal\", nrow = 1)\n  ) +\n  # Theming\n  theme_void() +\n  # Theme\n  theme(\n    plot.title = element_text(\n      color = rev(pal)[2], size = rel(1.5),\n      hjust = 0.5, vjust = -6\n    ),\n    plot.subtitle = element_text(\n      color = rev(pal)[2], size = rel(1.25),\n      hjust = 0.5, vjust = -10, face = \"bold\"\n    ),\n    plot.caption = element_text(color = \"grey60\", hjust = 0.5, vjust = 0),\n    legend.text = element_text(color = \"grey20\", hjust = .5),\n    legend.title = element_text(color = \"grey20\", hjust = .5),\n    legend.position = \"bottom\",\n    legend.title.position = \"top\",\n    legend.text.position = \"bottom\",\n    legend.key.height = unit(.5, \"line\"),\n    legend.key.width = unit(2.5, \"line\")\n  ) +\n  # Annotate and labs\n  labs(\n    title = \"Population density in 2021\",\n    subtitle = \"NUTS-3 level\",\n    fill = \"people per sq. kilometer\",\n    caption = paste0(\n      \"Source: Eurostat, \", gisco_attributions(),\n      \"\\nBased on Milos Popovic: \",\n      \"https://milospopovic.net/how-to-make-choropleth-map-in-r/\"\n    )\n  )\n```\n\n## Caching\n\nLarge datasets (e.g., LAU or high-resolution files) can exceed 50MB. Use:\n\n```{r, eval=FALSE}\ngisco_set_cache_dir(\"./path/to/location\")\n```\n\nFiles will be stored locally for faster access.\n\n## Contribute\n\nCheck the GitHub page for [source code](https://github.com/rOpenGov/giscoR/).\n\nContributions are welcome:\n\n-   [Use issue tracker](https://github.com/rOpenGov/giscoR/issues) for feedback\n    and bug reports.\n-   [Send pull requests](https://github.com/rOpenGov/giscoR/)\n-   [Star us on the GitHub page](https://github.com/rOpenGov/giscoR)\n\n## Citation\n\n```{r echo=FALSE, results='asis'}\nprint(citation(\"giscoR\"), bibtex = FALSE)\n```\n\nA BibTeX entry for LaTeX users is\n\n```{r echo=FALSE, comment=\"\"}\ntoBibtex(citation(\"giscoR\"))\n```\n\n## General copyright\n\n\u003e [Eurostat's general copyright notice and licence\n\u003e policy](https://ec.europa.eu/eurostat/web/main/help/copyright-notice) applies.\n\u003e Moreover, there are specific rules that apply to some of the following\n\u003e datasets available for downloading. The download and use of these data are\n\u003e subject to these rules being accepted. See our [administrative\n\u003e units](https://ec.europa.eu/eurostat/web/gisco/geodata/administrative-units)\n\u003e and [statistical\n\u003e units](https://ec.europa.eu/eurostat/web/gisco/geodata/statistical-units) for\n\u003e more details.\n\u003e\n\u003e Source: \u003chttps://ec.europa.eu/eurostat/web/gisco/geodata\u003e\n\n## Disclaimer\n\nThis package is neither affiliated with nor endorsed by Eurostat. The authors\nare not responsible for any misuse of the data.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropengov%2Fgiscor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fropengov%2Fgiscor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropengov%2Fgiscor/lists"}