Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/rspatial/raster
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Dec 4, 2023
2 parents f0104fb + 6fb18b4 commit a2065ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

- name: Install spatial dependencies
run: brew install gdal
Expand All @@ -29,7 +29,7 @@ jobs:
shell: Rscript {0}

- name: Restore R package cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
Expand Down
8 changes: 7 additions & 1 deletion R/netCDFwriteCD.R
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,18 @@
}


.stopWriteCDF <- function(x) {
.writeRangeCDF <- function(x) {

nc <- ncdf4::nc_open(x@file@name, write=TRUE)
on.exit( ncdf4::nc_close(nc) )
ncdf4::ncatt_put(nc, x@title, 'min', as.numeric(x@data@min))
ncdf4::ncatt_put(nc, x@title, 'max', as.numeric(x@data@max))
}


.stopWriteCDF <- function(x) {

.writeRangeCDF(x)
if (inherits(x, 'RasterBrick')) {
r <- brick(x@file@name)
} else {
Expand Down

0 comments on commit a2065ae

Please sign in to comment.