84 if (proj_info !=
NULL) {
89 if (proj_units !=
NULL) {
140 if (proj_epsg !=
NULL) {
189 const char *proj_srid,
const char *proj_wkt)
199 if (proj_srid !=
NULL) {
204 if (proj_wkt !=
NULL) {
237 const char *proj1, *proj2;
239 if (proj_info1 ==
NULL && proj_info2 ==
NULL)
246 if (proj_info1 ==
NULL || proj_info2 ==
NULL)
252 if (proj1 ==
NULL || proj2 ==
NULL || strcmp(proj1, proj2))
259 if (proj_units1 ==
NULL && proj_units2 ==
NULL)
262 if (proj_units1 ==
NULL || proj_units2 ==
NULL)
266 double a1 = 0, a2 = 0;
273 if (a1 && a2 && (fabs(a2 - a1) > 0.000001))
279 const char *u_1 =
NULL, *u_2 =
NULL;
284 if ((u_1 && !u_2) || (!u_1 && u_2))
301 const char *d_1 =
NULL, *d_2 =
NULL;
306 if ((d_1 && !d_2) || (!d_1 && d_2))
309 if (d_1 && d_2 && strcmp(d_1, d_2)) {
312 G_debug(1,
"Different datum names");
320 const char *e_1 =
NULL, *e_2 =
NULL;
325 if (e_1 && e_2 && strcmp(e_1, e_2))
329 double a1 = 0, a2 = 0;
330 double es1 = 0, es2 = 0;
353 if ((a1 == 0 && a2 != 0) || (a1 != 0 && a2 == 0))
356 if (a1 && a2 && (fabs(a2 - a1) > 0.000001))
359 if ((es1 == 0 && es2 != 0) || (es1 != 0 && es2 == 0))
362 if (es1 && es2 && (fabs(es2 - es1) > 0.000001))
370 if (!strcmp(proj1,
"utm") && !strcmp(proj2,
"utm") &&
378 if (!strcmp(proj1,
"utm") && !strcmp(proj2,
"utm") &&
388 const char *x_0_1 =
NULL, *x_0_2 =
NULL;
393 if ((x_0_1 && !x_0_2) || (!x_0_1 && x_0_2))
396 if (x_0_1 && x_0_2 && (fabs(atof(x_0_1) - atof(x_0_2)) > 0.000001))
405 const char *y_0_1 =
NULL, *y_0_2 =
NULL;
410 if ((y_0_1 && !y_0_2) || (!y_0_1 && y_0_2))
413 if (y_0_1 && y_0_2 && (fabs(atof(y_0_1) - atof(y_0_2)) > 0.000001))
422 const char *l_1 =
NULL, *l_2 =
NULL;
427 if ((l_1 && !l_2) || (!l_1 && l_2))
430 if (l_1 && l_2 && (fabs(atof(l_1) - atof(l_2)) > 0.000001))
442 if ((l_1 && !l_2) || (!l_1 && l_2))
445 if (l_1 && l_2 && (fabs(atof(l_1) - atof(l_2)) > 0.000001))
457 if ((l_1 && !l_2) || (!l_1 && l_2))
460 if (l_1 && l_2 && (fabs(atof(l_1) - atof(l_2)) > 0.000001)) {
467 if (fabs(atof(l_1) - atof(l_2)) > 0.000001) {
475 if ((l_1 && !l_2) || (!l_1 && l_2))
478 if (l_1 && l_2 && (fabs(atof(l_1) - atof(l_2)) > 0.000001)) {
485 if (fabs(atof(l_1) - atof(l_2)) > 0.000001) {
521 if (location_name && *location_name)
527 fp = fopen(
path,
"w");
534 n = strlen(wktstring);
535 if (wktstring[n - 1] !=
'\n') {
536 if (n != fprintf(fp,
"%s\n", wktstring))
540 if (n != fprintf(fp,
"%s", wktstring))
573 if (location_name && *location_name)
579 fp = fopen(
path,
"w");
586 n = strlen(sridstring);
587 if (sridstring[n - 1] !=
'\n') {
588 if (n != fprintf(fp,
"%s\n", sridstring))
592 if (n != fprintf(fp,
"%s", sridstring))
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
char * G_file_name(char *, const char *, const char *, const char *)
Builds full path names to GIS data files.
const char * G_gisdbase(void)
Get name of top level database directory.
int G_legal_filename(const char *)
Check for legal database file name.
const char * G_find_key_value(const char *, const struct Key_Value *)
Find given key (case sensitive)
int G_get_ellipsoid_by_name(const char *, double *, double *)
Get ellipsoid parameters by name.
void G_write_key_value_file(const char *, const struct Key_Value *)
Write key/value pairs to file.
int int G_strcasecmp(const char *, const char *)
String compare ignoring case (upper or lower)
int G_put_element_window(const struct Cell_head *, const char *, const char *)
Write the region.
int G_mkdir(const char *)
Creates a new directory.
int G_debug(int, const char *,...) __attribute__((format(printf
void G_setenv_nogisrc(const char *, const char *)
Set environment name to value (doesn't update .gisrc)
int G_make_location_crs(const char *location_name, struct Cell_head *wind, const struct Key_Value *proj_info, const struct Key_Value *proj_units, const char *proj_srid, const char *proj_wkt)
Create a new location.
int G_write_projsrid(const char *location_name, const char *sridstring)
Write srid (spatial reference id) to file.
int G_write_projwkt(const char *location_name, const char *wktstring)
Write WKT definition to file.
int G_compare_projections(const struct Key_Value *proj_info1, const struct Key_Value *proj_units1, const struct Key_Value *proj_info2, const struct Key_Value *proj_units2)
Compare projections including units.
int G_make_location(const char *location_name, struct Cell_head *wind, const struct Key_Value *proj_info, const struct Key_Value *proj_units)
Create a new location.
int G_make_location_epsg(const char *location_name, struct Cell_head *wind, const struct Key_Value *proj_info, const struct Key_Value *proj_units, const struct Key_Value *proj_epsg)
Create a new location.
2D/3D raster map header (used also for region)
SYMBOL * err(FILE *fp, SYMBOL *s, char *msg)