diff --git a/DESCRIPTION b/DESCRIPTION index a761727f1..ff4743808 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -112,7 +112,7 @@ LinkingTo: VignetteBuilder: knitr Encoding: UTF-8 -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Roxygen: list(markdown = TRUE) Config/testthat/edition: 2 Config/needs/coverage: XML diff --git a/NEWS.md b/NEWS.md index e4ddcdf7a..6face8d82 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # version 1.0-17 +* `st_as_sf.sfc()` returns an object with geometry column named `geometry`; #2429 + * add `st_transform()` method for `bbox` objects; this uses OGRCoordinateTransformation::TransformBounds(), densifying first and antemeridian proof; #2415 * `st_filter.sf()` correctly scopes `x` and `y` arguments using !! operator; #2416 diff --git a/R/sf.R b/R/sf.R index a387ebe53..a9ea8cf7d 100644 --- a/R/sf.R +++ b/R/sf.R @@ -82,7 +82,7 @@ st_as_sf.sf = function(x, ...) x #' @name st_as_sf #' @export -st_as_sf.sfc = function(x, ...) st_sf(x, ...) +st_as_sf.sfc = function(x, ...) st_as_sf(data.frame(x), ...) #' Get, set, replace or rename geometry from an sf object diff --git a/tests/sfc.Rout.save b/tests/sfc.Rout.save index 39bfa293d..6134b2f4f 100644 --- a/tests/sfc.Rout.save +++ b/tests/sfc.Rout.save @@ -1,5 +1,5 @@ -R version 4.4.0 (2024-04-24) -- "Puppy Cup" +R version 4.4.1 (2024-06-14) -- "Race for Your Life" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu @@ -1083,7 +1083,7 @@ Geometry type: POINT Dimension: XY Bounding box: xmin: 0 ymin: 1 xmax: 0 ymax: 1 CRS: NA - x + geometry 1 POINT (0 1) > > # st_exterior_ring(): @@ -1134,4 +1134,4 @@ Geodetic CRS: WGS 84 > > proc.time() user system elapsed - 5.477 1.381 5.407 + 5.158 1.450 5.100 diff --git a/tests/spatstat.Rout.save b/tests/spatstat.Rout.save index 8f0a32e94..762a0237d 100644 --- a/tests/spatstat.Rout.save +++ b/tests/spatstat.Rout.save @@ -1,7 +1,7 @@ -R version 4.3.3 (2024-02-29) -- "Angel Food Cake" +R version 4.4.1 (2024-06-14) -- "Race for Your Life" Copyright (C) 2024 The R Foundation for Statistical Computing -Platform: x86_64-pc-linux-gnu (64-bit) +Platform: x86_64-pc-linux-gnu R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. @@ -125,8 +125,9 @@ Type 'q()' to quit R. + (y = st_as_sfc(as.psp(sf))) + all.equal(st_geometry(x), y) + } -spatstat.geom 3.2-9 -spatstat.random 3.2-3 +spatstat.univar 3.0-0 +spatstat.geom 3.3-2 +spatstat.random 3.3-1 Simple feature collection with 51 features and 1 field Geometry type: GEOMETRY Dimension: XY @@ -165,4 +166,4 @@ In st_as_sfc.owin(spatstat.geom::as.owin(x)) : > > proc.time() user system elapsed - 2.074 1.308 1.918 + 1.815 1.456 1.762