write.c File Reference

Vector library - write vector features. More...

#include <grass/gis.h>
#include <grass/glocale.h>
#include <grass/Vect.h>
Include dependency graph for write.c:

Go to the source code of this file.

Functions

long Vect_write_line (struct Map_info *Map, int type, struct line_pnts *points, struct line_cats *cats)
 Writes new feature to the end of file (table).
int Vect_rewrite_line (struct Map_info *Map, int line, int type, struct line_pnts *points, struct line_cats *cats)
 Rewrites feature info at the given offset.
int Vect_delete_line (struct Map_info *Map, int line)
 Delete feature.
int Vect_restore_line (struct Map_info *Map, int line, long offset)
 Restore previously deleted feature.

Detailed Description

Vector library - write vector features.

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.

Author:
Radim Blazek
Date:
2001

Definition in file write.c.


Function Documentation

int Vect_delete_line ( struct Map_info *  Map,
int  line 
)

Delete feature.

Vector map must be opened on topo level 2.

This function calls G_fatal_error() on error.

Parameters:
Map pointer to vector map
line feature id
Returns:
0 on success
-1 on error

Definition at line 212 of file write.c.

References dig_line_reset_updated(), and dig_node_reset_updated().

Referenced by Vect_break_lines_list(), Vect_break_polygons(), Vect_clean_small_angles_at_nodes(), Vect_remove_duplicates(), Vect_remove_small_areas(), Vect_snap_lines_list(), Vedit_bulk_labeling(), Vedit_delete_lines(), and Vedit_merge_lines().

int Vect_restore_line ( struct Map_info *  Map,
int  line,
long  offset 
)

Restore previously deleted feature.

Vector map must be opened on topo level 2.

This function calls G_fatal_error() on error.

Parameters:
Map pointer to vector map
line feature id to be deleted
Returns:
0 on success
-1 on error

Definition at line 258 of file write.c.

References dig_line_reset_updated(), and dig_node_reset_updated().

int Vect_rewrite_line ( struct Map_info *  Map,
int  line,
int  type,
struct line_pnts *  points,
struct line_cats *  cats 
)

Rewrites feature info at the given offset.

The number of points or cats or type may change. If necessary, the old feature is deleted and new is written.

This function calls G_fatal_error() on error.

Parameters:
Map pointer to vector map
line feature id
type feature type
points feature geometry
cats feature categories
Returns:
new feature id
-1 on error

Definition at line 172 of file write.c.

References dig_line_reset_updated(), and dig_node_reset_updated().

Referenced by Vect_break_polygons(), Vect_clean_small_angles_at_nodes(), Vect_remove_duplicates(), Vect_snap_lines_list(), Vedit_add_vertex(), Vedit_bulk_labeling(), Vedit_chtype_lines(), Vedit_flip_lines(), Vedit_merge_lines(), Vedit_modify_cats(), Vedit_move_lines(), Vedit_move_vertex(), Vedit_remove_vertex(), Vedit_snap_lines(), and Vedit_split_lines().

long Vect_write_line ( struct Map_info *  Map,
int  type,
struct line_pnts *  points,
struct line_cats *  cats 
)

Writes new feature to the end of file (table).

The function calls G_fatal_error() on error.

Parameters:
Map pointer to vector map
type feature type
points feature geometry
cats feature categories
Returns:
offset into file where the feature starts

Definition at line 126 of file write.c.

References dig_line_reset_updated(), and dig_node_reset_updated().

Referenced by Vect_break_lines_list(), Vect_break_polygons(), Vect_clean_small_angles_at_nodes(), Vect_copy_map_lines(), Vect_overlay_and(), Vect_remove_duplicates(), Vect_remove_small_areas(), Vect_snap_lines_list(), Vedit_bulk_labeling(), Vedit_copy_lines(), and Vedit_split_lines().

Generated on Tue Apr 6 13:28:21 2010 for GRASS Programmer's Manual by  doxygen 1.6.3