wkt_coords: Extract Latitude and Longitude from WKT polygons

Description Usage Arguments Value See Also Examples

View source: R/RcppExports.R

Description

wkt_coords extracts lat/long values from WKT polygons, specifically the outer shell of those polygons (working on the assumption that said outer edge is what you want).

Because it assumes coordinates, it also assumes a sphere - say, the earth - and uses spherical coordinate values.

Usage

1

Arguments

wkt

a character vector of WKT objects

Value

a data.frame of four columns; object (containing which object the row refers to), ring containing which layer of the object the row refers to, lng and lat.

See Also

wkt_bounding to extract a bounding box, and wkt_centroid to extract the centroid.

Examples

1
2
3
4
5
6
7
wkt_coords("POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))")
# object  ring lng lat
# 1    1 outer  30  10
# 2    1 outer  40  40
# 3    1 outer  20  40
# 4    1 outer  10  20
# 5    1 outer  30  10

wicket documentation built on Nov. 20, 2017, 1:06 a.m.