GetCentroid()

Summary

Gets the centroid location of an area feature.

Syntax

c = GetCentroid(integer area_id)

Argument Contents
area_id The ID of an area feature

Returns

A coordinate indicating the location of the area centroid.

Notes

  • GetCentroid() works only when the current layer is an area layer.

Example

SetLayer("States")
id = RH2ID(LocateRecord("States", "Name", {"Arizona"}))
ctr = GetCentroid(id)
CenterMap(curr_map, ctr)

Error Codes

Error Type Meaning
Error The current layer is of the wrong type
NotFound There is no area with the specified ID in the current layer

See Also

Function Summary
GetArea() Get the coordinates that describe an area feature
GetInternalPoint() Gets a point internal to an area
GetPolygonInternalPoint() Gets a point internal to a polygon