29 #include <grass/gis.h>
44 struct Cell_head *wind,
45 struct Key_Value *proj_info,
46 struct Key_Value *proj_units, FILE * report_file)
62 G__setenv(
"LOCATION_NAME", location_name);
70 if (proj_info !=
NULL) {
77 if (proj_units !=
NULL) {
123 struct Cell_head *wind,
124 struct Key_Value *proj_info,
125 struct Key_Value *proj_units, FILE * report_file)
136 perror(
"G_make_location");
167 const struct Key_Value *proj_units1,
168 const struct Key_Value *proj_info2,
169 const struct Key_Value *proj_units2)
171 const char *proj1, *proj2;
173 if (proj_info1 ==
NULL && proj_info2 ==
NULL)
180 if (proj_info1 ==
NULL || proj_info2 ==
NULL)
186 if (proj1 ==
NULL || proj2 ==
NULL || strcmp(proj1, proj2))
193 if (proj_units1 ==
NULL && proj_units2 ==
NULL)
196 if (proj_units1 ==
NULL || proj_units2 ==
NULL)
200 double a1 = 0, a2 = 0;
207 if (a1 && a2 && (fabs(a2 - a1) > 0.000001))
217 double a1 = 0, a2 = 0;
224 if (a1 && a2 && (fabs(a2 - a1) > 0.000001))
231 if (!strcmp(proj1,
"utm") && !strcmp(proj2,
"utm")
239 if (!strcmp(proj1,
"utm") && !strcmp(proj2,
"utm")
254 if (x_0_1 && x_0_2 && (fabs(atof(x_0_1) - atof(x_0_2)) > 0.000001))
268 if (y_0_1 && y_0_2 && (fabs(atof(y_0_1) - atof(y_0_2)) > 0.000001))
char * G_find_key_value(const char *key, const struct Key_Value *kv)
Find given key.
sprintf(buf2,"%s", G3D_CATS_ELEMENT)
int G_mkdir(const char *path)
Creates a new directory.
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
int G__make_location(const char *location_name, struct Cell_head *wind, struct Key_Value *proj_info, struct Key_Value *proj_units, FILE *report_file)
char * G__file_name(char *path, const char *element, const char *name, const char *mapset)
Builds full path names to GIS data files.
char * G_gisdbase(void)
Get name of top level database directory.
int G_write_key_value_file(const char *file, const struct Key_Value *kv, int *stat)
Write key/value pairs to file.
int G__setenv(const char *name, const char *value)
Set environment name to value.
int G__put_window(const struct Cell_head *window, char *dir, char *name)
int G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.
int G_make_location(const char *location_name, struct Cell_head *wind, struct Key_Value *proj_info, struct Key_Value *proj_units, FILE *report_file)
create a new location