Skip to content

Commit

Permalink
Cleaned up local notes, trying to fix actions on Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
jhollist committed Mar 24, 2023
1 parent f56d932 commit b8e1570
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/check-standard.yaml
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/latest"}
- {os: windows-latest, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/latest"}
- {os: macos-latest, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/latest"}
- {os: ubuntu-latest, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-latest, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
Expand Down Expand Up @@ -58,6 +58,17 @@ jobs:
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: "Install spatial libraries on linux"
if: runner.os == 'Linux'
run: sudo apt-get install libgdal-dev libproj-dev libgeos-dev libudunits2-dev

- name: "Install spatial libraries on macOS"
if: runner.os == 'macOS'
run: |
# conflicts with gfortran from r-lib/actions when linking gcc
rm '/usr/local/bin/gfortran'
brew install pkg-config gdal proj geos sqlite3
- name: Install dependencies on windows and mac
if: runner.os != 'Linux'
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Expand Up @@ -35,7 +35,7 @@ Imports:
License: CC0
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.2
RoxygenNote: 7.2.3
Suggests:
testthat,
knitr,
Expand Down
3 changes: 0 additions & 3 deletions NEWS.md
Expand Up @@ -6,9 +6,6 @@ elevatr 0.4.3 (2023-04-XX)
- Switched long lat check from my homespun thing to st::sf_is_longlat
- Fixed EPQS API URL. Moved to a new one. Thanks @haas4726 for the catch.




elevatr 0.4.2 (2021-12-28)
=============

Expand Down
6 changes: 3 additions & 3 deletions R/internal.R
Expand Up @@ -70,7 +70,7 @@ loc_check <- function(locations, prj = NULL){
nfeature <- nrow(locations)
}

if(class(locations)=="data.frame"){
if(inherits(locations, "data.frame")){
if(is.null(prj)){
stop("Please supply a valid crs via locations or prj.")
}
Expand All @@ -92,7 +92,7 @@ loc_check <- function(locations, prj = NULL){
proj4string = sp::CRS(SRS_string = prj),
data = df)
}
} else if(class(locations) == "SpatialPoints"){
} else if(inherits(locations, "SpatialPoints")){

crs_check <- is.na(st_crs(st_as_sf(locations)))
if(crs_check & is.null(prj)){
Expand All @@ -114,7 +114,7 @@ loc_check <- function(locations, prj = NULL){
elevation = vector("numeric", nrow(
sp::coordinates(locations)))))

} else if(class(locations) == "SpatialPointsDataFrame"){
} else if(inherits(locations,"SpatialPointsDataFrame")){
crs_check <- is.na(st_crs(st_as_sf(locations)))
if(crs_check & is.null(prj)) {
stop("Please supply a valid crs via locations or prj.")
Expand Down

0 comments on commit b8e1570

Please sign in to comment.