Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Oct 9, 2024
1 parent b460a50 commit c800b23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions R/geom-transformers.R
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ st_simplify.sfc = function(x, preserveTopology, dTolerance = 0.0) {
if (ll && sf_use_s2()) {
if (!missing(preserveTopology) && isFALSE(preserveTopology))
warning("argument preserveTopology cannot be set to FALSE when working with ellipsoidal coordinates since the algorithm behind st_simplify always preserves topological relationships")
if (length(dTolerance) == 1) {
if (length(dTolerance) == 1) {
st_as_sfc(s2::s2_simplify(x, dTolerance), crs = st_crs(x))
} else {
simplify <- function(x, dTolerance) st_as_sfc(s2::s2_simplify(x, dTolerance))
Expand Down Expand Up @@ -1178,5 +1178,5 @@ st_exterior_ring.sfc = function(x, ...) {
else
stop(paste("no exterior_ring method for objects of class", class(x)[1]))
}
st_as_sfc(lapply(x, exterior_sfg), crs = st_crs(x))
st_as_sfc(lapply(x, exterior_sfg), crs = st_crs(x))
}
8 changes: 5 additions & 3 deletions tests/gdal_geom.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 @@ -51,6 +51,8 @@ Type 'q()' to quit R.
>
> x = st_simplify(nc_tr, dTolerance = 1e4)
>
> x = st_simplify(nc_tr, dTolerance = rep(1e4, nrow(nc_tr)))
>
> x = st_simplify(nc_tr, preserveTopology = TRUE)
>
> if (sf:::CPL_geos_version() >= "3.4.0")
Expand Down Expand Up @@ -324,4 +326,4 @@ lines[GRID.lines.1]
>
> proc.time()
user system elapsed
0.960 1.292 0.749
0.843 1.401 0.740

0 comments on commit c800b23

Please sign in to comment.