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

Some geojson are not reachable #69

Closed dominicroye closed 9 months ago

dominicroye commented 11 months ago

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`
trifick commented 10 months ago

Hi, I'm having the same issue with multiple geojson urls. e.g.

africa_map <- gisco_get_countries(
    year = "2020",
    epsg = "4326",
    resolution = "3",
    region = "Africa", cache = TRUE, #update_cache = TRUE
  )

url 
  https://gisco-services.ec.europa.eu/distribution/v2/countries/geojson/CNTR_RG_03M_2020_4326.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`
dominicroye commented 10 months ago

My solution so far would be the following:

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

option(timeout = 1000)

limit <- sf::st_read(httr::GET(url))
dieghernan commented 10 months ago

I would have a look today, in the past I saw similiar issues due to changes on GISCO API see #57

Ping @hannesaddec (GISCO)

Deleetdk commented 10 months ago

Also the case for world map. This code used to work:

> # fine line in WGS84
> world <- gisco_get_countries(resolution = "10",
+                             epsg = 4326)

url 
  https://gisco-services.ec.europa.eu/distribution/v2/countries/geojson/CNTR_RG_10M_2016_4326.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`
> world
NULL

Following @dominicroye , this seems to be the manual approach:

world = sf::st_read(httr::GET("https://gisco-services.ec.europa.eu/distribution/v2/countries/geojson/CNTR_RG_10M_2020_4326.geojson"))

dieghernan commented 10 months ago

Thanks all for reporting, this should be fixed now after #70

Can you try with the dev version?

remotes::install_github("rOpenGov/giscoR")

world  <- gisco_get_countries(resolution = "10", epsg = 4326)
hannesaddec commented 10 months ago

Looking into it.. should be fixed now

I would have a look today, in the past I saw similiar issues due to changes on GISCO API see #57

Ping @hannesaddec (GISCO)

trifick commented 10 months ago

Hi, Working for me now thanks.

dieghernan commented 10 months ago

Thanks @hannesaddec @trifick

Note that there is a new version of giscoR on CRAN implementing also the solution proposed by @dominicroye

Everything should be working now with the CRAN version

ping also @pitkant in relation with https://github.com/rOpenGov/eurostat/issues/279