Skip to content

Commit

Permalink
Fixes a bug when sf window object has no columns
Browse files Browse the repository at this point in the history
  • Loading branch information
Nowosad committed May 22, 2023
1 parent 5bd9610 commit 23c7ba2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# motif 0.6.3

* Adds an option to remove metadata information with `lsp_add_stars`, `lsp_add_terra`, and `lsp_add_sf`
* Fixes a bug when sf window object has no columns

# motif 0.6.2

Expand Down
1 change: 1 addition & 0 deletions R/lsp_add_spatial.R
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ lsp_add_sf.lsp = function(x = NULL, window = NULL, metadata = TRUE){
output_sf = sf::st_as_sf(output_stars)
} else {
output_sf = window
if (!("id" %in% colnames(output_sf))) output_sf$id = seq_len(nrow(output_sf))
}
output_sf = merge(x, output_sf, by = "id", all.x = TRUE)
output_sf = tibble::as_tibble(output_sf)
Expand Down

0 comments on commit 23c7ba2

Please sign in to comment.