GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71933
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
extend.c File Reference

Vedit library - extend lines (adopted from break.c) More...

#include <math.h>
#include <grass/vedit.h>
Include dependency graph for extend.c:

Go to the source code of this file.


#define TOL   1e-9


int Vedit_extend_lines (struct Map_info *Map, struct ilist *List, int nodes, int parallel, double thresh)
 Extend lines in given threshold. More...

Detailed Description

Vedit library - extend lines (adopted from break.c)

(C) 2017 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Huidae Cho <grass4u>

Definition in file extend.c.

Macro Definition Documentation

#define TOL   1e-9

Definition at line 17 of file extend.c.

Function Documentation

int Vedit_extend_lines ( struct Map_info Map,
struct ilist List,
int  nodes,
int  parallel,
double  thresh 

Extend lines in given threshold.

1. Extend first line only
\ \
id1 \ -> \
id2 ---------- -----+----
2. Extend both lines
\ \
id1 \ -> \
id2 --- +----
3. Extend first line when both are on the same line
id1 --- --- id2 -> -----+----
4. Connect two parallel lines (parallel=1)
id1 ------ -------
-> /
id2 ------ +-----
5. Don't connect two parallel lines (parallel=0)
id1 ------ ------
id2 ------ ------
Mappointer to Map_info
Listlist of selected lines
nodes1 for start node, 2 for end node, other for both
parallelconnect parallel lines
threshthreshold value
number of modified lines

Definition at line 68 of file extend.c.

References G_debug(), GV_LINES, GV_POINTS, ilist::n_values, ilist::value, Vect_destroy_list(), Vect_find_line_list(), Vect_get_line_nodes(), Vect_get_line_type(), Vect_get_node_coor(), Vect_line_alive(), Vect_list_append(), Vect_new_list(), Vect_reset_list(), WITHOUT_Z, and x.