Learn R Programming

gdalraster (version 1.11.1)

g_centroid: Compute the centroid of a geometry

Description

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

Usage

g_centroid(wkt)

Value

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

Arguments

wkt

Character. OGC WKT string for a simple feature geometry.

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)."