Giter VIP home page Giter VIP logo

giscor's Introduction

giscoR

rOG-badge CRAN status CRAN results Downloads r-universe R-CMD-check R-hub codecov CodeFactor DOI Project Status: Active

giscoR is an API package that helps to retrieve data from Eurostat - GISCO (the Geographic Information System of the COmmission). It also provides some lightweight data sets ready to use without downloading.

GISCO is a geospatial open data repository including several data sets as countries, coastal lines, labels or NUTS levels. The data sets are usually provided at several resolution levels (60M/20M/10M/03M/01M) and in 3 different projections (4326/3035/3857).

Note that the package does not provide metadata on the downloaded files, the information is available on the API webpage.

Full site with examples and vignettes on https://ropengov.github.io/giscoR/

Installation

Install giscoR from CRAN:

install.packages("giscoR")

You can install the developing version of giscoR with:

remotes::install_github("rOpenGov/giscoR")

Alternatively, you can install giscoR using the r-universe:

install.packages("giscoR",
  repos = c("https://ropengov.r-universe.dev", "https://cloud.r-project.org")
)

Usage

This script highlights some features of giscoR :

library(giscoR)
library(sf)
library(dplyr)

# Different resolutions
DNK_res60 <- gisco_get_countries(resolution = "60", country = "DNK") %>%
  mutate(res = "60M")
DNK_res20 <-
  gisco_get_countries(resolution = "20", country = "DNK") %>%
  mutate(res = "20M")
DNK_res10 <-
  gisco_get_countries(resolution = "10", country = "DNK") %>%
  mutate(res = "10M")
DNK_res03 <-
  gisco_get_countries(resolution = "03", country = "DNK") %>%
  mutate(res = "03M")


DNK_all <- bind_rows(DNK_res60, DNK_res20, DNK_res10, DNK_res03)

# Plot ggplot2

library(ggplot2)

ggplot(DNK_all) +
  geom_sf(fill = "tomato") +
  facet_wrap(vars(res)) +
  theme_minimal()

# Labels and Lines available

labs <- gisco_get_countries(
  spatialtype = "LB",
  region = "Africa",
  epsg = "3857"
)

coast <- gisco_get_countries(
  spatialtype = "COASTL",
  epsg = "3857"
)

# For zooming
afr_bbox <- st_bbox(labs)

ggplot(coast) +
  geom_sf(col = "deepskyblue4", linewidth = 3) +
  geom_sf(data = labs, fill = "springgreen4", col = "darkgoldenrod1", size = 5, shape = 21) +
  coord_sf(
    xlim = afr_bbox[c("xmin", "xmax")],
    ylim = afr_bbox[c("ymin", "ymax")]
  )

Labels

An example of a labeled map using ggplot2:

ITA <- gisco_get_nuts(country = "Italy", nuts_level = 1)

ggplot(ITA) +
  geom_sf() +
  geom_sf_text(aes(label = NAME_LATN)) +
  theme(axis.title = element_blank())

Thematic maps

An example of a thematic map plotted with the ggplot2 package. The information is extracted via the eurostat package (Lahti et al. 2017). We would follow the fantastic approach presented by Milos Popovic on this post:

We start by extracting the corresponding geographic data:

# Get shapes
nuts3 <- gisco_get_nuts(
  year = "2021",
  epsg = "3035",
  resolution = "10",
  nuts_level = "3"
)

# Group by NUTS by country and convert to lines
country_lines <- nuts3 %>%
  group_by(
    CNTR_CODE
  ) %>%
  summarise(n = n()) %>%
  st_cast("MULTILINESTRING")

We now download the data from Eurostat:

# Use eurostat
library(eurostat)
popdens <- get_eurostat("demo_r_d3dens") %>%
  filter(TIME_PERIOD == "2021-01-01")

By last, we merge and manipulate the data for creating the final plot:

# Merge data
nuts3_sf <- nuts3 %>%
  left_join(popdens, by = "geo")

nuts3_sf <- nuts3 %>%
  left_join(popdens, by = c("NUTS_ID" = "geo"))


# Breaks and labels

br <- c(0, 25, 50, 100, 200, 500, 1000, 2500, 5000, 10000, 30000)
labs <- prettyNum(br[-1], big.mark = ",")

