Skip to content

Commit

Permalink
Merge pull request #404 from bjohnso005/rgdalDEV
Browse files Browse the repository at this point in the history
removed rgdal
  • Loading branch information
gepinillab authored Sep 5, 2023
2 parents a9a4f50 + 7ae5469 commit eaf34fd
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,28 @@ Imports:
DT (>= 0.5),
ecospat,
ENMeval (>= 2.0.3),
glue,
knitcitations,
leafem,
leaflet.extras (>= 1.0.0),
magrittr,
methods,
RColorBrewer,
rgdal,
rgeos,
rJava,
rlang,
rmarkdown,
sf,
shinyalert,
shinyjs,
shinyWidgets (>= 0.6.0),
spocc (>= 1.2.0),
spThin,
tools,
zip
Suggests:
ade4,
BIEN,
dismo,
glue,
jsonlite,
knitr,
mapview,
Expand All @@ -69,10 +69,10 @@ Suggests:
rangeModelMetadata,
raster,
rgbif (>= 3.3.0),
rJava,
sp,
terra,
testthat
testthat,
tools
License: GPL-3
URL: http://wallaceecomod.github.io/wallace/,
Encoding: UTF-8
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
wallace 2.0.6
=============
- Removed `paleobioDB` (package off CRAN)
- Removed `rgdal` (package expiring)
- Changed Maintainer e-mail

wallace 2.0.5
Expand Down
3 changes: 2 additions & 1 deletion R/penvs_userBgExtent.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ penvs_userBgExtent <- function(bgShp_path, bgShp_name, userBgBuf, occs,
file.rename(bgShp_path, file.path(pathdir, bgShp_name))
}
# read in shapefile and extract coords
bgExt <- rgdal::readOGR(file.path(pathdir, bgShp_name)[i])
bgExt <- sf::st_read(file.path(pathdir, bgShp_name)[i])
bgExt <- sf::as_Spatial(bgExt)
} else {
logger %>%
writeLog(type = 'error',
Expand Down
4 changes: 3 additions & 1 deletion R/xfer_userExtent.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ xfer_userExtent <- function(bgShp_path, bgShp_name, userBgBuf,
file.rename(bgShp_path, file.path(pathdir, bgShp_name))
}
# read in shapefile and extract coords
bgExt <- rgdal::readOGR(file.path(pathdir, bgShp_name)[i])
bgExt <- sf::st_read(file.path(pathdir, bgShp_name)[i])
bgExt <- sf::as_Spatial(bgExt)

} else {
logger %>%
writeLog(type = 'error',
Expand Down
20 changes: 10 additions & 10 deletions inst/shiny/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,11 @@ function(input, output, session) {
on.exit(setwd(owd))
n <- curSp()

rgdal::writeOGR(obj = bgExt(),
sf::st_write(obj = sf::st_as_sf(bgExt()),
dsn = tmpdir,
layer = paste0(n, '_bgShp'),
driver = "ESRI Shapefile",
overwrite_layer = TRUE)
append = FALSE)

exts <- c('dbf', 'shp', 'shx')
fs <- paste0(n, '_bgShp.', exts)
Expand Down Expand Up @@ -771,7 +771,7 @@ function(input, output, session) {
tmpdir <- tempdir()
owd <- setwd(tmpdir)
on.exit(setwd(owd))
if(require(rgdal)) {
if(require(sf)) {
if (input$predFileType == 'png') {
req(mapPred())
if (!webshot::is_phantomjs_installed()) {
Expand Down Expand Up @@ -842,7 +842,7 @@ function(input, output, session) {
}
} else {
logger %>%
writeLog("Please install the rgdal package before downloading rasters.")
writeLog("Please install the sf package before downloading rasters.")
}
}
)
Expand All @@ -866,11 +866,11 @@ function(input, output, session) {
owd <- setwd(tmpdir)
on.exit(setwd(owd))
n <- curSp()
rgdal::writeOGR(obj = spp[[curSp()]]$transfer$xfExt,
sf::st_write(obj = sf::st_as_sf(spp[[curSp()]]$transfer$xfExt),
dsn = tmpdir,
layer = paste0(n, '_xferShp'),
driver = "ESRI Shapefile",
overwrite_layer = TRUE)
append = FALSE)

exts <- c('dbf', 'shp', 'shx')
fs <- paste0(n, '_xferShp.', exts)
Expand Down Expand Up @@ -924,7 +924,7 @@ function(input, output, session) {
tmpdir <- tempdir()
owd <- setwd(tmpdir)
on.exit(setwd(owd))
if(require(rgdal)) {
if(require(sf)) {
if (input$xferFileType == 'png') {
req(mapXfer())
if (!webshot::is_phantomjs_installed()) {
Expand Down Expand Up @@ -997,7 +997,7 @@ function(input, output, session) {
file.rename(r@file@name, file)
}
} else {
logger %>% writeLog("Please install the rgdal package before downloading rasters.")
logger %>% writeLog("Please install the sf package before downloading rasters.")
}
}
)
Expand All @@ -1013,7 +1013,7 @@ function(input, output, session) {
tmpdir <- tempdir()
owd <- setwd(tmpdir)
on.exit(setwd(owd))
if(require(rgdal)) {
if(require(sf)) {
req(spp[[curSp()]]$transfer$mess, spp[[curSp()]]$transfer$xfExt)
mess <- spp[[curSp()]]$transfer$mess
if (input$messFileType == 'png') {
Expand Down Expand Up @@ -1080,7 +1080,7 @@ function(input, output, session) {
file.rename(r@file@name, file)
}
} else {
logger %>% writeLog("Please install the rgdal package before downloading rasters.")
logger %>% writeLog("Please install the sf package before downloading rasters.")
}
}
)
Expand Down

0 comments on commit eaf34fd

Please sign in to comment.