Skip to content

Commit

Permalink
closes #2429
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Aug 28, 2024
1 parent 6e13be9 commit e5bce2e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/sfc.Rout.save
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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():
Expand Down Expand Up @@ -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
11 changes: 6 additions & 5 deletions tests/spatstat.Rout.save
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit e5bce2e

Please sign in to comment.