wicket (version 0.4.0)

sp_convert: Convert SpatialPolygons or SpatialPolygonDataFrames into WKT objects

Description

sp_convert turns objects from the sp package - specifically, SpatialPolygons and SpatialPolygonDataFrames - into WKT POLYGONs or MULTIPOLYGONs

Usage

sp_convert(x, group = TRUE)

Arguments

x

a list of SP/SPDF objects (or a single object)

group

whether or not to group coordinates together in the case that an object in x has multiple sets of coordinates. If TRUE (the default), such objects will be returned as MULTIPOLYGONs - if FALSE, as a vector of POLYGONs.

Value

either a character vector of WKT objects - one per sp object - if group is TRUE, or a list of vectors if group is FALSE.

See Also

bounding_wkt, for turning bounding boxes within sp objects into WKT objects.

Examples

Run this code
# NOT RUN {
library(sp)
s1 <- SpatialPolygons(list(Polygons(list(Polygon(cbind(c(2,4,4,1,2),c(2,3,5,4,2)))), "s1")))
sp_convert(s1)
# }

Run the code above in your browser using DataLab