This function, as follows from the title, tries to guess the polygon centerline by connecting the most distant points from each other. First, it finds the point most distant from the polygon's centroid, then it searches for a second point, which is most distant from the first. The line connecting these two points will be the desired centerline.
skeleton: NULL (default) or cnt_skeleton() output. If NULL then polygon's skeleton would be estimated in the background using specified parameters (see inherit params below).
return_geos: FALSE (default). A logical flag that controls whether the geos_geometry should be returned.
...: Arguments passed on to cnt_skeleton
keep: numeric, proportion of points to retain (0.05-5.0; default 0.5). See Details.
method: character, either "voronoi" (default) or "straight", or just the first letter "v" or "s". See Details.
Returns
An sf, sfc or SpatVector class object of a LINESTRING geometry