Centroid

Description

The vec:Centroid process takes a feature collection and returns a point feature collection containing the centroids of the geometries of the input features. Feature attributes names and values remain unchanged.

The centroid of a geometry is defined for all geometry types (Point, Line and Polygon). It is equal to the geometric center of all points contained in the geometry.

Note

The centroid point does not necessarily lie within the geometry, for example the centroid of a C-shaped polygon lies outside the polygon.

../../../_images/centroid.png

vec:Centroid

Centroids can provide a representative point for features. Typical use cases include distance analysis and label placement.

Inputs and outputs

vec:Centroid accepts Feature collection inputs and returns Feature collection outputs.

Inputs

Name Description Type Usage
features Input features FeatureCollection Required

Outputs

Name Description Type
result Centroids of input features FeatureCollection

Usage notes

  • If a feature collection consisting of point geometries is supplied, the output will be identical to the input.

Examples

Finding the centroids of the polygons in the medford:zoning layer:

  • features: medford:zoning
../../../_images/centroid-med.png

Centroids of medford:zoning polygons