Skip to contents

g_centroid() returns a vector of point X, point Y.

Usage

g_centroid(wkt)

Arguments

wkt

Character. OGC WKT string for a simple feature geometry.

Value

Numeric vector of length 2 containing the centroid (X, Y).

Details

The GDAL documentation states "This method relates to the SFCOM ISurface::get_Centroid() method however the current implementation based on GEOS can operate on other geometry types such as multipoint, linestring, geometrycollection such as multipolygons. OGC SF SQL 1.1 defines the operation for surfaces (polygons). SQL/MM-Part 3 defines the operation for surfaces and multisurfaces (multipolygons)."