Compute the centroid of longitude/latitude polygons. Unlike other functions in this package, there is no spherical trigonomery involved in the implementation of this function. Instead, the function projects the polygon to the (conformal) Mercator coordinate reference system, computes the centroid, and then inversely projects it to longitude and latitude. This approach fails for polygons that include one of the poles (and is rather biased for anything close to the poles). The function should work for polygons that cross the -180/180 meridian (date line).
a 2-column matrix (longitude/latitude)
Additional arguments. None implemented
A matrix (longitude/latitude)
For multi-part polygons, the centroid of the largest part is returned.
Robert J. Hijmans
lon lat [1,] -133.3333 -23.8934
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.