15.10 - TO_MGRS - Teradata Database

Teradata Database SQL Geospatial Types

Teradata Database
Programming Reference

DR 137991

Converts an ST_GEOMETRY point object to a coordinate in the Military Grid Reference System (MGRS).

Note: This function was developed using GEOTRANS, a product of the National Geospatial-Intelligence Agency (NGA) and U.S. Army Engineering Research and Development Center.


Argument …

Specifies …


an ST_POINT type object.


the WKT representation of the source spatial reference system. The supported coordinate systems are UTM, UPS, and Geodetic.


the degree of precision of the resulting MGRS coordinate string. The value should be an integer in the range of 0 through 5, where 0 represents 100,000 meter precision, and 5 represents 1 meter precision.

For details on the rules for argument data types, see the introduction to this chapter.

Returns a VARCHAR(20), LATIN character set MGRS coordinate string with the specified precision.

Teradata Database follows the MGRS convention of truncating, rather than rounding values during the conversion. The net effect of the truncation is to shift points to the south and west (the lowest point in each rectangle).

Inset owner: Gary Zimmerman
Inset SME: William Brode
11/14/12: initial draft

MGRS coordinates employ one of two lettering schemes to denote row identifiers in the grid system: MGRS-Old or MGRS-New. During conversions to and from MGRS, the MGRS lettering scheme in the returned coordinates (for the TO_MGRS function) or expected as input (to the FROM_MGRS function) depends on the spatial reference system from or to which the coordinates are being converted. If the spatial reference system is based on the Bessel, Clarke 1866, or Clarke 1880 reference ellipsoid, the MGRS coordinates use the MGRS-Old lettering scheme. Conversion to or from all other spatial reference systems use the MGRS-New scheme.

This example converts Geodetic coordinates in the “WGS 84” spatial reference system to MGRS.

  new ST_GEOMETRY('ST_POINT', 30, 45),
  (select SRTEXT from sysspatial.spatial_ref_sys where srid = 1619),


TO_MGRS(NEW ST_GEOMETRY('ST_POINT', 30, 45),<Scalar Subquery>,5 )