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

slope_raster() error with terra rast object #48

Closed
lauren-obrien opened this issue Dec 21, 2022 · 8 comments
Closed

slope_raster() error with terra rast object #48

lauren-obrien opened this issue Dec 21, 2022 · 8 comments
Assignees

Comments

@lauren-obrien
Copy link

Hi,
this package is so useful! Many thanks.

Unfortunately, there seems to be a new error in slope_raster() when using a terra::rast() object as DEM, see below (example code is from terra::extract() help page, with a couple of mods):

library(sf)
library(terra)    # 1.6-47
library(slopes)

r <-rast(ncols=5, nrows=5, xmin=0, xmax=5, ymin=0, ymax=5)
values(r) <- 1:25
xy <- rbind(c(0.5,0.5), c(2.5,2.5))
p <- vect(xy, crs="+proj=longlat +datum=WGS84", typ = 'lines')
p <- st_as_sf(p)

slope_raster(p, r)
# Error in .local(x, y, ...) : unused argument (method = "bilinear")

slope_raster(p, raster::raster(r))
# runs ok, with appropriate warnings about large distances

This actually looks like a regression in terra, see Issue 46 and commit rspatial/terra@81bfb0a

@Robinlovelace
Copy link
Member

Thanks for the bug report and very useful reproducible example. Motivation to finally get this on CRAN #45! I guess this issue arose after the latest version of terra on 2nd December, right? https://cran.r-project.org/package=terra

@lauren-obrien
Copy link
Author

I assume so - sorry, only used this package for the first time today and have been using terra only intermittently of late

@Robinlovelace
Copy link
Member

Fixed upstream now: rspatial/terra#956

@maelle
Copy link
Member

maelle commented Jan 5, 2023

@Robinlovelace I think the pkgdown building is failing due to this same problem. The vignette benchmark.Rmd can't be knit. Should there be a Remotes field in DESCRIPTION until terra is re-released?

@Robinlovelace
Copy link
Member

@Robinlovelace I think the pkgdown building is failing due to this same problem. The vignette benchmark.Rmd can't be knit. Should there be a Remotes field in DESCRIPTION until terra is re-released?

Probably. Will check with the author of terra on likely ETA for release (talking of which #45 still needs to be on CRAN, any help with that from rOpenSci v. welcome).

@rspatial when is the next version of terra likely to be released?

Many thanks.

@Robinlovelace
Copy link
Member

And @rhijmans, hopefully you get this notification. Thanks!

@rhijmans
Copy link

rhijmans commented Jan 5, 2023

I can send it to CRAN sometime this week.

@Robinlovelace
Copy link
Member

I can send it to CRAN sometime this week.

Fantastic, many thanks Robert.

@Robinlovelace Robinlovelace self-assigned this Jan 5, 2023
@maelle maelle closed this as completed Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants