VERIFIED SOLUTION i

Resolve issue where feature coordinates are not correct when issued with a MapBasic script

MapBasic®
 

Issue

When updating a table with coordinates using a MapBasic® script the used projection by default is Long/Lat WGS84.  This happens even when the table is using a different projection.

Cause

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. 

 

Resolution

UPDATED: September 7, 2017
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. 

Example: New Zealand Transverse Mercator (NZGD2000), EPSG 2193

Set CoordSys Earth Projection 8, 117, "m", 173, 0, 0.9996, 1600000, 10000000

Note: You can easily find the right Coordsys parameters if you export a table to MID/MIF and then open the MIF file with a text editor.