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

Release 1.4-1 ? #73

Open
rsbivand opened this issue Feb 25, 2020 · 6 comments
Open

Release 1.4-1 ? #73

rsbivand opened this issue Feb 25, 2020 · 6 comments

Comments

@rsbivand
Copy link
Contributor

Given #72, should we release sp again to calm CRAN a bit? Should we ask whether CRAN would like a pre-submission tarball to see if things are fixed? I'm running revdeps, but with NG rgdal and sf, so many positives don't apply to CRAN rgdal and sf.

@rsbivand
Copy link
Contributor Author

Oops - in fasterize:

library(sf)
library(fasterize)
p1 <- rbind(c(-180,-20), c(-140,55), c(10, 0), c(-140,-60), c(-180,-20))
hole <- rbind(c(-150,-20), c(-100,-10), c(-110,20), c(-150,-20))
p1 <- list(p1, hole)
p2 <- list(rbind(c(-10,0), c(140,60), c(160,0), c(140,-55), c(-10,0)))
p3 <- list(rbind(c(-125,0), c(0,60), c(40,5), c(15,-45), c(-125,0)))
pols <- st_sf(value = rep(1,3),
              geometry = st_sfc(lapply(list(p1, p2, p3), st_polygon)))
r <- raster(pols, res = 1)

for my sf gives:

Browse[2]> attr(x[[attr(x, "sf_column")]], "crs")[["proj4string"]]
NULL
Browse[2]> CRS(NULL)
Error in if (!is.na(projargs) && !nzchar(projargs)) projargs <- NA_character_ : 
  missing value where TRUE/FALSE needed

I'll add a NULL trap to sp::CRS().

@rsbivand
Copy link
Contributor Author

Done, will commit, push, and PR, as others may be affected. For fasterize, the example now fails on

> r <- fasterize(pols, r, field = "value", fun="sum")
Error in fasterize(pols, r, field = "value", fun = "sum") : 
  Index out of bounds: [index='proj4string'].
> debug(fasterize)
> r <- fasterize(pols, r, field = "value", fun="sum")
debugging in: fasterize(pols, r, field = "value", fun = "sum")
debug: {
    .Call("_fasterize_fasterize", PACKAGE = "fasterize", sf, 
        raster, field, fun, background, by)
}

because the Rcpp code accesses:

    Rcpp::CharacterVector sfproj4 =
      Rcpp::as<Rcpp::StringVector>(
        Rcpp::as<Rcpp::List>(polygons.attr("crs"))["proj4string"]
      );
    if(sfproj4[0] != NA_STRING) {
      Rcpp::S4 rcrs(raster1.slot("crs"));
      rcrs.slot("projargs") = sfproj4;
    }

without checking that the sf "crs" ojbect has a "proj4string" component. @noamross , @mdsumner ?

@edzer
Copy link
Owner

edzer commented Feb 25, 2020

@noamross see also r-spatial/sf#1225

@edzer
Copy link
Owner

edzer commented Feb 25, 2020

@rsbivand let me know when to release.

@rsbivand
Copy link
Contributor Author

rsbivand commented Feb 25, 2020 via email

@rsbivand
Copy link
Contributor Author

rsbivand commented Feb 25, 2020 via email

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

2 participants