Skip to content

Commit

Permalink
sc
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Dec 4, 2023
1 parent 2c4831e commit f0104fb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions R/rasterFromGDAL.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@
r@data@min <- minv[band]
r@data@max <- maxv[band]

sc <- scoff(x)
r@data@gain <- sc[band,1]
r@data@offset <- sc[band,2]


if (is.factor(x)[1]) {
cts <- cats(x)[[1]]
if (!is.null(cts)) {
Expand All @@ -83,6 +88,9 @@
} else {
r@data@min <- minv
r@data@max <- maxv
sc <- scoff(x)
r@data@gain <- sc[,1]
r@data@offset <- sc[,2]
}

return(r)
Expand Down

0 comments on commit f0104fb

Please sign in to comment.