GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
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.

Macros

#define TOL   1e-9
 

Functions

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.

Author
Huidae Cho <grass4u gmail.com>

Definition in file extend.c.

Macro Definition Documentation

◆ TOL

#define TOL   1e-9

Definition at line 17 of file extend.c.

Function Documentation

◆ Vedit_extend_lines()

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 ------ ------
Parameters
Mappointer to Map_info
Listlist of selected lines
nodes1 for start node, 2 for end node, other for both
parallelconnect parallel lines
threshthreshold value
Returns
number of modified lines

Definition at line 68 of file extend.c.

References ilist::n_values, and Vect_new_list().