get_centroid identifies the 2D centroid
in a WKT object (or vector of WKT objects). Note that it assumes
a character vector of WKT objects, represented as strings
a data.frame of two columns,
with each row containing the centroid from the corresponding wkt
object. In the case that the object is NA (or cannot be decoded)
the resulting values will also be NA
1 2 3
wkt_centroid("POLYGON((2 1.3,2.4 1.7))") # lng lat #1 2 1.3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.