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) |
---|
Data frame with centroid coordinates and radius in meter.
The centroid is defined as the centroid of the convex hull of the provided geometry.
calculate_centroid("POLYGON ((-1 -1, -1 1, 1 1, 1 -1, -1 -1))")#> decimalLongitude decimalLatitude coordinateUncertaintyInMeters #> 1 0 0 156899.6calculate_centroid("MULTIPOLYGON (((-1 -1, -1 1, 1 1, 1 -1, -1 -1)))")#> decimalLongitude decimalLatitude coordinateUncertaintyInMeters #> 1 0 0 156899.6calculate_centroid("LINESTRING (-1 -1, 0 -1, 0 1, 1 1)")#> decimalLongitude decimalLatitude coordinateUncertaintyInMeters #> 1 0 0 156899.6calculate_centroid("MULTILINESTRING ((-1 -1, 0 -1, 0 1, 1 1), (-3 -3, 3 3))")#> decimalLongitude decimalLatitude coordinateUncertaintyInMeters #> 1 0 0 470605calculate_centroid("POINT (0 0)")#> decimalLongitude decimalLatitude coordinateUncertaintyInMeters #> 1 0 0 0calculate_centroid("MULTIPOINT ((0 1), (0 -1))")#> decimalLongitude decimalLatitude coordinateUncertaintyInMeters #> 1 0 0 110574.4