Skip to content

Commit

Permalink
use union instead of coverage union
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Jun 24, 2024
1 parent 6141873 commit 05651ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/test-s2-accessors.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 1 addition & 6 deletions tests/testthat/test-s2-transformers.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 05651ab

Please sign in to comment.