Last chance! 50% off unlimited learning
Sale ends in
get_centroid
identifies the 2D centroid
in a WKT object (or vector of WKT objects). Note that it assumes
cartesian values.
wkt_centroid(wkt)
a character vector of WKT objects, represented as strings
a data.frame of two columns, lat
and lng
,
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
wkt_coords()
to extract all coordinates, and
wkt_bounding()
to extract a bounding box.
# NOT RUN {
wkt_centroid("POLYGON((2 1.3,2.4 1.7))")
# }
Run the code above in your browser using DataLab