prioritizr / wdpar

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

wdpa_fetch() no longer works #63

Closed jeffreyhanson closed 1 year ago

jeffreyhanson commented 1 year 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 1 year 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 1 year 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 1 year 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 1 year ago

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