Skip to content

Commit

Permalink
don't use geos_geometry_writer() by default for sf objects (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Nov 6, 2021
1 parent 29983c6 commit 7d799e7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions R/compat-sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@
#' @rdname as_geos_geometry
#' @export
as_geos_geometry.sfc <- function(x, ...) {
geos <- wk::wk_handle(x, geos_geometry_writer())
attr(geos, "crs") <- sf::st_crs(x)
geos
geos_read_wkb(sf::st_as_binary(x), crs = sf::st_crs(x))
}

#' @rdname as_geos_geometry
#' @export
as_geos_geometry.sf <- function(x, ...) {
geos <- wk::wk_handle(x, geos_geometry_writer())
attr(geos, "crs") <- sf::st_crs(x)
geos
geos_read_wkb(sf::st_as_binary(sf::st_geometry(x)), crs = sf::st_crs(x))
}

# dynamically exported
Expand Down

0 comments on commit 7d799e7

Please sign in to comment.