Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error from plot_raster() if called on a raster dataset with complex data type #480

Closed
ctoney opened this issue Aug 13, 2024 · 0 comments · Fixed by #582
Closed

Error from plot_raster() if called on a raster dataset with complex data type #480

ctoney opened this issue Aug 13, 2024 · 0 comments · Fixed by #582

Comments

@ctoney
Copy link
Collaborator

ctoney commented Aug 13, 2024

If input to plot_raster() is a GDALRaster object for a raster with a complex data type (e.g., CFloat32):

plot_raster(ds)
#> Error in min(x, na.rm = TRUE) : invalid 'type' (complex) of argument

Can be worked around by first reading the pixel data and passing a representation of it to plot_raster(), e.g.,

r <- read_ds(ds)
r.angle <- Arg(r)
# the "gis" attributes may be needed
attributes(r.angle) <- attributes(r) 
plot_raster(r.angle)

Should at least document and return a useful error message from plot_raster(), or add a pixel function argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant