8000 krige0 cannot be used with sf objects · Issue #148 · r-spatial/gstat · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

krige0 cannot be used with sf objects #148

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”, 8C7D 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

Open
agila5 opened this issue Mar 6, 2025 · 0 comments
Open

krige0 cannot be used with sf objects #148

agila5 opened this issue Mar 6, 2025 · 0 comments

Comments

@agila5
Copy link
Contributor
agila5 commented Mar 6, 2025

The current definition of krige0 is as follows:

gstat/R/krige0.R

Lines 34 to 41 in d1ffbb7

krige0 <- function(formula, data, newdata, model, beta, y, ...,
computeVar = FALSE, fullCovariance = FALSE) {
if (inherits(data, "ST"))
stopifnot(identical(data@sp@proj4string@projargs, newdata@sp@proj4string@projargs))
else
stopifnot(identical(data@proj4string@projargs, newdata@proj4string@projargs))
lst = extractFormula(formula, data, newdata)

and, as far as I can tell, it's not currently possible to use this function when the underlying data is stored as an sf object.

Would you be interested in such extension? I would be happy to work on a PR but I'm not sure how to proceed. Should I convert the existing code to S4 approach and add a new method for sf objects? Or just add a series of if clauses to convert intermediate sf objects into sp format?

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

1 participant
0