GRASS GIS 8 Programmer's Manual  8.4.0dev(2024)-dcc4425b9d
break_polygons.c File Reference

Vector library - clean geometry (break polygons) More...

#include <stdlib.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <math.h>
#include <errno.h>
#include <grass/vector.h>
#include <grass/glocale.h>
Include dependency graph for break_polygons.c:

Go to the source code of this file.

Functions

void Vect_break_polygons_file (struct Map_info *Map, int type, struct Map_info *Err)
 
void Vect_break_polygons_mem (struct Map_info *Map, int type, struct Map_info *Err)
 
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-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
Radim Blazek
Update for GRASS 7 Markus Metz

Definition in file break_polygons.c.

Function Documentation

◆ 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 vector map must be opened on level 2 for update at least on GV_BUILD_BASE.

Function is optimized for closed polygons rings (e.g. imported from OGR) but with clean geometry - adjacent polygons mostly have identical boundary. Function creates database of ALL points in the vector map, and then is looking for those where polygons should be broken. Lines may be broken only at points existing in input vector map!

Parameters
Mapinput map where polygons will be broken
typetype of line to be broken (GV_LINE or GV_BOUNDARY)
Errvector map where points at intersections will be written or NULL

Definition at line 675 of file break_polygons.c.

◆ Vect_break_polygons_file()

void Vect_break_polygons_file ( struct Map_info Map,
int  type,
struct Map_info Err 
)

Definition at line 106 of file break_polygons.c.

◆ Vect_break_polygons_mem()

void Vect_break_polygons_mem ( struct Map_info Map,
int  type,
struct Map_info Err 
)

Definition at line 413 of file break_polygons.c.