Create a data frame of longitude and latitude centroids of each polygon.

create_centroids(shp_sf, sf_id, largest = TRUE, verbose = FALSE)

Arguments

shp_sf

an sf object, a data set with a simple feature list column

sf_id

a string to indicate the column to identify individual polygons

largest

logical; for st_centroid: if TRUE, return centroid of the largest subpolygon of a MULTIPOLYGON rather than the whole MULTIPOLYGON

verbose

a boolean to indicate whether to show function progress

Value

a tibble containing longitude and latitude

Examples

centroids <- create_centroids(tas_lga, "lga_code_2016")