Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Jul 9, 2024
1 parent b75f4c3 commit 285d444
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions R/raster.R
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ setMethod('raster', signature(x='RasterBrick'),
r <- raster(extent(x), nrows=nrow(x), ncols=ncol(x), crs=.getCRS(x))
r@file <- x@file

r@file@blockrows <- x@file@blockrows
r@file@blockcols <- x@file@blockcols
r@file@blockrows <- x@file@blockrows[dindex]
r@file@blockcols <- x@file@blockcols[dindex]
r@file@nbands <- nlayers(x)

r@data@offset <- x@data@offset
r@data@gain <- x@data@gain
r@data@offset <- x@data@offset[dindex]
r@data@gain <- x@data@gain[dindex]
r@data@inmemory <- FALSE
r@data@fromdisk <- TRUE
r@data@haveminmax <- x@data@haveminmax
Expand All @@ -253,8 +253,6 @@ setMethod('raster', signature(x='RasterBrick'),
attr(r@data, "level") <- x@data@level
}

r@data@offset <- x@data@offset
r@data@gain <- x@data@gain
r@file@nodatavalue <- x@file@nodatavalue

} else {
Expand Down

0 comments on commit 285d444

Please sign in to comment.