Skip to content

Commit

Permalink
Merge pull request #16 from JGCRI/gdal-processing
Browse files Browse the repository at this point in the history
Deprecating use of rgdal
  • Loading branch information
kanishkan91 authored Jan 14, 2025
2 parents e7c0f6f + ec891c5 commit 7745a94
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Authors@R: c(person("Chris", "Vernon",
person("Caleb", "Braun",
email = "[email protected]",
role = "aut"),
person("Kanishka B.", "Narayan",
email = "[email protected]",
role = "aut"),
person("Pacific Northwest National Laboratory",
role = "cph"))
Description: The rgis package facilitates GIS functionality and workflows commonly reprented in propritary and open source GISs. This package does not contain functionality for visulization, but is focsed on geospatial algorithms for analysis, conversion, IO, modification, and workflows of spatial files and data structures.
Expand All @@ -25,7 +28,6 @@ Imports:
doParallel,
foreach,
magrittr,
rgdal,
smoothr,
tibble,
units,
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ importFrom(raster,projection)
importFrom(raster,raster)
importFrom(raster,res)
importFrom(raster,unique)
importFrom(rgdal,readOGR)
importFrom(sf,sf_use_s2)
importFrom(sf,st_area)
importFrom(sf,st_as_sf)
Expand Down
5 changes: 2 additions & 3 deletions R/io.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@
#'
#' @param shp_path character. A full path to the input shapefile with file name and extension
#' @param quiet boolean.
#' @param method tool used to convert to spatial data; either 'sf' or 'rgdal'
#' @param method tool used to convert to spatial data; i.e. 'sf'
#' @return sf object
#' @author Chris R. Vernon ([email protected])
#' @importFrom sf st_read
#' @importFrom rgdal readOGR
#' @export
import_shapefile <- function(shp_path, quiet = TRUE, method = "sf") {

if(method == "sf") return(st_read(shp_path, quiet = quiet))
if(method == "rgdal") return(readOGR(shp_path, verbose = !quiet))

}


Expand Down
2 changes: 1 addition & 1 deletion man/import_shapefile.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7745a94

Please sign in to comment.