Data Structures | Functions

Vlib/snap.c File Reference

#include <math.h>
#include <grass/gis.h>
#include <grass/Vect.h>
#include <grass/glocale.h>
Include dependency graph for Vlib/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_list (struct Map_info *Map, struct ilist *List_lines, double thresh, struct Map_info *Err)
 Snap selected lines to existing vertex in threshold.
void Vect_snap_lines (struct Map_info *Map, int type, double thresh, struct Map_info *Err)
 Snap lines in vector map to existing vertex in threshold.

Function Documentation

int add_item ( int  id,
struct ilist *  list 
)

Definition at line 44 of file Vlib/snap.c.

References dig_list_add().

Referenced by Vect_snap_lines_list().

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

Snap lines in vector map to existing vertex in threshold.

For details see Vect_snap_lines_list()

Parameters:
[in] Map input map where vertices will be snapped
[in] type type of lines to snap
[in] thresh threshold in which snap vertices
[out] Err vector map where lines representing snap are written or NULL
Returns:
void

Definition at line 417 of file Vlib/snap.c.

References Vect_destroy_list(), Vect_get_num_lines(), Vect_line_alive(), Vect_list_append(), Vect_new_list(), Vect_read_line(), and Vect_snap_lines_list().

void Vect_snap_lines_list ( struct Map_info *  Map,
struct ilist *  List_lines,
double  thresh,
struct Map_info *  Err 
)

Snap selected lines to existing vertex in threshold.

Snap selected 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 optionally written to error map. Input map must be opened on level 2 for update at least on GV_BUILD_BASE.

Parameters:
[in] Map input map where vertices will be snapped
[in] List_lines list of lines to snap
[in] thresh threshold in which snap vertices
[out] Err vector map where lines representing snap are written or NULL
Returns:
void

Definition at line 80 of file Vlib/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_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(), Vect_write_line(), XPNT::x, and XPNT::y.

Referenced by Vect_snap_lines().