pe_geog_to_gars

Converts geographic coordinates into GARS strings

Usage syntax

int pe_geog_to_gars(PE_GEOGCS geogcs, int n, double coord[][2], char *gars_str[]);
 

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

The GARS grid system is a method of representing positions with an alphanumeric string. The GARS string is based on latitude-longitude coordinates. The first five characters of a GARS string (3 digits and 2 letters) identify a 30x30 minute cell. The additional two numbers in a GARS string identify a 5x5 minute cell.

Returns

The number of points converted

Examples

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

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

coord[0][PE_COORD_LAM] = -117.0;
coord[0][PE_COORD_PHI] = 35.0;

/* GARS result is 127LL37 */
i = pe_geog_to_gars(gcs, n, coord, gars_string);

pe_geogcs_del(gcs);