GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
dangles.c File Reference

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

#include <stdlib.h>
#include <grass/gis.h>
#include <grass/Vect.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-2008 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
Date
2001-2008

Definition in file dangles.c.

Macro Definition Documentation

#define CHTYPE_DANGLE   1

Definition at line 26 of file dangles.c.

Referenced by Vect_chtype_dangles().

#define REMOVE_DANGLE   0

Definition at line 25 of file dangles.c.

Referenced by Vect_remove_dangles().

#define SELECT_DANGLE   2

Definition at line 27 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
Errvector map where deleted dangles are written or NULL
Returns

Definition at line 80 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
Errvector map where deleted dangles are written or NULL
Returns

Definition at line 54 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
Returns

Definition at line 104 of file dangles.c.

References NULL, and SELECT_DANGLE.

Referenced by Vedit_select_by_query().