GRASS GIS 7 Programmer's Manual  7.7.svn(2018)-r73587
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

#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

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 _, fclose(), fd, G_mapset(), G_warning(), I_fopen_group_file_old(), NULL, and POINT_FILE.

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, int, Control_Points::n1, Control_Points::n2, and Control_Points::status.

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 _, fclose(), fd, G_mapset(), G_warning(), I_fopen_group_file_new(), NULL, and POINT_FILE.