Skip to content

Commit

Permalink
Merge branch 'main' into polygon_full2
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Oct 9, 2024
2 parents 8e02a1d + 46dc189 commit b460a50
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

* fix build failure with GDAL < 3.4.0 #2436

* `st_simplify()` now accepts feature-wise tolerance values when `s2` is switched on #2442

# version 1.0-17

* add `st_transform()` method for `bbox` objects; this uses OGRCoordinateTransformation::TransformBounds(), densifying first and antemeridian proof; #2415
Expand Down
7 changes: 6 additions & 1 deletion R/geom-transformers.R
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,12 @@ 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")
st_as_sfc(s2::s2_simplify(x, dTolerance), crs = st_crs(x))
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))
st_as_sfc(mapply(simplify, x, dTolerance), crs = st_crs(x))
}
} else {
if (missing(preserveTopology)) {
preserveTopology = FALSE
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
[![tic-db](https://github.com/r-spatial/sf/actions/workflows/tic-db.yml/badge.svg)](https://github.com/r-spatial/sf/actions/workflows/tic-db.yml)
[![Coverage Status](https://img.shields.io/codecov/c/github/r-spatial/sf/main.svg)](https://app.codecov.io/gh/r-spatial/sf)
[![License](http://img.shields.io/badge/license-GPL%20%28%3E=%202%29-brightgreen.svg?style=flat)](http://www.gnu.org/licenses/gpl-2.0.html)
[![CRAN](http://www.r-pkg.org/badges/version/sf)](https://cran.r-project.org/package=sf)
[![CRAN](https://www.r-pkg.org/badges/version/sf)](https://cran.r-project.org/package=sf)
[![cran checks](https://badges.cranchecks.info/worst/sf.svg)](https://cran.r-project.org/web/checks/check_results_sf.html)
[![Downloads](http://cranlogs.r-pkg.org/badges/sf?color=brightgreen)](https://www.r-pkg.org:443/pkg/sf)
[![status](https://tinyverse.netlify.com/badge/sf)](https://CRAN.R-project.org/package=sf)
[![Downloads](https://cranlogs.r-pkg.org/badges/sf?color=brightgreen)](https://www.r-pkg.org/pkg/sf)
[![status](https://tinyverse.netlify.app/badge/sf)](https://CRAN.R-project.org/package=sf)
<!-- badges: end -->

# Simple Features for R
Expand Down Expand Up @@ -159,13 +159,13 @@ If you use dynamic linking (installation from source) and have multiple versions

### lwgeom

Functions and methods that require `liblwgeom`, including ellipsoidal (not spherical or Eucledian) metrics (area, distances), are provide by and used from [lwgeom](https://github.com/r-spatial/lwgeom), which is also on [CRAN](https://cran.r-project.org/package=lwgeom).
Functions and methods that require `liblwgeom`, including ellipsoidal (not spherical or Euclidean) metrics (area, distances), are provide by and used from [lwgeom](https://github.com/r-spatial/lwgeom), which is also on [CRAN](https://cran.r-project.org/package=lwgeom).

## Contributing

* Contributions of all sorts are most welcome, issues and pull requests are the preferred ways of sharing them.
* When contributing pull requests, please adhere to the package style (in package code use `=` rather than `<-`; don't change indentation; tab stops of 4 spaces are preferred)
* This project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.
* When contributing pull requests, please adhere to the package style (in package code use `=` rather than `<-`; don't change indentation; tab stops of 4 spaces are preferred).
* This project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project, you agree to abide by its terms.

## How to cite

Expand Down
2 changes: 2 additions & 0 deletions tests/gdal_geom.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ x = st_convex_hull(nc)

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

0 comments on commit b460a50

Please sign in to comment.