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

Vector library - clean geometry (remove duplicates) More...

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

Go to the source code of this file.


void Vect_remove_duplicates (struct Map_info *Map, int type, struct Map_info *Err)
 Remove duplicate features from vector map. More...
int Vect_line_check_duplicate (const struct line_pnts *APoints, const struct line_pnts *BPoints, int with_z)
 Check for duplicate lines. More...

Detailed Description

Vector library - clean geometry (remove duplicates)

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.

Radim Blazek

Definition in file remove_duplicates.c.

Function Documentation

int Vect_line_check_duplicate ( const struct line_pnts APoints,
const struct line_pnts BPoints,
int  with_z 

Check for duplicate lines.

Note that lines must be pruned with Vect_line_prune() before passed to Vect_line_check_duplicate(), as done by Vect_remove_duplicates()

APointsfirst line geometry
BPointssecond line geometry
1 duplicate
0 not duplicate

Definition at line 214 of file remove_duplicates.c.

References line_pnts::n_points, line_pnts::x, line_pnts::y, and line_pnts::z.

Referenced by Vect_remove_duplicates().

void Vect_remove_duplicates ( struct Map_info Map,
int  type,
struct Map_info Err 

Remove duplicate features from vector map.

Remove duplicate lines of given types from vector map. Duplicate lines may be optionally written to error map. Input map must be opened on level 2 for update. Categories are merged. GV_BUILD_BASE is sufficient.

[in,out]Mapvector map where duplicate lines will be deleted
typetype of line to be delete
[out]Errvector map where duplicate lines will be written or NULL

Definition at line 69 of file remove_duplicates.c.

References _, bound_box::B, line_cats::cat, bound_box::E, line_cats::field, G_debug(), G_percent(), G_verbose_message(), GV_LINES, boxlist::id, bound_box::N, line_cats::n_cats, line_pnts::n_points, boxlist::n_values, bound_box::S, bound_box::T, Vect_cat_set(), Vect_delete_line(), Vect_get_line_nodes(), Vect_get_line_type(), Vect_get_node_line(), Vect_get_node_n_lines(), Vect_get_num_lines(), Vect_is_3d(), Vect_line_alive(), Vect_line_check_duplicate(), Vect_line_prune(), Vect_new_boxlist(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_read_line(), Vect_reset_boxlist(), Vect_rewrite_line(), Vect_select_lines_by_box(), Vect_write_line(), bound_box::W, line_pnts::x, line_pnts::y, and line_pnts::z.