pe_gars_to_geog |
Converts GARS strings into geographic coordinates
int pe_gars_to_geog(PE_GEOGCS geogcs, int n, char *gars_str[],
double coord[][2]);
geogcs | A valid geographic coordinate system object |
n | Number of points in the coord array |
gars_str | A pointer to an array of GARS strings |
coord | Array of points |
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.
The number of points converted
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 */
gars_string[0] = "127LL37";
/* result is lon = -117.0, lat = 35.0 */
i = pe_gars_to_geog(gcs, n, gars_string, coord);
pe_geogcs_del(gcs);