R/s2-serialize.R

Defines functions s2_geography_unserialize s2_geography_serialize

s2_geography_serialize <- function(x) {
  wk::wk_handle(
    as_s2_geography(x),
    wk::wkb_writer(endian = 1L),
    s2_projection = NULL
  )
}

s2_geography_unserialize <- function(bytes) {
  wk::wk_handle(
    bytes,
    s2::s2_geography_writer(
      oriented = TRUE,
      check = FALSE,
      projection = NULL
    )
  )
}

Try the s2 package in your browser

Any scripts or data that you put into this service are public.

s2 documentation built on June 1, 2026, 5:08 p.m.