pe_mgrs_to_geog_extended

Converts MGRS strings into geographic coordinates.

Usage syntax

int pe_mgrs_to_geog_extended(PE_GEOGCS geogcs, int n, char *mgrs_str[], int mode, 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
mode Determines whether certain spheroids are treated differently.
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. The mode determines whether for certain spheroids, one of the alphabetical values is changed. The mode values are:

0 Automatic
1 All spheroids are treated the same as WGS84
2 All spheroids are treated the same as Clarke 1866 or Bessel

Returns

The number of points converted.

Examples

int i,n, mode;
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] = "11SNH0000062155";

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

pe_geogcs_del(gcs);