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

get_wdpa(isocode = "USA") does not work #4

Open
jkumagai96 opened this issue Feb 11, 2021 · 5 comments
Open

get_wdpa(isocode = "USA") does not work #4

jkumagai96 opened this issue Feb 11, 2021 · 5 comments

Comments

@jkumagai96
Copy link

I am trying to download the protected areas of the United States of America. The ISO-3 code is USA.
This line of code test <- get_wdpa(isocode = "USA") produces this error:
Error: lexical error: invalid char in json text.
<!--[if lt IE 7
(right here) ------^

@ahasverus
Copy link
Member

Hi Joy!
Thanks for using my package (and testing it ;)!
I tried to download PA of the USA and I had the same error as you.
The Protected Planet changed its API (and the structure of the request response) and I need to adapt the code of the function worldpa::get_wdpa(). Maybe today, maybe tomorrow.

@ahasverus
Copy link
Member

It seems that the WDPA server was in maintenance. It's all good now. Can you please tell me if you can download PA for the USA (it can take several long minutes)? Note that I modified the package and upgraded the version to 2.0.0 (read CHANGELOG/NEWS): I recommend you to reinstall the package from GitHub.
Cheers!

@jkumagai96
Copy link
Author

Hi Nicolas!
I apologize for the delayed response. I redownloaded the package from GitHub and still encounter the same error unfortunately. Not sure if it is an error on my end as I am having trouble installing rtools since I updated R studio and R to the most recent version.

@ahasverus
Copy link
Member

Hi Joy!
Did you try to download PA for another country?
For instance, worldpa::get_wdpa(isocode = "GEO") works for me.
Try this line (it will take a few seconds). If it does not work your system (R, Rtool and spatial libraries) needs to be reinstalled. You can take a look at these pages:
https://github.com/r-spatial/sf#windows
https://cran.r-project.org/bin/windows/Rtools/

@ahasverus
Copy link
Member

I checked the code for the USA, and indeed there is an issue when downloading PA for the 2nd page (51 to 100). This a problem with the server (error 524).
I wrote to the assistance.
In the mean time you could directly download shapefile from the Protected Areas website.

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

No branches or pull requests

2 participants