View source: R/calculate_centroid.R
calculate_centroid | R Documentation |
Calculates the centroid and radius of a WKT geometry.
calculate_centroid(wkt)
wkt |
character vector One or more WKT strings with longitude/latitude coordinates (EPSG=4326) |
The centroid is defined as the centroid of the convex hull of the provided geometry.
Data frame with centroid coordinates and radius in meter.
calculate_centroid("POLYGON ((-1 -1, -1 1, 1 1, 1 -1, -1 -1))")
calculate_centroid("MULTIPOLYGON (((-1 -1, -1 1, 1 1, 1 -1, -1 -1)))")
calculate_centroid("LINESTRING (-1 -1, 0 -1, 0 1, 1 1)")
calculate_centroid("MULTILINESTRING ((-1 -1, 0 -1, 0 1, 1 1), (-3 -3, 3 3))")
calculate_centroid("POINT (0 0)")
calculate_centroid("MULTIPOINT ((0 1), (0 -1))")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.