Skip to content

Commit 990ede2

Browse files
authored
st_join renames geom column to 'geometry' if x is st_sf with only a st_sfc col.
z <- st_sf(pid=5, geom=st_sfc(st_polygon(list(matrix(c(0,0,4,0,4,4,0,4,0,0),ncol=2, byrow=T))))) x <- st_sf(id=1:2, geom=st_sfc(st_point(1:2), st_point(2:3))) st_join(x[,'geom'], z)
1 parent 9073a52 commit 990ede2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

R/join.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ st_join.sf = function(x, y, join = st_intersects, ..., suffix = c(".x", ".y"),
174174
if (inherits(x, "tbl_df") && requireNamespace("dplyr", quietly = TRUE))
175175
st_sf(dplyr::bind_cols(x[ix,], y[unlist(i), , drop = FALSE]))
176176
else
177-
st_sf(cbind(as.data.frame(x)[ix,], y[unlist(i), , drop = FALSE]))
177+
st_sf(cbind(as.data.frame(x)[ix, ,drop=FALSE], y[unlist(i), , drop = FALSE]))
178+
178179
}
179180

180181
#' @export

0 commit comments

Comments
 (0)