GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
#include <math.h>
#include <stdlib.h>
#include <grass/gis.h>
#include <grass/Vect.h>
#include <grass/glocale.h>
Go to the source code of this file.
Data Structures | |
struct | XPNT |
struct | XSEG |
struct | NEW |
struct | NEW2 |
Functions | |
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. More... | |
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. More... | |
int | Vect_snap_line (struct Map_info *Map, struct ilist *reflist, struct line_pnts *Points, double thresh, int *nsnapped, int *ncreated) |
Snap a line to reference lines in Map with threshold. More... | |
int Vect_snap_line | ( | struct Map_info * | Map, |
struct ilist * | reflist, | ||
struct line_pnts * | Points, | ||
double | thresh, | ||
int * | nsnapped, | ||
int * | ncreated | ||
) |
Snap a line to reference lines in Map with threshold.
The line to snap and the reference lines can but do not need to be in different vector maps.
Vect_snap_line() uses less memory, but is slower than Vect_snap_lines_list()
For details on snapping, see Vect_snap_lines_list()
[in] | Map | input map with reference lines |
[in] | reflist | list of reference lines |
[in,out] | Points | line points to snap |
[in] | thresh | threshold in which to snap vertices |
[in,out] | nsnapped | number of snapped verices |
[in,out] | ncreated | number of new vertices (on segments) |
Definition at line 535 of file Vlib/snap.c.
References NEW2::along, XPNT::anchor, Rect::boundary, dig_distance2_point_to_line(), find_item(), G_debug(), G_free(), NULL, point, RTreeDestroyNode(), RTreeInsertRect(), RTreeNewIndex(), RTreeSearch(), Vect_append_point(), Vect_append_points(), Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_destroy_list(), 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(), NEW2::x, XPNT::x, XSEG::x1, XSEG::x2, xmax, xmin, y, NEW2::y, XPNT::y, XSEG::y1, XSEG::y2, ymax, and ymin.
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()
[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 |
Definition at line 481 of file Vlib/snap.c.
References dig_list_add(), G_debug(), NULL, Vect_destroy_list(), Vect_get_num_lines(), Vect_line_alive(), 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.
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.
[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 |
Definition at line 110 of file Vlib/snap.c.
References NEW::along, XPNT::anchor, NEW::anchor, Rect::boundary, dig_distance2_point_to_line(), G_debug(), G_free(), G_percent(), G_verbose_message(), main::GV_LINES, NULL, point, 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, xmax, xmin, y, XPNT::y, ymax, and ymin.
Referenced by wxdigit.IVDigit::SnapLine(), and Vect_snap_lines().