Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Jan 29, 2025
1 parent 405cb04 commit 189da19
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Package: raster
Type: Package
Title: Geographic Data Analysis and Modeling
Version: 3.6-30
Date: 2024-10-02
Imports: Rcpp, methods, terra (>= 1.7-29)
Version: 3.6-31
Date: 2025-01-16
Imports: Rcpp, methods, terra (>= 1.8-5)
LinkingTo: Rcpp
Depends: sp (>= 1.4-5), R (>= 3.5.0)
Suggests: ncdf4, igraph, tcltk, parallel, rasterVis, MASS, sf, tinytest, gstat, fields, exactextractr
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

This package is no longer developed and only receives minimal maintenance.
Please use the "terra" package instead.

--- 18-September-2022, version 3.6-3

raster no longer uses rgdal
Expand Down
18 changes: 13 additions & 5 deletions R/coerce.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ setAs("SpatRaster", "Raster",
#crs(r) <- crs(from)
extent(r) <- as.vector(ext(from))
projection(r) <- crs(from, proj=TRUE)

if (has.time(from)) {
try(r@z <- list(time(from)))
}

r
}
)
Expand Down Expand Up @@ -132,11 +137,9 @@ setAs("SpatRaster", "Raster",
}
crs(r, warn=FALSE) <- prj

#z <- from@z
#if (length(z) == 1) {
# z <- z[[1]]
# try(time(r) <- z, silent=TRUE)
#}
# if (length(from@z) == 1) {
# try(time(r) <- from@z[[1]], silent=TRUE)
# }
r
}

Expand Down Expand Up @@ -180,6 +183,11 @@ setAs("Raster", "SpatRaster",
prj <- .srs_from_sp(from@crs)
}
crs(x, warn=FALSE) <- prj

if (length(from@z) == 1) {
try(time(x) <- from@z[[1]], silent=TRUE)
}

x
}
)
Expand Down

0 comments on commit 189da19

Please sign in to comment.