Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement promote_to_multi when converting WKB to sfc #2369

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
maybe fix check
paleolimbot committed Mar 31, 2024
commit 600564bb58e5813149ebfd3bad647a93d58ea5d0
10 changes: 4 additions & 6 deletions tests/testthat/test-wkb.R
Original file line number Diff line number Diff line change
@@ -97,10 +97,9 @@ test_that("st_as_sfc() for WKB can promote_to_multi for multilinestring + linest

# st_as_sfc() assigns different attribute order than st_cast, but we ony care
# about whether the geometries are correct
expect_equal(
expect_equivalent(
st_as_sfc(wkb_mixed, promote_to_multi = TRUE),
st_cast(sfc_mixed, "MULTILINESTRING"),
ignore_attr = TRUE
st_cast(sfc_mixed, "MULTILINESTRING")
)
})

@@ -120,9 +119,8 @@ test_that("st_as_sfc() for WKB can promote_to_multi for multipolygon + polygon",

# st_as_sfc() assigns different attribute order than st_cast, but we ony care
# about whether the geometries are correct
expect_equal(
expect_equivalent(
st_as_sfc(wkb_mixed, promote_to_multi = TRUE),
st_cast(sfc_mixed, "MULTILINESTRING"),
ignore_attr = TRUE
st_cast(sfc_mixed, "MULTILINESTRING")
)
})