GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
break_lines.c File Reference

Vector library - Clean vector map (break lines) More...

#include <stdlib.h>
#include <grass/vector.h>
#include <grass/glocale.h>
Include dependency graph for break_lines.c:

Go to the source code of this file.

Functions

void Vect_break_lines (struct Map_info *Map, int type, struct Map_info *Err)
 Break lines in vector map at each intersection. More...
 
int Vect_break_lines_list (struct Map_info *Map, struct ilist *List_break, struct ilist *List_ref, int type, struct Map_info *Err)
 Break selected lines in vector map at each intersection. More...
 
int Vect_check_line_breaks (struct Map_info *Map, int type, struct Map_info *Err)
 Check for and count intersecting lines, do not break. More...
 
int Vect_check_line_breaks_list (struct Map_info *Map, struct ilist *List_break, struct ilist *List_ref, int type, struct Map_info *Err)
 Check for and count intersecting lines, do not break. More...
 

Detailed Description

Vector library - Clean vector map (break lines)

(C) 2001-2009 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
Radim Blazek

Definition in file break_lines.c.

Function Documentation

◆ Vect_break_lines()

void Vect_break_lines ( struct Map_info Map,
int  type,
struct Map_info Err 
)

Break lines in vector map at each intersection.

For details see Vect_break_lines_list().

Parameters
Mapinput vector map
typefeature type
[out]Errvector map where points at intersections will be written or NULL

Definition at line 33 of file break_lines.c.

◆ Vect_break_lines_list()

int Vect_break_lines_list ( struct Map_info Map,
struct ilist List_break,
struct ilist List_ref,
int  type,
struct Map_info Err 
)

Break selected lines in vector map at each intersection.

Breaks selected lines specified by type in vector map. Points at intersections may be optionally written to error map. Input vector map must be opened on level 2 for update at least on GV_BUILD_BASE.

The function also breaks lines forming collapsed loop, for example 0,0;1,0;0,0 is broken at 1,0.

If reference lines are given (List_ref) break only lines which intersect reference lines.

Parameters
Mapinput vector map
List_breaklist of lines (NULL for all lines in vector map)
List_reflist of reference lines or NULL
typefeature type
[out]Errvector map where points at intersections will be written or NULL
Returns
number of intersections

Definition at line 62 of file break_lines.c.

◆ Vect_check_line_breaks()

int Vect_check_line_breaks ( struct Map_info Map,
int  type,
struct Map_info Err 
)

Check for and count intersecting lines, do not break.

For details see Vect_check_line_breaks_list().

Parameters
Mapinput vector map
typefeature type
[out]Errvector map where points at intersections will be written or NULL
Returns
number for intersections

Definition at line 80 of file break_lines.c.

◆ Vect_check_line_breaks_list()

int Vect_check_line_breaks_list ( struct Map_info Map,
struct ilist List_break,
struct ilist List_ref,
int  type,
struct Map_info Err 
)

Check for and count intersecting lines, do not break.

If List_break is given, only lines in the list are checked for intersections.

If reference lines are given (List_ref) break only lines which intersect reference lines.

Parameters
Mapinput vector map
List_breaklist of lines (NULL for all lines in vector map)
List_reflist of reference lines or NULL
typefeature type
[out]Errvector map where points at intersections will be written or NULL
Returns
number of intersections

Definition at line 102 of file break_lines.c.