GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71933
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

#define CHTYPE_DANGLE   1

Definition at line 21 of file dangles.c.

Referenced by Vect_chtype_dangles().

#define REMOVE_DANGLE   0

Definition at line 20 of file dangles.c.

Referenced by Vect_remove_dangles().

#define SELECT_DANGLE   2

Definition at line 22 of file dangles.c.

Referenced by Vect_select_dangles().

Function Documentation

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 76 of file dangles.c.

References CHTYPE_DANGLE, and NULL.

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 50 of file dangles.c.

References NULL, and REMOVE_DANGLE.

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 101 of file dangles.c.

References NULL, and SELECT_DANGLE.

Referenced by Vedit_select_by_query().