Skip to content

geom_spatraster() gives : Error in ggplot2::scale_fill_manual() with raster #171

@beausoleilmo

Description

@beausoleilmo

I was trying the package and wasn't able to make geom_spatraster() work

From the tif data here :
https://www.donneesquebec.ca/recherche/fr/dataset/utilisation-du-territoire

lulc_raw = rast(x = "utilisation_territoire_2020/utilisation_territoire_2020.tif")
gg_map_gbif = ggplot() + 
geom_spatraster(data = lulc_raw) 
<SpatRaster> resampled to 500621 cells.

 gg_map_gbif
Error in `ggplot2::scale_fill_manual()`:
! Continuous values supplied to discrete scale.
ℹ Example values: NA, NA, NA, NA, and NA
Run `rlang::last_trace()` to see where the error occurred.

Is the error (Error in ggplot2::scale_fill_manual()) because the tif has a cats table?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions