Comments (10)
Hi,
Thank you very much for raising this issue and providing all these details! I'm sorry that it's not working for you. Just to check, I noticed that there was a ?
before wdpa_fetch()
. Did you encounter the error when running code that did not contain the ?
?. E.g., something like this:
# load package
library(wdpar)
# make a list of countries
countries <- c("Vietnam","Malaysia","Laos")
# loop over countries to get all shapefile data
dat <- list()
for (i in countries) {
message("starting ", i)
dat[[i]] <- wdpa_fetch(i, wait = TRUE, download_dir = getwd())
}
If you encounter the error in the first iteration of the loop, you might need to restart your computer.
Also, here's some additional details in case it helps identify what's going wrong. Normally, wdpa_fetch()
will start up a new PhantomJS process, use it to download the data, and then kill it (seperately for each country). The PhantomJS signals port = 4567 is already in use.
error indicates that a PhantomJS web driver is already running. So, if you see this on the second iteration then this would suggest that wdpar didn't kill the process correctly after the first iteration.
Also, I wouldn't expect this to make a difference, but could you please try using the latest version of R?
from wdpar.
from wdpar.
Ah ok - thanks for clarifying that! Ok - I'll create a branch in a moment to implement the random ports idea for testing. Note that this doesn't entirely fix the issue though. Since the error is caused by the R code failing to kill Selenium processes once it's finished with them, this means that running the code in a loop will result in lots of zombie processes and, in turn, mean that they could consume lots of memory. Is that ok? Basically, this means you would probably want to restart your computer after the loop has finished running.
from wdpar.
Another option could involve manually killing the Selenium processes each step in the loop (based on ropensci/RSelenium#228 (comment)). For example, something like this:
# load package
library(wdpar)
# make a list of countries
countries <- c("Vietnam","Malaysia","Laos")
# loop over countries to get all shapefile data
dat <- list()
for (i in countries) {
message("starting ", i)
dat[[i]] <- wdpa_fetch(i, wait = TRUE, download_dir = getwd())
try(system("taskkill /im java.exe /f", intern = FALSE, ignore.stdout = FALSE))
}
from wdpar.
from wdpar.
from wdpar.
Ah ok - thanks for trying that.
from wdpar.
Could you please try running the code using the wd-proc
branch? I've randomized the port and tried to make the code more robust for killing the processes. You can install it with:
remotes::install_github("prioritizr/wdpar@wd-proc")
from wdpar.
from wdpar.
Awesome! Thanks for letting me know that fixed it - I'll merge those fixes into the main branch.
from wdpar.
Related Issues (20)
- Poor internet connection breaks wdpa_fetch HOT 9
- It takes forever to eraseoverlap for global dataset. HOT 22
- wdpa_fetch HOT 6
- I used the newest version of wdpar, still have this "side location conflict" HOT 7
- The package not run for previous download data, and do not start a new download data HOT 6
- GEOS version sensitivity HOT 7
- upcoming sf breaks wdpar HOT 6
- JOSS Review: Improve documentation on geo-processing steps and its effects on the original geometries HOT 12
- JOSS Review: Improve Statement of need / description of use-cases HOT 16
- JOSS Review - Add links to references cited in README HOT 3
- JOSS Review warning about out of date local data HOT 6
- JOSS Review: Add small POC about Performance claims HOT 7
- JOSS Review: Add statement about state of the field HOT 4
- wdpa_fetch() no longer works HOT 4
- Dissolve all MPAs in each country HOT 10
- Erase overlaps keeps failing HOT 19
- Error when running wdpa_fetch() HOT 14
- package overview manual entry
- erase_overlaps problem: many areas are not erased HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wdpar.