Skip to content

Commit

Permalink
fix conflicts api_plot_raster
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbertocamara committed Jan 28, 2025
2 parents 7a476cc + 8d957d8 commit d52dea3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions R/api_plot_raster.R
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,7 @@
# warp the file to produce a temporary overview
class_file <- .gdal_warp_file(
raster_file = .tile_path(tile),
sizes = sizes,
t_srs = list("-r" = "near")
sizes = sizes
)
# read spatial raster file
rast <- .raster_open_rast(class_file)
Expand All @@ -292,9 +291,9 @@
# classified data with values that are not the same as the positions
# of the color array (e.g., 10, 20), causing a misrepresentation of
# the classes
values_available <- as.character(sort(unique(terra::values(rast),
na.omit = TRUE)))
labels <- labels[values_available]
labels_available <- as.character(
sort(unique(terra::values(rast), na.omit = TRUE))
)
# set levels for raster
terra_levels <- data.frame(
id = as.numeric(names(labels)),
Expand Down

0 comments on commit d52dea3

Please sign in to comment.