Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Jan 21, 2025
1 parent 270bdbc commit 7f0031a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
5 changes: 4 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

## bug fixes

- `readRDS` failed for rasters with timestep="seconds"
- `readRDS` failed for rasters with timestep="seconds" [#1711](https://github.com/rspatial/terra/issues/1711) by Pascal Oettli

## enhancements

- `bestMatch` now has argument "fun" to allow the use of different distance measures, and a <matrix> method
- `wrap` (and `writeRDS`) now capture varnames/longnames [#1719](https://github.com/rspatial/terra/issues/1719) by Andrew Gene Brown


## new



# version 1.8-10

Released 2025-01-13
Expand Down
12 changes: 9 additions & 3 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ halo <- function(x, y=NULL, labels, col="black", hc="white", hw=0.1, ... ) {


setMethod("text", signature(x="SpatRaster"),
function(x, labels, digits=0, halo=FALSE, hc="white", hw=0.1, ...) {
function(x, labels, digits=0, halo=FALSE, hc="white", hw=0.1, cex=1, overlap=TRUE, ...) {
if (missing(labels)) {
labels <- 1
}
Expand All @@ -215,10 +215,16 @@ setMethod("text", signature(x="SpatRaster"),
} else if (is.numeric(labels)) {
labels <- as.character(round(labels, digits=digits) )
}
if (length(labels) < nrow(xy)) {
labels <- rep(labels, nrow(xy))
}
# if (!overlap) {
# xy <- getLabelXY(xy, labels, cex)
# }
if (halo && (isTRUE(hw > 0))) {
.halo(xy[,1], xy[,2], labels, hc=hc, hw=hw, ...)
.halo(xy[,1], xy[,2], labels, hc=hc, hw=hw, cex=cex, ...)
} else {
text(xy[,1], xy[,2], labels, ...)
text(xy[,1], xy[,2], labels, cex=cex, ...)
}
}
)
Expand Down
2 changes: 1 addition & 1 deletion man/adjacent.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ When using global lon/lat rasters, adjacent cells at the other side of the date-
}


\seealso{\code{\link{relate}}, \code{\link{nearby}}}, \code{\link{nearest}}}
\seealso{\code{\link{relate}, \link{nearby}, \link{nearest}}}

\value{
matrix
Expand Down

0 comments on commit 7f0031a

Please sign in to comment.