Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

wkt_coords

Extract Latitude and Longitude from WKT polygons


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

wkt_coords(wkt)

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

wkt_coords("POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))")

wellknown

Convert Between 'WKT' and 'GeoJSON'

v0.7.2
MIT + file LICENSE
Authors
Scott Chamberlain [aut, cre] (<https://orcid.org/0000-0003-1444-9135>), Os Keyes [aut] (author of code in src/)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.