这是indexloc提供的服务,不要输入任何密码
Skip to content

tmap4: empty rasters return errors #698

@Nowosad

Description

@Nowosad
library(terra)
library(tmap)

r <- rast(matrix(NA, 2, 2), crs = "EPSG:4326")

# not reading from disk
tm_shape(r) + tm_raster(col.scale = tm_scale(value = "inferno"))
#> Error in tmapScale_returnNA(n = length(x1), legend = legend, value.na = value.na, : unused argument (na.show = na.show)

writeRaster(r, f <- tempfile(fileext='.tif'))
r <- rast(f)

# from disk, with palette specified
tm_shape(r) + tm_raster(col.scale = tm_scale(value = "inferno"))
#> Error in tmapScale_returnNA(n = length(x1), legend = legend, value.na = value.na, : unused argument (na.show = na.show)

Supersedes: #529.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions