R/sp_convert.R

Defines functions sf_convert

Documented in sf_convert

#' @title Convert spatial objects to WKT
#' @description `sp_convert` turns objects from the `sp` package
#' (SpatialPolygons, SpatialPolygonDataFrames) or the `sf` package
#' (sf, sfc, POLYGON, MULTIPOLYGON) - into WKT POLYGONs or MULTIPOLYGONs
#' @export
#' @param x an sf or sfc object. one or more can be submitted
#' @return a character vector of WKT objects
sf_convert <- function(x) as.character(wk::as_wkt(x))

Try the wellknown package in your browser

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

wellknown documentation built on May 26, 2021, 1:06 a.m.