Purpose
Sets the coordinate system used by MapBasic. You can issue this statement from the MapBasic window in MapInfo Pro.
Syntax
Set CoordSys...
CoordSys... is a coordinate system clause.
Description
The Set CoordSys statement sets MapBasic's coordinate system. By default, MapBasic uses a Longitude/Latitude coordinate system. This means that when geographic functions (such as the CentroidX() function and the ObjectNodeX() function) return x- or y-coordinate values, the values represent longitude or latitude degree measurements by default. A MapBasic program can issue a Set CoordSys statement to specify a different coordinate system; thereafter, values returned by geographic functions will automatically reflect the new coordinate system.
The Set CoordSys statement does not affect a Map window. To set a Map window's projection or coordinate system, you must issue a Set Map...CoordSys statement.
The CoordSys clause has optional Table and Window sub-clauses that allow you to reference the coordinate system of an existing table or window. See CoordSys clause for more information.
Example
The following Set CoordSys statement would set the coordinate system to an un-projected, Earth-based system.
Set CoordSys Earth
The next Set CoordSys statement would set the coordinate system to an Albers equal-area projection.
Set CoordSys Earth
Projection 9,7,"m",-96.0,23.0,20.0, 60.0, 0.0, 0.0
The Set CoordSys statement below prepares MapBasic to work with objects from a Layout window. You must use a Layout coordinate system before querying or creating Layout objects.
Set CoordSys Layout Units "in"
See Also:
CoordSys clause, Set Area Units statement, Set Distance Units statement, Set Paper Units statement