Purpose
Returns the y-coordinate of the centroid of an object. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
CentroidY( obj_expr )
obj_expr is an object expression.
Return Value
Float
Description
The CentroidY() function returns the Y-coordinate (e.g., latitude) component of the centroid of the specified object. See the Centroid() function for a discussion of what the concept of a centroid position means, with respect to different types of graphical objects (lines vs. regions, etc.).
The coordinate information is returned in MapBasic's current coordinate system; by default, MapBasic uses a Longitude/Latitude coordinate system. The Set CoordSys statement allows you to change the coordinate system used.
Example
Dim y As Float
Open Table "world"
Fetch First From world
y = CentroidY(world.obj)
See Also:
Centroid() function, CentroidX() function, Set CoordSys statement