11 struct Cell_head window;
21 "To create a new LOCATION, you will need the following information:\n");
22 fprintf(stderr,
"\n");
23 fprintf(stderr,
"1. The coordinate system for the database\n");
25 fprintf(stderr,
" %s (for imagery and other unreferenced data)\n",
30 fprintf(stderr,
"2. The zone for the %s database\n",
33 " and all the necessary parameters for projections other than\n");
38 "3. The coordinates of the area to become the default region\n");
39 fprintf(stderr,
" and the grid resolution of this region\n");
41 "4. A short, one-line description or title for the location\n");
42 fprintf(stderr,
"\n");
44 if (!
G_yes(
"Do you have all this information? ", 1))
47 G_zero(&window,
sizeof(window));
51 "Please specify the coordinate system for location <%s>\n\n",
57 fprintf(stderr,
"RETURN to cancel\n");
58 fprintf(stderr,
"\n");
59 fprintf(stderr,
"> ");
65 if (sscanf(buf,
"%c", &c) != 1)
98 fprintf(stderr,
"\n");
99 sprintf(buf,
"\n%s coordinate system? ", name);
134 "Please enter a one line description for location <%s>\n\n",
136 fprintf(stderr,
"> ");
140 buf[
sizeof(myname)] = 0;
143 "=====================================================\n");
144 fprintf(stderr,
"%s\n", buf);
146 "=====================================================\n");
147 if (
G_yes(
"ok? ", *buf != 0))
156 mapset =
"PERMANENT";
158 G__setenv(
"LOCATION_NAME", location_name);
160 sprintf(buf,
"%s/%s", gisdbase, location_name);
163 sprintf(buf,
"%s/%s/%s", gisdbase, location_name, mapset);
189 sprintf(buf,
"%s/%s/%s/MYNAME", gisdbase, location_name, mapset);
190 fp = fopen(buf,
"w");
sprintf(buf2,"%s", G3D_CATS_ELEMENT)
int G_mkdir(const char *path)
Creates a new directory.
int G_yes(const char *question, int dflt)
Ask a yes/no question.
int G_zero(void *buf, int i)
Zero out a buffer, buf, of length i.
int G_strip(char *buf)
Removes all leading and trailing white space from string.
char buf[GNAME_MAX+sizeof(G3D_DIRECTORY)+2]
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)
char * G__projection_name(int n)
char * G_squeeze(char *line)
Remove superfluous white space.
int make_location(const char *, const char *)