GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
Vector library - clean geometry (break polygons) More...
#include <stdlib.h>
#include <math.h>
#include <grass/gis.h>
#include <grass/Vect.h>
#include <grass/glocale.h>
Go to the source code of this file.
Data Structures | |
struct | XPNT |
Functions | |
int | srch (int id, int *arg) |
void | Vect_break_polygons (struct Map_info *Map, int type, struct Map_info *Err) |
Break polygons in vector map. More... | |
Vector library - clean geometry (break polygons)
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.
Definition in file break_polygons.c.
Definition at line 66 of file break_polygons.c.
References tools::id.
Referenced by Vect_break_polygons().
void Vect_break_polygons | ( | struct Map_info * | Map, |
int | type, | ||
struct Map_info * | Err | ||
) |
Break polygons in vector map.
Breaks lines specified by type in vector map. Points at intersections may be optionally written to error map. Input map must be opened on level 2 for update at least on GV_BUILD_BASE.
Function is optimized for closed polygons rigs (e.g. imported from OGR) but with clean geometry - adjacent polygons mostly have identical boundary. Function creates database of ALL points in the map, and then is looking for those where polygons should be broken. Lines may be broken only at points existing in input map!
Map | input map where polygons will be broken |
type | type of line to be broken |
Err | vector map where points at intersections will be written or NULL |
Definition at line 91 of file break_polygons.c.
References XPNT::a1, XPNT::a2, Rect::boundary, XPNT::cross, G_debug(), G_free(), G_percent(), G_verbose_message(), main::GV_LINES, NULL, RTreeDestroyNode(), RTreeInsertRect(), RTreeNewIndex(), RTreeSearch(), srch(), XPNT::used, Vect_append_point(), Vect_delete_line(), Vect_get_num_lines(), Vect_line_alive(), Vect_line_prune(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_read_line(), Vect_reset_cats(), Vect_reset_line(), Vect_rewrite_line(), Vect_write_line(), XPNT::x, y, and XPNT::y.