GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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, POINT_FILE, and stat.

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 int, and tools::size.

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.