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

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>
Include dependency graph for break_polygons.c:

Go to the source code of this file.

Data Structures

struct  XPNT


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...

Detailed Description

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.

Radim Blazek

Definition in file break_polygons.c.

Function Documentation

int srch ( int  id,
int arg 

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!

Mapinput map where polygons will be broken
typetype of line to be broken
Errvector 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.