We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3393c4 commit 6a9e35fCopy full SHA for 6a9e35f
R/spatstat.R
@@ -195,7 +195,7 @@ as.owin.sf = function(W, ...) {
195
}
196
197
#' @export
198
-st_as_sfc.owin = function(x, ...) {
+st_as_sfc.owin = function(x, ..., crs = NA) {
199
# FROM: methods for coercion to Spatial Polygons by Adrian Baddeley, pkg maptools
200
check_spatstat("spatstat.geom")
201
# Check internal spatstat multiplier:
@@ -220,6 +220,7 @@ st_as_sfc.owin = function(x, ...) {
220
w = which.min(st_area(exteriors[ cb[[i]] ]))
221
pieces[[w]] = st_polygon(c(unclass(pieces[[w]]), unclass(holes[[i]])))
222
223
+ st_crs(pieces) = crs
224
if (length(pieces) > 1) # multiple POLYGONs, collapse:
225
st_sfc(do.call(c, pieces))
226
else
0 commit comments