GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71915
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
merge_lines.c File Reference

Vector library - clean geometry (merge lines/boundaries) More...

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

Go to the source code of this file.

Functions

int Vect_merge_lines (struct Map_info *Map, int type, int *new_lines, struct Map_info *Err)
 Merge lines or boundaries in vector map. More...
 

Detailed Description

Vector library - clean geometry (merge lines/boundaries)

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
Markus Metz

Definition in file merge_lines.c.

Function Documentation

int Vect_merge_lines ( struct Map_info Map,
int  type,
int new_lines,
struct Map_info Err 
)

Merge lines or boundaries in vector map.

Merges lines specified by type in vector map. Useful for generalization and smoothing. Adjacent boundaries are merged as long as topology is maintained. Adjacent lines are merged as long as there are exactly two different lines with identical categories connected at a given node. Zero-length lines need to be removed first. GV_BUILD_BASE as topo build level is sufficient, areas need not be built.

Parameters
Mapinput vector map
typefeature type
[out]Errvector map where merged lines/boundaries will be written or NULL
new_linespointer to where number of new lines/boundaries is stored or NULL
Returns
number of merged lines/boundaries

Definition at line 78 of file merge_lines.c.

References _, G_debug(), G_ilist_add(), G_percent(), G_verbose_message(), G_warning(), GV_BACKWARD, GV_FORWARD, GV_LINES, Plus_head::Line, line_pnts::n_points, ilist::n_values, NULL, Map_info::plus, P_line::type, ilist::value, Vect_append_points(), Vect_delete_line(), Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_destroy_list(), Vect_get_line_nodes(), Vect_get_node_line(), Vect_get_node_n_lines(), Vect_get_num_lines(), Vect_line_alive(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_new_list(), Vect_read_line(), Vect_reset_line(), Vect_reset_list(), and Vect_write_line().