# Label function to be used in the plot, mainly for NAs
labeller_plot <- function(x) {
  ifelse(is.na(x), "No Data", x)
}
nuts3_sf <- nuts3_sf %>%
  # Cut with labels
  mutate(values_cut = cut(values, br, labels = labs))


# Palette
pal <- hcl.colors(length(labs), "Lajolla")


# Plot
ggplot(nuts3_sf) +
  geom_sf(aes(fill = values_cut), linewidth = 0, color = NA, alpha = 0.9) +
  geom_sf(data = country_lines, col = "black", linewidth = 0.1) +
  # Center in Europe: EPSG 3035
  coord_sf(
    xlim = c(2377294, 7453440),
    ylim = c(1313597, 5628510)
  ) +
  # Legends
  scale_fill_manual(
    values = pal,
    # Label for NA
    labels = labeller_plot,
    drop = FALSE, guide = guide_legend(direction = "horizontal", nrow = 1)
  ) +
  # Theming
  theme_void() +
  # Theme
  theme(
    plot.title = element_text(
      color = rev(pal)[2], size = rel(1.5),
      hjust = 0.5, vjust = -6
    ),
    plot.subtitle = element_text(
      color = rev(pal)[2], size = rel(1.25),
      hjust = 0.5, vjust = -10, face = "bold"
    ),
    plot.caption = element_text(color = "grey60", hjust = 0.5, vjust = 0),
    legend.text = element_text(color = "grey20", hjust = .5),
    legend.title = element_text(color = "grey20", hjust = .5),
    legend.position = "bottom",
    legend.title.position = "top",
    legend.text.position = "bottom",
    legend.key.height = unit(.5, "line"),
    legend.key.width = unit(2.5, "line")
  ) +
  # Annotate and labs
  labs(
    title = "Population density in 2021",
    subtitle = "NUTS-3 level",
    fill = "people per sq. kilometer",
    caption = paste0(
      "Source: Eurostat, ", gisco_attributions(),
      "\nBased on Milos Popovic: ",
      "https://milospopovic.net/how-to-make-choropleth-map-in-r/"
    )
  )

A note on caching

Some data sets (as Local Administrative Units - LAU, or high-resolution files) may have a size larger than 50MB. You can use giscoR to create your own local repository at a given local directory passing the following function:

gisco_set_cache_dir("./path/to/location")

You can also download manually the files (.geojson format) and store them on your local directory.

Recommended packages

API data packages

  • eurostat (Lahti et al. 2017): This is an API package that provides access to open data from Eurostat.

Plotting sf objects

Some packages recommended for visualization are:

Contribute

Check the GitHub page for source code.

Contributions are very welcome:

Citation

To cite ‘giscoR’ in publications use:

Hernangómez D (2024). giscoR: Download Map Data from GISCO API - Eurostat. doi:10.32614/CRAN.package.giscoR https://doi.org/10.32614/CRAN.package.giscoR, https://ropengov.github.io/giscoR/.

A BibTeX entry for LaTeX users is

