wktdf2sp: Convert a data frame with a WKT column into...

View source: R/utils.R

wktdf2spR Documentation

Convert a data frame with a WKT column into SpatialPolygonsDataFrame.

Description

Many queries to the DOPA API return a response object that has the spatial geometry stored as a WKT MULTIPOLYGON data. This function converts the input data frame into a SpatialPolygonsDataFrame.

Usage

wktdf2sp(x, wkt.col, p4s = "+init=epsg:4326")

Arguments

x

Data frame containing all the necessary data.

wkt.col

Character string name of the column containing the WKT data.

p4s

Either a character string or an object of class CRS. (default: "+init=epsg:4326")

Details

A functional installation of rgeos is needed.

Value

A SpatialPolygonsDataFrame.

Author(s)

Joona Lehtomaki <joona.lehtomaki@gmail.com>


ropensci/rdopa documentation built on May 18, 2022, 6:32 p.m.