rOpenGov / giscoR

Download geospatial data from GISCO API - Eurostat
https://ropengov.github.io/giscoR/
GNU General Public License v3.0
71 stars 1 forks source link

Error message for years 2010, 2013, 2016 #88

Closed swimmer008 closed 2 months ago

swimmer008 commented 2 months ago

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"
  )
dieghernan commented 2 months ago

I don't see a problem, can you please try again? Maybe it was a temporary issue on the server side (we saw many of this in the past, see https://github.com/rOpenGov/giscoR/issues?q=label%3Anot-downloading):

library(giscoR)

nuts0.sf_2010 <- gisco_get_nuts(
  year = 2010,
  epsg = "4326",
  cache = TRUE,
  update_cache = TRUE,
  cache_dir = tempdir(), # For the reprex to avoid caching
  verbose = TRUE,
  resolution = "01",
  spatialtype = "RG",
  country = NULL,
  nuts_id = NULL,
  nuts_level = "0"
)
#> 
#> Cache dir is  C:\Users\xxxxxx\AppData\Local\Temp\RtmpoXmnZj
#> Downloading from  https://gisco-services.ec.europa.eu/distribution/v2/nuts/geojson/NUTS_RG_01M_2010_4326_LEVL_0.geojson
#> Retry query
#> Download succesful on 
#> 
#>  C:\Users\xxxxxx\AppData\Local\Temp\RtmpoXmnZj/NUTS_RG_01M_2010_4326_LEVL_0.geojson
#> Reading from local file  C:\Users\xxxxxx\AppData\Local\Temp\RtmpoXmnZj/NUTS_RG_01M_2010_4326_LEVL_0.geojson
#> 9.8 Mb
#> File loaded 
#>  Encoding characters

head(nuts0.sf_2010)
#> Simple feature collection with 6 features and 7 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: 2.546011 ymin: 34.56271 xmax: 34.58717 ymax: 51.50516
#> Geodetic CRS:  WGS 84
#>   FID               NAME_LATN CNTR_CODE
#> 1  AT              Österreich        AT
#> 2  BE         Belgique-België        BE
#> 3  BG               Balgarija        BG
#> 4  CH Schweiz/Suisse/Svizzera        CH
#> 5  CY                  Kýpros        CY
#> 6  CZ         Ceská republika        CZ
#>                                                          NUTS_NAME LEVL_CODE
#> 1                                                       Österreich         0
#> 2                                                  Belgique-België         0
#> 3 <U+0411><U+044A><U+043B><U+0433><U+0430><U+0440><U+0438><U+044F>         0
#> 4                                          Schweiz/Suisse/Svizzera         0
#> 5                        <U+039A><U+03CD>p<U+03C1><U+03BF><U+03C2>         0
#> 6                                                  Ceská republika         0
#>   NUTS_ID geo                       geometry
#> 1      AT  AT MULTIPOLYGON (((10.45723 47...
#> 2      BE  BE MULTIPOLYGON (((5.104323 51...
#> 3      BG  BG MULTIPOLYGON (((22.67516 44...
#> 4      CH  CH MULTIPOLYGON (((8.601358 47...
#> 5      CY  CY MULTIPOLYGON (((34.57313 35...
#> 6      CZ  CZ MULTIPOLYGON (((14.49423 51...

nuts0.sf_2013 <- gisco_get_nuts(
  year = 2013,
  epsg = "4326",
  cache = TRUE,
  update_cache = TRUE,
  cache_dir = tempdir(), # For the reprex to avoid caching
  verbose = TRUE,
  resolution = "01",
  spatialtype = "RG",
  country = NULL,
  nuts_id = NULL,
  nuts_level = "0"
)
#> 
#> Cache dir is  C:\Users\xxxxxx\AppData\Local\Temp\RtmpoXmnZj
#> Downloading from  https://gisco-services.ec.europa.eu/distribution/v2/nuts/geojson/NUTS_RG_01M_2013_4326_LEVL_0.geojson
#> Download succesful on 
#> 
#>  C:\Users\xxxxxx\AppData\Local\Temp\RtmpoXmnZj/NUTS_RG_01M_2013_4326_LEVL_0.geojson
#> Reading from local file  C:\Users\xxxxxx\AppData\Local\Temp\RtmpoXmnZj/NUTS_RG_01M_2013_4326_LEVL_0.geojson
#> 3.9 Mb
#> File loaded 
#>  Encoding characters

