4#define POINT_FILE "POINTS"
23 while (
G_getl2(buf,
sizeof buf, fd)) {
25 if (*buf ==
'#' || *buf == 0)
27 if (
sscanf(buf,
"%lf%lf%lf%lf%d", &e1, &n1, &e2, &n2, &status) == 5)
56 double e2,
double n2,
int status)
69 size =
cp->count *
sizeof(
int);
76 cp->status[i] = status;
85 fprintf(fd,
"# %7s %15s %15s %15s %9s status\n",
"",
"image",
"",
"target",
87 fprintf(fd,
"# %15s %15s %15s %15s (1=ok)\n",
"east",
"north",
"east",
90 for (i = 0; i <
cp->count; i++)
91 if (
cp->status[i] >= 0)
92 fprintf(fd,
" %15f %15f %15f %15f %4d\n",
cp->e1[i],
cp->n1[i],
93 cp->e2[i],
cp->n2[i],
cp->status[i]);
118 G_warning(
_(
"Unable to open control point file for group [%s in %s]"),
123 stat = I_read_control_points(fd,
cp);
126 G_warning(
_(
"Bad format in control point file for group [%s in %s]"),
151 G_warning(
_(
"Unable to create control point file for group [%s in %s]"),
156 I_write_control_points(fd,
cp);
int G_getl2(char *, int, FILE *)
Gets a line of text from a file of any pedigree.
void G_warning(const char *,...) __attribute__((format(printf
void G_strip(char *)
Removes all leading and trailing white space from string.
const char * G_mapset(void)
Get current mapset name.
FILE * I_fopen_group_file_old(const char *, const char *)
Open group file for reading.
FILE * I_fopen_group_file_new(const char *, const char *)
int I_get_control_points(const char *group, struct Control_Points *cp)
read group control points
int I_new_control_point(struct Control_Points *cp, double e1, double n1, double e2, double n2, int status)
add new control point
int I_put_control_points(const char *group, const struct Control_Points *cp)
write group control points