User Tools

Site Tools


api:dk11:delphi:gislayervector.tgis_shape.centroid_void

Table of Contents



TGIS_Shape.Centroid method

DK for Delphi | GisLayerVector.TGIS_Shape.Centroid | Constructors | Fields | Methods | Properties

Calculates the geometric centroid of the shape.

Available also on: .NET | Java | ActiveX | Python.

Syntax

// Delphi
public
  function Centroid : TGIS_Point; virtual;
// C++ Builder
public:
  virtual TGIS_Point* Centroid(void);

Result

Type Description
TGIS_Point Centroid point in the shape's coordinate system. For polygons, the centroid may lie outside the shape.

Remarks

PURPOSE: Compute the geometric center of a vector shape for labeling, symbol placement, spatial analysis, or feature summarization.

BEHAVIOR: For polygon shapes, returns the area-weighted centroid. For line shapes, returns a line-based center point. For point shapes, returns the point itself.

CONSTRAINTS: The centroid is a geometric result and is not guaranteed to lie inside the shape, especially for concave polygons or multipart geometries.

References

2026/07/11 00:38

Page Tools