CoordSysStringToEPSG() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Converts a MapBasic Coordinate System clause into an EPSG integer value for use with any MapBasic function or statement. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

CoordSysStringToEPSG ( coordsys_string )

coordsys_string is a MapBasic CoordSys clause. EPSG (European Petroleum Survey Group) value is an integer value; for example, CoordSys Clause of "Earth Projection 1, 104" will return an EPSG code of 4326. For a complete list of EPSG codes used with MapInfo Pro see the MAPINFOW.PRJ file in your MapInfo Pro installation. The EPSG codes are identified by a "\p" followed by a number.

Return Value

Integer. If no EPSG value is found, it returns -1.

Description

The CoordSysStringToEPSG() function is used to convert a MapBasic CoordSys clause into an integer EPSG value.

Example

The following example displays EPSG code Earth Projection 1, 104 Coordinate System.

print CoordSysStringToEPSG("Earth Projection 1, 104")

See Also:

CoordSys clause