GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-d6dec75dd4
dangles.c File Reference

Vector library - clean geometry (dangles) More...

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

Go to the source code of this file.

Macros

#define REMOVE_DANGLE   0
 
#define CHTYPE_DANGLE   1
 
#define SELECT_DANGLE   2
 

Functions

void Vect_remove_dangles (struct Map_info *Map, int type, double maxlength, struct Map_info *Err)
 Remove dangles from vector map. More...
 
void Vect_chtype_dangles (struct Map_info *Map, double maxlength, struct Map_info *Err)
 Change boundary dangles to lines. More...
 
void Vect_select_dangles (struct Map_info *Map, int type, double maxlength, struct ilist *List)
 Select dangles from vector map. More...
 

Detailed Description

Vector library - clean geometry (dangles)

Higher level functions for reading/writing/manipulating vectors.

(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 dangles.c.

Macro Definition Documentation

◆ CHTYPE_DANGLE

#define CHTYPE_DANGLE   1

Definition at line 21 of file dangles.c.

◆ REMOVE_DANGLE

#define REMOVE_DANGLE   0

Definition at line 20 of file dangles.c.

◆ SELECT_DANGLE

#define SELECT_DANGLE   2

Definition at line 22 of file dangles.c.

Function Documentation

◆ Vect_chtype_dangles()

void Vect_chtype_dangles ( struct Map_info Map,
double  maxlength,
struct Map_info Err 
)

Change boundary dangles to lines.

Change boundary dangles to lines.

Boundary is considered to be a dangle if on at least one end node is no other boundary. If a dangle is formed by more boundaries, such string of boundaries is taken as one dangle.

Optionally deleted dangles are written to error map.

Input map must be opened on level 2 for update at least on GV_BUILD_BASE.

Parameters
Mapinput map where have to be deleted
maxlengthmaxlength of dangles or -1 for all dangles
[out]Errvector map where deleted dangles are written or NULL
Returns

Definition at line 74 of file dangles.c.

◆ Vect_remove_dangles()

void Vect_remove_dangles ( struct Map_info Map,
int  type,
double  maxlength,
struct Map_info Err 
)

Remove dangles from vector map.

Remove dangles of given type shorter than maxlength from vector map.

Line is considered to be a dangle if on at least one end node is no other line of given type(s). If a dangle is formed by more lines, such string of lines is taken as one dangle and either deleted are all parts or nothing.

Optionally deleted dangles are written to error map.

Input map must be opened on level 2 for update.

Parameters
Mapinput map where have to be deleted
typetype of dangles (GV_LINES, GV_LINE or GV_BOUNDARY)
maxlengthmaxlength of dangles or -1 for all dangles
[out]Errvector map where deleted dangles are written or NULL
Returns

Definition at line 49 of file dangles.c.

◆ Vect_select_dangles()

void Vect_select_dangles ( struct Map_info Map,
int  type,
double  maxlength,
struct ilist List 
)

Select dangles from vector map.

Remove dangles of given type shorter than maxlength from vector map.

Line is considered to be a dangle if on at least one end node is no other line of given type(s). If a dangle is formed by more lines, such string of lines is taken as one dangle.

Input map must be opened on level 2 for update.

Parameters
Mapinput map where have to be deleted
typetype of dangles (GV_LINES, GV_LINE or GV_BOUNDARY)
maxlengthmaxlength of dangles or -1 for all dangles
[out]Listlist of selected features
Returns

Definition at line 98 of file dangles.c.