Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Mar 20, 2024
1 parent 5f20b77 commit 06e04a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# version 0.6-5

* fix `st_as_stars()` method for `Spatial` gridded objects; see https://github.com/r-spatial/gstat/issues/123

* add `prcomp()` methods for `stars` and `stars_proxy` objects, working on attributes or last dimension

* `st_rasterize()` with `align=TRUE` returns `NA` values where there are no data; #668
Expand Down
2 changes: 1 addition & 1 deletion R/sp.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ st_as_stars.Spatial = function(.x, ...) {
offset = gt$cellcentre.offset[1] - 0.5 * gt$cellsize[1], delta = gt$cellsize[1],
refsys = st_crs(.x))
y = create_dimension(1, gt$cells.dim[2],
offset = gt$cellcentre.offset[2] + (gt$cells.dim[2] - 0.5) * gt$cellsize[1],
offset = gt$cellcentre.offset[2] + (gt$cells.dim[2] - 0.5) * gt$cellsize[2],
delta = -gt$cellsize[2], refsys = st_crs(.x))
d = create_dimensions(list(x = x, y = y), raster = get_raster(dimensions = c("x", "y")))
lst = lapply(.x@data, function(x, dims) structure(x, dim = dims), dims = dim(d))
Expand Down

0 comments on commit 06e04a1

Please sign in to comment.