USEPA / elevatr

An R package for accessing elevation data
Other
202 stars 25 forks source link

Please connect to the internet and try again message. #92

Open dieza opened 1 year ago

dieza commented 1 year ago

My opentopo API is working, for instance in: https://portal.opentopography.org/API/globaldem?demtype=NASADEM&south=45.196&north=49&west=-122.66&east=-119.95&outputFormat=GTiff&API_Key=MyAPIKey I did setup it with set_opentopo_key(MyAPIKey) .Renviron show MyAPIKey However when I try to download data I get the following: "Please connect to the internet and try again." Any ideas?

jhollist commented 1 year ago

Can you provide a code example for this? Make it easier for me see if there is an issue here with elevatr.

Thanks!

On Wed, Oct 25, 2023 at 9:06 AM dieza @.***> wrote:

My opentopo API is working, for instance in:

https://portal.opentopography.org/API/globaldem?demtype=NASADEM&south=45.196&north=49&west=-122.66&east=-119.95&outputFormat=GTiff&API_Key=MyAPIKey I did setup it with set_opentopo_key(MyAPIKey) .Renviron show MyAPIKey However when I try to download data I get the following: "Please connect to the internet and try again." Any ideas?

— Reply to this email directly, view it on GitHub https://github.com/jhollist/elevatr/issues/92, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJPYSZIEKIU2PFCQ5RMOSDYBEFGZAVCNFSM6AAAAAA6PLJNFOVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE3DCMZYGQZTANQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Jeffrey W. Hollister email: @.*** cell: 401 556 4087 https://jwhollister.com

LPDagallier commented 10 months ago

Hello, I have the same message when I try to use get_elev_point() and get_elev_raster(). I tried with both my data and with the example provided in the documentation, and I have the "Please connect to the internet" message (although I do have connection).

jhollist commented 10 months ago

@LPDagallier There is a recent post on SO as well (https://stackoverflow.com/questions/77731978/issue-with-elevatrget-elev-raster-please-connect-to-the-internet-and-try-aga). Some good suggestions there.

In particular, what do you get with curl::has_internet()?

You can also try !is.null(curl::nslookup("www.r-project.org", error = FALSE)) directly if curl::has_internet() is unexpectedly FALSE. Some suggestion at https://stackoverflow.com/questions/5076593/how-to-determine-if-you-have-an-internet-connection-in-r that this may occur (outside of my wheelhouse here!)

LPDagallier commented 10 months ago

Thanks for the links! curl::has_internet() returns FALSE and !is.null(curl::nslookup("www.r-project.org", error = FALSE)) is TRUE. In my case, the problem probably comes from a firewall or a proxy.

I found a workaround here: https://stackoverflow.com/questions/59796178/r-curlhas-internet-false-even-though-there-are-internet-connection The idea is to change the state variable has_internet_via_proxy to TRUE in the curl::has_internet() environment with the following command: assign("has_internet_via_proxy", TRUE, environment(curl::has_internet))

jhollist commented 10 months ago

I'll add this as an enhancement next time I get a chance to work on elevatr. Will see if I can carve out some time soonish to make the change.

Thanks for helping track this down.

On Mon, Jan 8, 2024 at 2:28 PM Léo-Paul Dagallier @.***> wrote:

Thanks for the links! curl::has_internet() returns FALSE and !is.null(curl::nslookup(" www.r-project.org", error = FALSE)) is TRUE. In my case, the problem probably comes from a firewall or a proxy.

I found a workaround here: https://stackoverflow.com/questions/59796178/r-curlhas-internet-false-even-though-there-are-internet-connection The idea is to change the state variable has_internet_via_proxy to TRUE in the curl::has_internet() environment with the following command: assign("has_internet_via_proxy", TRUE, environment(curl::has_internet))

— Reply to this email directly, view it on GitHub https://github.com/jhollist/elevatr/issues/92#issuecomment-1881695474, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJPYS3TYWZTMTVW55MVFFLYNRCEJAVCNFSM6AAAAAA6PLJNFOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBRGY4TKNBXGQ . You are receiving this because you commented.Message ID: @.***>

-- Jeffrey W. Hollister email: @.*** cell: 401 556 4087 https://jwhollister.com