snap.c File Reference

#include <stdlib.h>
#include <math.h>
#include <grass/gis.h>
#include <grass/Vect.h>
#include <grass/glocale.h>

Include dependency graph for snap.c:

Go to the source code of this file.

Data Structures

struct  XPNT
struct  NEW

Functions

int add_item (int id, struct ilist *list)
void Vect_snap_lines (struct Map_info *Map, int type, double thresh, struct Map_info *Err, FILE *msgout)
 Snap all lines to existing vertex in threshold.


Function Documentation

int add_item ( int  id,
struct ilist *  list 
)

Definition at line 41 of file snap.c.

References dig_list_add().

Referenced by Vect_snap_lines().

void Vect_snap_lines ( struct Map_info *  Map,
int  type,
double  thresh,
struct Map_info *  Err,
FILE *  msgout 
)

Snap all lines to existing vertex in threshold.

Snap all lines to existing vertices.

Warning: Lines are not necessarily snapped to nearest vertex, but to vertex in threshold!

Lines showing how vertices were snapped may be optionaly written to error map. Input map must be opened on level 2 for update at least on GV_BUILD_BASE.

Parameters:
Map input map where vertices will be snapped
type type of line to be snap
thresh threshold in which snap vertices
Err vector map where lines representing snap are written or NULL
msgout file pointer where messages will be written or NULL
Returns:

Definition at line 82 of file snap.c.

References add_item(), NEW::along, NEW::anchor, XPNT::anchor, Rect::boundary, dig_distance2_point_to_line(), RTreeDestroyNode(), RTreeInsertRect(), RTreeNewIndex(), RTreeSearch(), Vect_append_point(), Vect_delete_line(), Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_get_num_lines(), Vect_line_alive(), Vect_line_prune(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_new_list(), Vect_read_line(), Vect_reset_line(), Vect_reset_list(), Vect_rewrite_line(), XPNT::x, and XPNT::y.


Generated on Sun Apr 6 17:32:53 2008 for GRASS by  doxygen 1.5.5