pe_geog_to_georef

Converts geographic coordinates into Georef strings.

Usage syntax

int pe_geog_to_georef(PE_GEOGCS geogcs, int n, double coord[][2], int num_digits, int numeric_rounding, char *georef_str[]);
 

Parameters
geogcs A valid geographic coordinate system object
n Number of points in the coord array
coord Array of points
num_digits The precision of output Georef string
numeric_rounding If TRUE, round the geographic coordinates to the precision value. If FALSE, truncate the geographic coordinates to the precision value.
georef_str A pointer to an array of Georef strings
Description

The Georef grid system is a method of representing positions with an alphanumeric string. The Georef string is based on latitude-longitude coordinates. The first four letters of a Georef string identify a 1x1 degree box. Additional numbers in a Georef string identify smaller areas

Returns

The number of points converted.

Examples
int i,n;
int ndigits, qround;
double coord[N_MAX][2];
char *georef_string[N_MAX];
PE_GEOGCS gcs;

n = 1;
ndigits = 4; /* nearest minute */
qround = 0;  /* truncate */
gcs = pe_factory_geogcs(4326); /* WGS 1984 */

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

/* Georef result is EJDF0000 */
i = pe_geog_to_georef(gcs, n, coord, ndigits, qround, georef_string);

pe_geogcs_del(gcs);