GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
vector/Vlib/write.c File Reference
#include <grass/gis.h>
#include <grass/glocale.h>
#include <grass/Vect.h>
Include dependency graph for vector/Vlib/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) More...
 
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. More...
 
int Vect_delete_line (struct Map_info *Map, int line)
 Delete feature. More...
 
int Vect_restore_line (struct Map_info *Map, int line, long offset)
 Restore previously deleted feature. More...
 

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
Mappointer to vector map
linefeature id
Returns
0 on success
-1 on error

Definition at line 212 of file vector/Vlib/write.c.

References dig_line_reset_updated(), dig_node_reset_updated(), G_debug(), and G_fatal_error().

Referenced by wxdigit.IVDigit::OpenBackgroundMap(), Vect_break_lines_list(), Vect_break_polygons(), Vect_clean_small_angles_at_nodes(), Vect_merge_lines(), 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
Mappointer to vector map
linefeature id to be deleted
Returns
0 on success
-1 on error

Definition at line 258 of file vector/Vlib/write.c.

References dig_line_reset_updated(), dig_node_reset_updated(), G_debug(), and G_fatal_error().

Referenced by wxdigit.IVDigit::OpenBackgroundMap().

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
Mappointer to vector map
linefeature id
typefeature type
pointsfeature geometry
catsfeature categories
Returns
new feature id
-1 on error

Definition at line 172 of file vector/Vlib/write.c.

References dig_line_reset_updated(), dig_node_reset_updated(), G_debug(), and G_fatal_error().

Referenced by wxdigit.IVDigit::CopyCats(), wxdigit.IVDigit::EditLine(), wxdigit.IVDigit::SetLineCats(), 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
Mappointer to vector map
typefeature type
pointsfeature geometry
catsfeature categories
Returns
offset into file where the feature starts

Definition at line 126 of file vector/Vlib/write.c.

References dig_line_reset_updated(), dig_node_reset_updated(), G_debug(), and G_fatal_error().

Referenced by G_site_put(), IL_check_at_points_2d(), wxdigit.IVDigit::InitCats(), NetA_add_point_on_node(), Vect_break_lines_list(), Vect_break_polygons(), Vect_clean_small_angles_at_nodes(), Vect_copy_map_lines(), Vect_merge_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().