From 05651ab7ead24ae0a02b307dc39f8c8d61146d10 Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Mon, 24 Jun 2024 13:54:40 -0300 Subject: [PATCH] use union instead of coverage union --- tests/testthat/test-s2-accessors.R | 2 +- tests/testthat/test-s2-transformers.R | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/testthat/test-s2-accessors.R b/tests/testthat/test-s2-accessors.R index c0979216..19653c54 100644 --- a/tests/testthat/test-s2-accessors.R +++ b/tests/testthat/test-s2-accessors.R @@ -103,7 +103,7 @@ test_that("s2_area works", { expect_identical(s2_area("POINT EMPTY"), 0) expect_identical(s2_area("LINESTRING (0 0, 1 1)"), 0) expect_identical(s2_area("POLYGON EMPTY"), 0) - expect_identical(s2_area("POLYGON ((0 0, 90 0, 0 90, 0 0))", radius = 1), 4 * pi / 8) + expect_equal(s2_area("POLYGON ((0 0, 90 0, 0 90, 0 0))", radius = 1), 4 * pi / 8) # make sure the radius is squared! expect_true( abs(s2_area("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))", radius = 180 / pi) - 100) < 0.27 diff --git a/tests/testthat/test-s2-transformers.R b/tests/testthat/test-s2-transformers.R index 0e41a838..741e2685 100644 --- a/tests/testthat/test-s2-transformers.R +++ b/tests/testthat/test-s2-transformers.R @@ -609,14 +609,9 @@ test_that("s2_rebuild() works", { }) test_that("real data survives the S2BooleanOperation", { - # the 32-bit Solaris build results in some of the roundtripped - # edges becoming degenerate. Rather than pass check = FALSE to - # as_s2_geography(), just skip this on Solaris - skip_on_os("solaris") - for (continent in unique(s2::s2_data_tbl_countries$continent)) { # this is primarily a test of the S2BooleanOperation -> Geography constructor - unioned <- expect_s3_class(s2_coverage_union_agg(s2_data_countries(continent)), "s2_geography") + unioned <- expect_s3_class(s2_union_agg(s2_data_countries(continent)), "s2_geography") # this is a test of RGeography::Export() on potentially complex polygons exported <- expect_length(s2_as_binary(unioned), 1)