head(nuts0.sf_2013)
#> Simple feature collection with 6 features and 7 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: 2.546011 ymin: 34.5634 xmax: 34.58835 ymax: 51.50405
#> Geodetic CRS:  WGS 84
#>   FID               NAME_LATN CNTR_CODE
#> 1  AT              ÖSTERREICH        AT
#> 2  BE         BELGIQUE-BELGIË        BE
#> 3  BG                BULGARIA        BG
#> 4  CY                  KÝPROS        CY
#> 5  CZ         CESKÁ REPUBLIKA        CZ
#> 6  CH SCHWEIZ/SUISSE/SVIZZERA        CH
#>                                                          NUTS_NAME NUTS_ID
#> 1                                                       ÖSTERREICH      AT
#> 2                                                  BELGIQUE-BELGIË      BE
#> 3 <U+0411><U+042A><U+041B><U+0413><U+0410><U+0420><U+0418><U+042F>      BG
#> 4                        <U+039A><U+03A5><U+03A0><U+03A1><U+039F>S      CY
#> 5                                                  CESKÁ REPUBLIKA      CZ
#> 6                                          SCHWEIZ/SUISSE/SVIZZERA      CH
#>   LEVL_CODE geo                       geometry
#> 1         0  AT MULTIPOLYGON (((15.51186 48...
#> 2         0  BE MULTIPOLYGON (((5.104323 51...
#> 3         0  BG MULTIPOLYGON (((22.92548 44...
#> 4         0  CY MULTIPOLYGON (((34.58835 35...
#> 5         0  CZ MULTIPOLYGON (((14.49423 51...
#> 6         0  CH MULTIPOLYGON (((8.601358 47...

nuts0.sf_2016 <- gisco_get_nuts(
  year = 2016,
  epsg = "4326",
  cache = TRUE,
  update_cache = TRUE,
  cache_dir = tempdir(), # For the reprex to avoid caching
  verbose = TRUE,
  resolution = "01",
  spatialtype = "RG",
  country = NULL,
  nuts_id = NULL,
  nuts_level = "0"
)
#> 
#> Cache dir is  C:\Users\xxxxxx\AppData\Local\Temp\RtmpoXmnZj
#> Downloading from  https://gisco-services.ec.europa.eu/distribution/v2/nuts/geojson/NUTS_RG_01M_2016_4326_LEVL_0.geojson
#> Download succesful on 
#> 
#>  C:\Users\xxxxxx\AppData\Local\Temp\RtmpoXmnZj/NUTS_RG_01M_2016_4326_LEVL_0.geojson
#> Reading from local file  C:\Users\xxxxxx\AppData\Local\Temp\RtmpoXmnZj/NUTS_RG_01M_2016_4326_LEVL_0.geojson
#> 6.3 Mb
#> File loaded 
#>  Encoding characters

head(nuts0.sf_2016)
#> Simple feature collection with 6 features and 10 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: 5.867697 ymin: 34.56369 xmax: 34.60609 ymax: 57.75166
#> Geodetic CRS:  WGS 84
#>   MOUNT_TYPE       NAME_LATN CNTR_CODE
#> 1          0       SHQIPËRIA        AL
#> 2          0 CESKÁ REPUBLIKA        CZ
#> 3          0     DEUTSCHLAND        DE
#> 4          0         DANMARK        DK
#> 5          0          KYPROS        CY
#> 6          0      ÖSTERREICH        AT
#>                                   NUTS_NAME LEVL_CODE NUTS_ID URBN_TYPE
#> 1                                 SHQIPËRIA         0      AL         0
#> 2                           CESKÁ REPUBLIKA         0      CZ         0
#> 3                               DEUTSCHLAND         0      DE         0
#> 4                                   DANMARK         0      DK         0
#> 5 <U+039A><U+03A5><U+03A0><U+03A1><U+039F>S         0      CY         0
#> 6                                ÖSTERREICH         0      AT         0
#>   COAST_TYPE FID geo                       geometry
#> 1          0  AL  AL MULTIPOLYGON (((19.80816 42...
#> 2          0  CZ  CZ MULTIPOLYGON (((14.49396 51...
#> 3          0  DE  DE MULTIPOLYGON (((10.4732 47....
#> 4          0  DK  DK MULTIPOLYGON (((15.1913 55....
#> 5          0  CY  CY MULTIPOLYGON (((34.60297 35...
#> 6          0  AT  AT MULTIPOLYGON (((10.43954 47...

Created on 2024-06-19 with reprex v2.1.0

