pe_mgrs_to_geog

Converts MGRS strings into geographic coordinates.

Usage syntax

int pe_mgrs_to_geog(PE_GEOGCS geogcs, int n, char *mgrs_str[], double coord[][2]);
 

Parameters
geogcs A valid geographic coordinate system object
n Number of points in the coord array
mgrs_str A pointer to an array of MGRS strings
coord Array of points
Description

The military grid reference system (MGRS) is a method of representing positions with a alphanumeric string. The MGRS string is based on UTM (universal transverse Mercator) coordinates.

Returns

The number of points converted.

Examples

int i,n;
double coord[N_MAX][2];
char *mgrs_string[N_MAX];
PE_GEOGCS gcs;

n = 1;
gcs = pe_factory_geogcs(4326); /* WGS 1984 */

mgrs_string[0] = "11SNT0000062155";

/* result is lon = -117.0, lat = 33.999991183 */
i = pe_mgrs_to_geog(gcs, n, mgrs_string, coord);

pe_geogcs_del(gcs);