@Manual{R-giscoR,
  title = {{giscoR}: Download Map Data from GISCO API - Eurostat},
  doi = {10.32614/CRAN.package.giscoR},
  author = {Diego Hernangómez},
  year = {2024},
  version = {0.5.1},
  url = {https://ropengov.github.io/giscoR/},
  abstract = {Tools to download data from the GISCO (Geographic Information System of the Commission) Eurostat database <https://ec.europa.eu/eurostat/web/gisco>. Global and European map data available. This package is in no way officially related to or endorsed by Eurostat.},
}

Copyright notice

When data downloaded from this page is used in any printed or electronic publication, in addition to any other provisions applicable to the whole Eurostat website, data source will have to be acknowledged in the legend of the map and in the introductory page of the publication with the following copyright notice:

  • EN: © EuroGeographics for the administrative boundaries.
  • FR: © EuroGeographics pour les limites administratives.
  • DE: © EuroGeographics bezüglich der Verwaltungsgrenzen.

For publications in languages other than English, French or German, the translation of the copyright notice in the language of the publication shall be used.

If you intend to use the data commercially, please contact EuroGeographics for information regarding their licence agreements.

From GISCO Web

Disclaimer

This package is in no way officially related to or endorsed by Eurostat.

References

Lahti, Leo, Janne Huovari, Markus Kainu, and Przemysław Biecek. 2017. “Retrieval and Analysis of Eurostat Open Data with the eurostat Package.” The R Journal 9 (1): 385–92. https://doi.org/10.32614/RJ-2017-019.

giscor's People

Contributors

actions-user avatar dependabot[bot] avatar dieghernan avatar github-actions[bot] avatar imgbot[bot] avatar imgbotapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

cgodlewski

giscor's Issues

Error message for years 2010, 2013, 2016

The script below returns an error message when the year is 2010, 2013, or 2016. For the remaining years (2003, 2006, 2021), everything works fine. The error is:

HTTP Status Code: 503 - Service Unavailable

url 
  https://gisco-services.ec.europa.eu/distribution/v2/nuts/geojson/NUTS_RG_01M_2016_4326_LEVL_0.geojson  not reachable.

Please download manually.  If you think this is a bug please consider opening an issue on  https://github.com/ropengov/giscoR/issues
Returning `NULL`

The script is:

  nuts0.sf <- gisco_get_nuts(
    year = 2010,
    epsg = "4326",
    cache = TRUE,
    update_cache = FALSE,
    cache_dir = NULL,
    verbose = FALSE,
    resolution = "01",
    spatialtype = "RG",
    country = NULL,
    nuts_id = NULL,
    nuts_level = "0"
  )

Release giscoR 0.3.4

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • git push

Release giscoR 0.4.2

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • urlchecker::url_check()
  • devtools::build_readme()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version(push = TRUE)

Release giscoR 0.2.4

Prepare for release:

  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • Review pkgdown reference index for, e.g., missing topics
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

Release giscoR 0.3.0

Prepare for release:

  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • Review pkgdown reference index for, e.g., missing topics
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

Release giscoR 0.3.5

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • urlchecker::url_check()
  • devtools::build_readme()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version(push = TRUE)

Unable to download single country data if spatialtype is specified

Entire dataset downloads if any spatialtype is specified.
E.g.,

khm01 <- gisco_get_countries(resolution = "01", country = "KHM", spatialtype = "INLAND", cache_dir = "downloads/gisco")
plot(st_geometry(khm01))

R version 4.3.2 (2023-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.3 LTS
giscoR_0.4.0

Release giscoR 0.5.0

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • urlchecker::url_check()
  • devtools::build_readme()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • Finish & publish blog post
  • Add link to blog post in pkgdown news menu
  • usethis::use_github_release()
  • usethis::use_dev_version(push = TRUE)
  • Tweet

`countrycode` reverse dependency break

Hi,

I maintain the countrycode package and it looks like the upcoming version will cause a break in your package. The issue seems minor, related only to a reference in the documentation:

Changes to worse in reverse depends:

Package: giscoR
Check: Rd cross-references
New result: WARNING
  Missing link or links in Rd file 'gisco_countrycode.Rd':
    ‘[countrycode:countrycode-package]{countrycode::countrycode-package}’
  
  See section 'Cross-references' in the 'Writing R Extensions' manual.

Sorry for the trouble!

Release giscoR 0.3.1

Prepare for release:

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()

States/provinces for other countries

First of all, thank you so much for the package.

If I want to create a map of Nigeria, I only see the map (as in the outline) without the states nor state borders.

Imagining I want to compare the states of Nigeria, is it possible with your package?

Thank you.

gisco_get_nuts does not consider country argument when nuts_level = "0" AND spatialtype = "BN"

When I try to run this code:

country_lines <- gisco_get_nuts(
  year = "2016",
  epsg = "3035",
  resolution = "20",
  nuts_level = "0",
  spatialtype = "BN",
  country = c("Czechia", "Germany", "Lithuania", "Estonia", "Italy", "Spain")
)

I get this map

ggplot(country_lines) + geom_sf()

image

However, if I use another spatialtype other than "BN", I get the correct countries (same applies to spatialtype = "LB":

country_lines <- gisco_get_nuts(
  year = "2016",
  epsg = "3035",
  resolution = "20",
  nuts_level = "0",
  spatialtype = "RG",
  country = c("Czechia", "Germany", "Lithuania", "Estonia", "Italy", "Spain")
)
ggplot(country_lines) + geom_sf()

image

pkgcheck results - main

Checks for giscoR (v0.3.5.9000)

git hash: 282078e0

  • ✔️ Package is already on CRAN.
  • ✔️ has a 'codemeta.json' file.
  • ✖️ does not have a 'contributing' file.
  • ✔️ uses 'roxygen2'.
  • ✔️ 'DESCRIPTION' has a URL field.
  • ✔️ 'DESCRIPTION' has a BugReports field.
  • ✔️ Package has at least one HTML vignette
  • ✔️ All functions have examples.
  • ✔️ Package has continuous integration checks.
  • ✔️ Package coverage is 97.5%.
  • ✖️ Package contains unexpected files.
  • ✔️ R CMD check found no errors.
  • ✔️ R CMD check found no warnings.

Important: All failing checks above must be addressed prior to proceeding

Package License: GPL-3


1. Package Dependencies

Details of Package Dependency Usage (click to open)

The table below tallies all function calls to all packages ('ncalls'), both internal (r-base + recommended, along with the package itself), and external (imported and suggested packages). 'NA' values indicate packages to which no identified calls to R functions could be found. Note that these results are generated by an automated code-tagging system which may not be entirely accurate.

type package ncalls
internal base 160
internal giscoR 42
internal tools 3
internal graphics 1
internal stats 1
imports sf 10
imports utils 6
imports rappdirs 3
imports countrycode 1
imports geojsonsf NA
suggests eurostat NA
suggests ggplot2 NA
suggests knitr NA
suggests lwgeom NA
suggests rmarkdown NA
suggests testthat NA
linking_to NA NA

Click below for tallies of functions used in each package. Locations of each call within this package may be generated locally by running 's <- pkgstats::pkgstats(<path/to/repo>)', and examining the 'external_calls' table.

base

basename (19), file.path (12), url (12), paste0 (10), c (9), names (9), paste (9), try (9), q (7), grep (6), strsplit (5), unlist (5), length (4), list (4), getOption (3), gsub (3), suppressWarnings (3), file.exists (2), file.size (2), for (2), is.na (2), local (2), seq_len (2), which (2), as.character (1), as.data.frame (1), as.integer (1), eval (1), file (1), max (1), nchar (1), parse (1), rbind (1), readLines (1), switch (1), Sys.getenv (1), tempfile (1), tolower (1), tryCatch (1), vapply (1), warning (1)

giscoR

gsc_api_cache (11), gsc_api_url (8), gsc_helper_detect_cache_dir (3), gisco_clear_cache (2), gsc_api_load (2), gsc_load_shp (2), gisco_attributions (1), gisco_bulk_download (1), gisco_check_access (1), gisco_detect_cache_dir (1), gisco_get_airports (1), gisco_get_coastallines (1), gisco_get_communes (1), gisco_get_countries (1), gisco_get_grid (1), gisco_set_cache_dir (1), gsc_helper_cachedir (1), gsc_units_df (1), gsc_units_sf (1), set_utf8 (1)

sf

st_read (7), st_crs (1), st_drop_geometry (1), st_geometry (1)

utils

unzip (4), menu (1), read.csv2 (1)

rappdirs

user_config_dir (3)

tools

file_path_sans_ext (3)

countrycode

countryname (1)

graphics

text (1)

stats

df (1)

NOTE: Some imported packages appear to have no associated function calls; please ensure with author that these 'Imports' are listed appropriately.


2. Statistical Properties

This package features some noteworthy statistical properties which may need to be clarified by a handling editor prior to progressing.

Details of statistical properties (click to open)

The package has:

  • code in R (100% in 19 files) and
  • 1 authors
  • 2 vignettes
  • 6 internal data files
  • 5 imported packages
  • 19 exported functions (median 34 lines of code)
  • 47 non-exported functions in R (median 42 lines of code)

Statistical properties of package structure as distributional percentiles in relation to all current CRAN packages
The following terminology is used:

  • loc = "Lines of Code"
  • fn = "function"
  • exp/not_exp = exported / not exported

All parameters are explained as tooltips in the locally-rendered HTML version of this report generated by the checks_to_markdown() function

The final measure (fn_call_network_size) is the total number of calls between functions (in R), or more abstract relationships between code objects in other languages. Values are flagged as "noteworthy" when they lie in the upper or lower 5th percentile.

measure value percentile noteworthy
files_R 19 79.7
files_vignettes 2 85.7
files_tests 16 94.9
loc_R 1445 77.2
loc_vignettes 268 60.0
loc_tests 891 85.2
num_vignettes 2 89.2
data_size_total 700244 93.6
data_size_median 96938 91.2
n_fns_r 66 65.1
n_fns_r_exported 19 65.9
n_fns_r_not_exported 47 65.9
n_fns_per_file_r 2 34.5
num_params_per_fn 5 69.6
loc_per_fn_r 38 83.4
loc_per_fn_r_exp 34 67.5
loc_per_fn_r_not_exp 42 87.1
rel_whitespace_R 25 83.5
rel_whitespace_vignettes 25 49.2
rel_whitespace_tests 21 83.6
doclines_per_fn_exp 79 84.1
doclines_per_fn_not_exp 0 0.0 TRUE
fn_call_network_size 113 81.2

2a. Network visualisation

An interactive visualisation of calls between objects in the package has been uploaded as a workflow artefact. To view it, click on results from the latest 'pkgcheck' action, scroll to the bottom, and click on the 'visual-network' artefact.


3. goodpractice and other checks

Details of goodpractice checks (click to open)

3a. Continuous Integration Badges

R-CMD-check

GitHub Workflow Results

id name conclusion sha run_number date
5743538592 CITATION-cff success 8850e9 157 2023-08-02
5743386423 Clear GHA caches manually success d2be5d 11 2023-08-02
5737580803 CRAN Status Monitor success 2d820f 72 2023-08-02
5743538597 lintr success 8850e9 6 2023-08-02
5743636202 pages build and deployment success 8961a9 74 2023-08-02
5745121640 pkgcheck NA 282078 1 2023-08-03
5743538586 R-CMD-check success 8850e9 720 2023-08-02
5743538590 rogtemplate-gh-pages success 8850e9 131 2023-08-02
5743538596 test-coverage success 8850e9 623 2023-08-02
5743543219 update-docs success 8850e9 187 2023-08-02

3b. goodpractice results

R CMD check with rcmdcheck

R CMD check generated the following note:

  1. checking data for non-ASCII characters ... NOTE
    Note: found 1178 marked UTF-8 strings

R CMD check generated the following check_fail:

  1. rcmdcheck_non_ascii_characters_in_data

Test coverage with covr

Package coverage: 97.46

Cyclocomplexity with cyclocomp

The following functions have cyclocomplexity >= 15:

function cyclocomplexity
gisco_get_lau 26
gsc_api_url 22
gsc_helper_detect_cache_dir 21
gisco_get_nuts 19
gisco_get_countries 18
gisco_get_units 16
gsc_units_sf 15

Static code analyses with lintr

lintr found the following 16 potential issues:

message number of times
Avoid library() and require() calls in packages 6
Lines should not be more than 80 characters. 10


4. Other Checks

Details of other checks (click to open)

✖️ Package contains the following unexpected files:

  • data-raw/PORT_2009_SH/shape/metadata/XML/Thumbs.db
  • data-raw/PORT_2013_SH/Metadata/Thumbs.db


Package Versions

package version
pkgstats 0.1.3.4
pkgcheck 0.1.2.1

Some geojson are not reachable

It seems that some geojson are not reachables, but it can be opened in a browser.

provs <- gisco_get_nuts(
  country= "Spain",
  epsg = "4326",
  resolution = '03',
  nuts_level= "3"
)

url 
  https://gisco-services.ec.europa.eu/distribution/v2/nuts/geojson/NUTS_RG_03M_2016_4326_LEVL_3.geojson  not reachable.

Please download manually.  If you think this is a bug please consider opening an issue on  https://github.com/ropengov/giscoR/issues
Returning `NULL`

Better error message for temporary network / server problems

GISCO services were unavailable earlier today. Running in v4-dev branch of eurostat package, I got the following message:

> sf <- get_eurostat_geospatial(
+ output_class = "sf",
+ year = 2006,
+  resolution = "60",
+  nuts_level = 0
+  )
Extracting data using giscoR package, please report issues on https://github.com/rOpenGov/giscoR/issues

url 
  https://gisco-services.ec.europa.eu/distribution/v2/nuts/geojson/NUTS_RG_60M_2006_4326_LEVL_0.geojson  not reachable.

Please download manually.  If you think this is a bug please consider opening an issue on  https://github.com/ropengov/giscoR/issues
Returning `NULL`

Of course it was probably different for users running on last CRAN release but I didn't test that. I just figured that we could be pre-emptive about such issues in the future and have a more descriptive message in case things go wrong because of server issues, in addition to "Please download manually" or "If you think this is a bug [...]", indicating the possibility of a problem being in the server.

The error message from disco-services.ec.europa.eu was 502 Bad gateway. Mozilla docs had a nice description of that (bold mine):

"A Gateway might refer to different things in networking and a 502 error is usually not something you can fix, but requires a fix by the web server or the proxies you are trying to get access through."

See also rOpenGov/eurostat#266

Release giscoR 0.3.3

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • git push

gisco_get_nuts(nuts_level = 1) can't no more resolve at resolutions "01" and "03"

> gisco_get_nuts(nuts_level = 1, resolution = "03")
HTTP Status Code: 503 - Service Unavailable

url 
  https://gisco-services.ec.europa.eu/distribution/v2/nuts/geojson/NUTS_RG_03M_2016_4326_LEVL_1.geojson  not reachable.

Please download manually.  If you think this is a bug please consider opening an issue on  https://github.com/ropengov/giscoR/issues
Returning `NULL`
NULL

It works with resolution "10", "20" and "60".

Last week, everything were fine

> sessionInfo()
R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22631)

Matrix products: default


locale:
[1] LC_COLLATE=French_France.utf8  LC_CTYPE=French_France.utf8    LC_MONETARY=French_France.utf8 LC_NUMERIC=C                  
[5] LC_TIME=French_France.utf8    

time zone: Europe/Paris
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] sf_1.0-15       giscoR_0.5.0    scales_1.3.0    lubridate_1.9.2 forcats_1.0.0   stringr_1.5.1   dplyr_1.1.3     purrr_1.0.2    
 [9] readr_2.1.4     tidyr_1.3.0     tibble_3.2.1    ggplot2_3.4.3   tidyverse_2.0.0

loaded via a namespace (and not attached):
 [1] s2_1.1.6           rappdirs_0.3.3     utf8_1.2.3         generics_0.1.3     class_7.3-22       KernSmooth_2.23-21 stringi_1.8.3     
 [8] hms_1.1.3          magrittr_2.0.3     countrycode_1.6.0  grid_4.3.1         timechange_0.2.0   e1071_1.7-13       DBI_1.1.3         
[15] fansi_1.0.4        httr2_1.0.0        cli_3.6.1          rlang_1.1.1        units_0.8-5        munsell_0.5.0      withr_2.5.2       
[22] tools_4.3.1        tzdb_0.4.0         colorspace_2.1-0   geojsonsf_2.0.3    curl_5.2.0         vctrs_0.6.3        R6_2.5.1          
[29] proxy_0.4-27       lifecycle_1.0.4    classInt_0.4-10    pkgconfig_2.0.3    pillar_1.9.0       gtable_0.3.4       glue_1.6.2        
[36] Rcpp_1.0.11        xfun_0.42          tidyselect_1.2.0   rstudioapi_0.15.0  knitr_1.45         farver_2.1.1       labeling_0.4.3    
[43] wk_0.9.1           compiler_4.3.1

Release giscoR 0.5.1

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • urlchecker::url_check()
  • devtools::build_readme()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version(push = TRUE)

Release giscoR 0.4.1

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • urlchecker::url_check()
  • devtools::build_readme()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version(push = TRUE)

Release giscoR 0.4.0

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • urlchecker::url_check()
  • devtools::build_readme()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • Finish & publish blog post
  • Add link to blog post in pkgdown news menu
  • usethis::use_github_release()
  • usethis::use_dev_version(push = TRUE)
  • Tweet

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.