break_polygons.c File Reference

#include <stdlib.h>
#include <math.h>
#include <grass/gis.h>
#include <grass/Vect.h>

Include dependency graph for break_polygons.c:

Go to the source code of this file.

Data Structures

struct  XPNT

Functions

void srch (int id, int *arg)
void Vect_break_polygons (struct Map_info *Map, int type, struct Map_info *Err, FILE *msgout)
 Break polygons in vector map.


Function Documentation

void srch ( int  id,
int *  arg 
)

Definition at line 33 of file break_polygons.c.

Referenced by Vect_break_polygons().

void Vect_break_polygons ( struct Map_info *  Map,
int  type,
struct Map_info *  Err,
FILE *  msgout 
)

Break polygons in vector map.

Breaks lines specified by type in vector map. Points at intersections may be optionaly 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!

Parameters:
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
msgout file pointer where messages will be written or NULL
Returns:

Definition at line 57 of file break_polygons.c.

References XPNT::a1, XPNT::a2, Rect::boundary, XPNT::cross, 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, and XPNT::y.


Generated on Sun Apr 6 17:32:45 2008 for GRASS by  doxygen 1.5.5