Session info ``` r sessioninfo::session_info() #> - Session info --------------------------------------------------------------- #> setting value #> version R version 4.1.0 (2021-05-18) #> os Windows 10 x64 (build 19045) #> system x86_64, mingw32 #> ui RTerm #> language (EN) #> collate Spanish_Spain.1252 #> ctype Spanish_Spain.1252 #> tz Europe/Paris #> date 2024-06-19 #> pandoc 2.12 @ C:/APS/Anaconda/Scripts/ (via rmarkdown) #> #> - Packages ------------------------------------------------------------------- #> ! package * version date (UTC) lib source #> backports 1.2.1 2020-12-09 [2] CRAN (R 4.1.0) #> D class 7.3-19 2021-05-03 [2] CRAN (R 4.1.0) #> classInt 0.4-7 2022-06-10 [1] CRAN (R 4.1.3) #> cli 3.6.2 2023-12-11 [1] RSPM (R 4.1.0) #> DBI 1.2.1 2024-01-12 [1] RSPM (R 4.1.0) #> digest 0.6.34 2024-01-11 [1] RSPM (R 4.1.0) #> dplyr 1.1.4 2023-11-17 [1] RSPM (R 4.1.0) #> e1071 1.7-7 2021-05-23 [2] CRAN (R 4.1.0) #> evaluate 0.23 2023-11-01 [1] RSPM (R 4.1.0) #> fansi 1.0.5 2023-10-08 [1] CRAN (R 4.1.1) #> fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.1.1) #> fs 1.6.3 2023-07-20 [1] CRAN (R 4.1.1) #> generics 0.1.0 2020-10-31 [2] CRAN (R 4.1.0) #> geojsonsf 2.0.1 2020-10-02 [2] CRAN (R 4.1.0) #> giscoR * 0.5.0 2024-05-29 [1] CRAN (R 4.1.0) #> glue 1.7.0 2024-01-09 [1] RSPM (R 4.1.0) #> htmltools 0.5.8.1 2024-04-04 [1] CRAN (R 4.1.0) #> D KernSmooth 2.23-20 2021-05-03 [2] CRAN (R 4.1.0) #> knitr 1.45 2023-10-30 [1] RSPM (R 4.1.0) #> lifecycle 1.0.4 2023-11-07 [1] RSPM (R 4.1.0) #> magrittr 2.0.3 2022-03-30 [1] RSPM (R 4.1.0) #> pillar 1.9.0 2023-03-22 [1] RSPM (R 4.1.0) #> pkgconfig 2.0.3 2019-09-22 [2] CRAN (R 4.1.0) #> proxy 0.4-26 2021-06-07 [2] CRAN (R 4.1.0) #> purrr 1.0.2 2023-08-10 [1] RSPM (R 4.1.0) #> R6 2.5.1 2021-08-19 [1] CRAN (R 4.1.3) #> Rcpp 1.0.12 2024-01-09 [1] RSPM (R 4.1.0) #> reprex 2.1.0 2024-01-11 [1] RSPM (R 4.1.0) #> rlang 1.1.3 2024-01-10 [1] RSPM (R 4.1.0) #> rmarkdown 2.25 2023-09-18 [1] RSPM (R 4.1.0) #> rstudioapi 0.15.0 2023-07-07 [1] RSPM (R 4.1.0) #> s2 1.0.6 2021-06-17 [2] CRAN (R 4.1.0) #> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.1.3) #> sf 1.0-1 2021-06-29 [2] CRAN (R 4.1.0) #> styler 1.4.1 2021-03-30 [2] CRAN (R 4.1.0) #> tibble 3.2.1 2023-03-20 [1] RSPM (R 4.1.0) #> tidyselect 1.2.0 2022-10-10 [1] RSPM (R 4.1.0) #> units 0.7-2 2021-06-08 [2] CRAN (R 4.1.0) #> utf8 1.2.2 2021-07-24 [1] CRAN (R 4.1.3) #> vctrs 0.6.5 2023-12-01 [1] RSPM (R 4.1.0) #> withr 3.0.0 2024-01-16 [1] RSPM (R 4.1.0) #> wk 0.4.1 2021-03-16 [2] CRAN (R 4.1.0) #> xfun 0.42 2024-02-08 [1] RSPM (R 4.1.0) #> yaml 2.3.8 2023-12-11 [1] RSPM (R 4.1.0) #> #> [1] C:/Users/xxxxx/Documents/R/win-library/4.1 #> [2] C:/Program Files/R/R-language/library #> #> D -- DLL MD5 mismatch, broken installation. #> #> ------------------------------------------------------------------------------ ```
swimmer008 commented 2 months ago

Thank you, it has been temporary indeed. I am sorry I have not seen the previous posts about the problem. Thanks again for your quick response!