GRASS GIS 7 Programmer's Manual
7.8.4(2020)-exported
|
Go to the documentation of this file.
17 #include <grass/gis.h>
52 struct Cell_head *wind,
53 const struct Key_Value *proj_info,
54 const struct Key_Value *proj_units)
68 sprintf(
path,
"%s/%s/%s",
G_gisdbase(), location_name,
"PERMANENT");
82 if (proj_info !=
NULL) {
87 if (proj_units !=
NULL) {
126 struct Cell_head *wind,
127 const struct Key_Value *proj_info,
128 const struct Key_Value *proj_units,
129 const struct Key_Value *proj_epsg)
132 char path[GPATH_MAX];
140 if (proj_epsg !=
NULL) {
170 const struct Key_Value *proj_units1,
171 const struct Key_Value *proj_info2,
172 const struct Key_Value *proj_units2)
174 const char *proj1, *proj2;
176 if (proj_info1 ==
NULL && proj_info2 ==
NULL)
183 if (proj_info1 ==
NULL || proj_info2 ==
NULL)
189 if (proj1 ==
NULL || proj2 ==
NULL || strcmp(proj1, proj2))
196 if (proj_units1 ==
NULL && proj_units2 ==
NULL)
199 if (proj_units1 ==
NULL || proj_units2 ==
NULL)
203 double a1 = 0, a2 = 0;
210 if (a1 && a2 && (fabs(a2 - a1) > 0.000001))
216 const char *u_1 =
NULL, *u_2 =
NULL;
221 if ((u_1 && !u_2) || (!u_1 && u_2))
238 const char *d_1 =
NULL, *d_2 =
NULL;
243 if ((d_1 && !d_2) || (!d_1 && d_2))
246 if (d_1 && d_2 && strcmp(d_1, d_2)) {
249 G_debug(1,
"Different datum names");
257 const char *e_1 =
NULL, *e_2 =
NULL;
262 if (e_1 && e_2 && strcmp(e_1, e_2))
266 double a1 = 0, a2 = 0;
267 double es1 = 0, es2 = 0;
290 if ((a1 == 0 && a2 != 0) || (a1 != 0 && a2 == 0))
293 if (a1 && a2 && (fabs(a2 - a1) > 0.000001))
296 if ((es1 == 0 && es2 != 0) || (es1 != 0 && es2 == 0))
299 if (es1 && es2 && (fabs(es2 - es1) > 0.000001))
307 if (!strcmp(proj1,
"utm") && !strcmp(proj2,
"utm")
315 if (!strcmp(proj1,
"utm") && !strcmp(proj2,
"utm")
325 const char *x_0_1 =
NULL, *x_0_2 =
NULL;
330 if ((x_0_1 && !x_0_2) || (!x_0_1 && x_0_2))
333 if (x_0_1 && x_0_2 && (fabs(atof(x_0_1) - atof(x_0_2)) > 0.000001))
342 const char *y_0_1 =
NULL, *y_0_2 =
NULL;
347 if ((y_0_1 && !y_0_2) || (!y_0_1 && y_0_2))
350 if (y_0_1 && y_0_2 && (fabs(atof(y_0_1) - atof(y_0_2)) > 0.000001))
359 const char *l_1 =
NULL, *l_2 =
NULL;
364 if ((l_1 && !l_2) || (!l_1 && l_2))
367 if (l_1 && l_2 && (fabs(atof(l_1) - atof(l_2)) > 0.000001))
378 if ((l_1 && !l_2) || (!l_1 && l_2))
381 if (l_1 && l_2 && (fabs(atof(l_1) - atof(l_2)) > 0.000001))
392 if ((l_1 && !l_2) || (!l_1 && l_2))
395 if (l_1 && l_2 && (fabs(atof(l_1) - atof(l_2)) > 0.000001)) {
402 if (l_1 && l_2 && (fabs(atof(l_1) - atof(l_2)) > 0.000001)) {
411 if ((l_1 && !l_2) || (!l_1 && l_2))
414 if (l_1 && l_2 && (fabs(atof(l_1) - atof(l_2)) > 0.000001)) {
421 if (l_1 && l_2 && (fabs(atof(l_1) - atof(l_2)) > 0.000001)) {
const char * G_find_key_value(const char *key, const struct Key_Value *kv)
Find given key (case sensitive)
int G_strcasecmp(const char *x, const char *y)
String compare ignoring case (upper or lower)
const char * G_gisdbase(void)
Get name of top level database directory.
int G_get_ellipsoid_by_name(const char *name, double *a, double *e2)
Get ellipsoid parameters by name.
int G_mkdir(const char *path)
Creates a new directory.
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_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.
char * G_file_name(char *path, const char *element, const char *name, const char *mapset)
Builds full path names to GIS data files.
void G_setenv_nogisrc(const char *name, const char *value)
Set environment name to value (doesn't update .gisrc)
void G_write_key_value_file(const char *file, const struct Key_Value *kv)
Write key/value pairs to file.
int G_legal_filename(const char *s)
Check for legal database file name.
int G_debug(int level, const char *msg,...)
Print debugging message.
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.
int G_put_element_window(const struct Cell_head *window, const char *dir, const char *name)
Write the region.