2
\file lib/vector/Vlib/clean_nodes.c
4
4
\brief Vector library - Clean boundaries at nodes
6
6
Higher level functions for reading/writing/manipulating vectors.
8
(C) 2001-2008 by the GRASS Development Team
8
(C) 2001-2009 by the GRASS Development Team
10
This program is free software under the
11
GNU General Public License (>=v2).
12
Read the file COPYING that comes with GRASS
10
This program is free software under the GNU General Public License
11
(>=v2). Read the file COPYING that comes with GRASS for details.
15
13
\author Radim Blazek
20
16
#include <stdlib.h>
21
#include <grass/gis.h>
22
#include <grass/Vect.h>
17
#include <grass/vector.h>
23
18
#include <grass/glocale.h>
26
21
\brief Clean small angles at nodes.
28
It may happen that even if the angle between 2 boundaries at node is
29
very small, the calculated angle is 0 because of
30
representation error. The map must be built at least on level
23
It may happen that even if the angle between 2 boundaries at node
24
is very small, the calculated angle is 0 because of representation
25
error. The map must be built at least on level GV_BUILD_BASE
33
27
\param Map input map
34
\param Err vector map where error line segments are written
28
\param otype feature type
29
\param[out] Err vector map where error line segments are written
36
31
\return number of line modifications
50
45
OCats = Vect_new_cats_struct();
52
47
nnodes = Vect_get_num_nodes(Map);
53
for (node = 1; node <= nnodes; node++) {
48
for (node = 1; node <= Vect_get_num_nodes(Map); node++) {
56
G_percent(node, nnodes, 1);
52
G_percent(node, nnodes, 1);
57
53
G_debug(3, "node = %d", node);
58
54
if (!Vect_node_alive(Map, node))