GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
points.c File Reference
#include <grass/imagery.h>
#include <grass/glocale.h>
Include dependency graph for points.c:

Go to the source code of this file.

Macros

#define POINT_FILE   "POINTS"
 

Functions

int I_new_control_point (struct Control_Points *cp, double e1, double n1, double e2, double n2, int status)
 add new control point More...
 
int I_get_control_points (const char *group, struct Control_Points *cp)
 read group control points More...
 
int I_put_control_points (const char *group, const struct Control_Points *cp)
 write group control points More...
 

Macro Definition Documentation

◆ POINT_FILE

#define POINT_FILE   "POINTS"

Definition at line 4 of file points.c.

Referenced by I_get_control_points(), and I_put_control_points().

Function Documentation

◆ I_get_control_points()

int I_get_control_points ( const char *  group,
struct Control_Points cp 
)

read group control points

Reads the control points from the POINTS file for the group into the cp structure. Returns 1 if successful; 0 otherwise (and prints a diagnostic error). Note. An error message is printed if the POINTS file is invalid, or does not exist.

Parameters
group
cp
Returns
int

Definition at line 117 of file points.c.

References _, G_mapset(), G_warning(), I_fopen_group_file_old(), NULL, and POINT_FILE.

◆ I_new_control_point()

int I_new_control_point ( struct Control_Points cp,
double  e1,
double  n1,
double  e2,
double  n2,
int  status 
)

add new control point

Once the control points have been read into the cp structure, this routine adds new points to it. The new control point is given by e1 (column) and n1 (row) on the image, and the e2 (east) and n2 (north) for the target database. The value of status should be 1 if the point is a valid point; 0 otherwise.

Remarks
{Use of this routine implies that the point is probably good, so status should be set to 1.}
Parameters
cp
e1
n1
e2
n2
status
Returns
int

Definition at line 57 of file points.c.

References Control_Points::count, Control_Points::e1, Control_Points::e2, G_realloc, Control_Points::n1, Control_Points::n2, and Control_Points::status.

◆ I_put_control_points()

int I_put_control_points ( const char *  group,
const struct Control_Points cp 
)

write group control points

Writes the control points from the cp structure to the POINTS file for the specified group. Note. Points in cp with a negative status are not written to the POINTS file.

Parameters
group
cp
Returns
int

Definition at line 153 of file points.c.

References _, G_mapset(), G_warning(), I_fopen_group_file_new(), NULL, and POINT_FILE.