Skip to content

krige0 cannot be used with sf objects #148

Description

@agila5

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions