Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem accessing geospatial data in R "no access to ec.europe.eu." #222

Open
Fabian-HC opened this issue Jul 20, 2021 · 9 comments
Open
Assignees

Comments

@Fabian-HC
Copy link

Hi,
searching for this issue I found an issue thread (#210 from April 5th, 2021) on a similar issue in the list.
Following message presents to me:
"You have no access to ec.europe.eu.
Please check your connection and/or review your proxy settings"

Code limited example [worked fine until yesterday]:
library(eurostat)
geodata <- get_eurostat_geospatial(resolution = "60", nuts_level = "3", year = 2016).

Running R 4.1.0 in RStudio 1.4.1717
Eurostat package version 3.7.5

No proxy settings were consciously adjusted in the meantime.
Any help is greatly appreciated!
Fabian

@antagomir
Copy link
Member

Just wondering if this could be a temporary issue on the server side?

@Fabian-HC
Copy link
Author

Would be nice, I will try again every now and then [still no sever connection as of now]. seems like similar issues beyond the linked post came up earlier, and cleared a few days later, too.
My layman initial response was about the URL in reading "...no access to ec.europe.eu" which seems not to exist; shouldn't it be ec.europa.eu?

@Fabian-HC
Copy link
Author

...that at some gateway an auto-correct placed a europe.eu instead of the europa.eu domain, too

@guaribr
Copy link

guaribr commented Jul 21, 2021

I also have the same issue: "You have no access to ec.europe.eu." message when trying

get_eurostat_geospatial(output_class = "df", 
                             resolution = 20, 
                             nuts_level = 0, 
                             year = 2016,
                             crs = "4326")

Using R 4.1.0 | RStudio 1.4.1717 | Eurostat 3.7.5

@pitkant
Copy link
Member

pitkant commented Jul 21, 2021

Alright, here are some findings. I tried examples provided by both @Fabian-HC and @guaribr on R 4.1.0 / RStudio 1.4.1103 (2021-01-06) / Eurostat 3.7.5 / macOS Big Sur 10.16 and the examples did not work.

At first I suspected that the URL is outdated as the package uses
"http://ec.europa.eu/eurostat/cache/GISCO/distribution/v2/nuts/geojson/NUTS_RG_60M_2006_4326_LEVL_0.geojson"

but that is probably redirected to
https://gisco-services.ec.europa.eu/distribution/v2/nuts/geojson/NUTS_RG_60M_2006_4326_LEVL_0.geojson

This was however not the cause for the timeout error as the examples worked fine when I tried under Windows (R 4.1.0 / RStudio 1.2.5042 (2020-04-01) / Eurostat 3.7.5 / Windows 10 x64 (build 14393)). (Yes, you may notice that RStudio is quite outdated here but I'll have to ask helpdesk to update it. Anyway it wasn't an error source here)

check_access_to_data() uses
curl::curl_download(http_url, temp, quiet = TRUE, )
for .Platform$OS.type == "unix"

whereas it uses utils::download.file(http_url, temp, quiet= TRUE) for Windows. Using utils::download.file actually worked under macOS as well so I'm wondering if the problem is with curl_download or its function parameters. According to curl manual "Default behavior [of curl_download] is identical to download.file, but request can be fully configured by passing a custom handle"

I think using curl package and its functions is nowadays the preferred method of downloading data and Windows method of using base R download.file was meant to be a workaround. Maybe function author @muuankarski can enlighten us in this regard.

A simple fix here would be to use download.file on all operating systems to pass the check_access_to_data check and proceed with get_eurostat_geospatial function.

@pitkant
Copy link
Member

pitkant commented Jul 21, 2021

After one hour, without doing any fixes or changing any settings, the above mentioned examples started working for me using curl_download on macOS. Curious.

@dieghernan
Copy link
Member

dieghernan commented Sep 29, 2021

Hi! I face the same issue on giscoR from time to time (this package is dedicated specifically to gisco, the same source of geospatial data than {eurostat}).

After spending a lot of time on this, my conclusion is that GISCO fails on the server side randomly, so not much to do on the package side. The only workaround i can think of is to set a permanent cache (#228) and rely on that.

@cwdjankoski
Copy link

I had the same issue / hiccup with the servers and it went back online within 20mins.
Maybe an idea would be to include an informative message in eurostat::check_access_to_data() in case acessing the url fails - that it might be due to server issues promptly resolved.

@pitkant
Copy link
Member

pitkant commented Aug 17, 2023

Downloading geospatial data and potential error messages will be handled through giscoR package when v4 with PR #264 is released. I added the documentation label as a note-to-self to check if this is clarified clearly enough in function documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants