Skip to content

Commit

Permalink
second shot at #1303
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Mar 19, 2020
1 parent 9f94183 commit 13f1c9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions R/wkb.R
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ st_as_binary = function(x, ...) UseMethod("st_as_binary")
#' st_point(1e6 * c(1/3, 1/6)) %>% st_sfc(precision = 0.01) %>% st_as_binary %>% st_as_sfc
#' st_point(1e6 * c(1/3, 1/6)) %>% st_sfc(precision = 0.001) %>% st_as_binary %>% st_as_sfc
st_as_binary.sfc = function(x, ..., EWKB = FALSE, endian = .Platform$endian, pureR = FALSE,
precision = attr(x, "precision"), hex = FALSE, srid = 0) {
precision = attr(x, "precision"), hex = FALSE) {
stopifnot(endian %in% c("big", "little"))
if (pureR && precision != 0.0)
stop("for non-zero precision values, use pureR = FALSE")
Expand All @@ -257,7 +257,7 @@ st_as_binary.sfc = function(x, ..., EWKB = FALSE, endian = .Platform$endian, pur
else {
stopifnot(endian == .Platform$endian)
attr(x, "precision") = precision
structure(CPL_write_wkb(x, EWKB, srid = srid), class = "WKB")
structure(CPL_write_wkb(x, EWKB), class = "WKB")
}
if (hex)
vapply(ret, CPL_raw_to_hex, "")
Expand Down
3 changes: 1 addition & 2 deletions man/st_as_binary.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 13f1c9f

Please sign in to comment.