prioritizr / wdpar

Interface to the World Database on Protected Areas
https://prioritizr.github.io/wdpar
GNU General Public License v3.0
39 stars 5 forks source link

wdpa_fetch() no longer works #63

Closed jeffreyhanson closed 2 years ago

jeffreyhanson commented 2 years ago

The PhantomJS web driver is no longer supported by the RSelenium package, and so this function no longers works. I need to find another package to replace the Rselenium dependency.

fBedecarrats commented 2 years ago

Hi, I see that this has already been identified by @Jo-Schie, but I'm affraid that the solution doesn't work on linux:

remotes::install_github("prioritizr/wdpar", quiet = TRUE, force = TRUE,
                        upgrade = "always")
library(dplyr)
library(wdpar)

# Downloading Protected areas from Madagascar
PA_mada <- wdpa_fetch("Madagascar", wait = TRUE,
                      download_dir = "data_s3/WDPA") %>%
  filter(STATUS != "Proposed") %>%
  filter(DESIG != "Locally Managed Marine Area", DESIG != "Marine Park") 

Which returns the following error: Screenshot from 2022-10-14 11-37-12

It is running on Ubuntu 20.04, with R 4.2.1

jeffreyhanson commented 2 years ago

Thank you very much for reaching out @fBedecarrats! Hmm, the webdriver::run_phantomjs() function requires the installation of the PhantomJS software. Could you please try running webdriver::install_phantomjs(), and then running the wdpa_fetch() code again? I had originally intended for the wdpar package to display a helpful error message telling people to install PhantomJS if it's not availalbe, but it would seem that I might not have got it working correctly.

fBedecarrats commented 2 years ago

I just tried and it worked indeed! I agree that a message to the user would be useful to help solve this error. Thanks a lot.

jeffreyhanson commented 2 years ago

Ok excellent - thanks! Yeah, I'll update the error message.