GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
Vector library - write vector feature (native format) More...
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <grass/gis.h>
#include <grass/Vect.h>
#include <grass/glocale.h>
Go to the source code of this file.
Functions | |
long | V1__rewrite_line_nat (struct Map_info *Map, long offset, int type, struct line_pnts *points, struct line_cats *cats) |
Rewrites feature at the given offset. More... | |
long | V1_write_line_nat (struct Map_info *Map, int type, struct line_pnts *points, struct line_cats *cats) |
Writes feature to 'coor' file. More... | |
long | V2_write_line_nat (struct Map_info *Map, int type, struct line_pnts *points, struct line_cats *cats) |
Writes feature to 'coor' file (topology level) More... | |
long | V1_rewrite_line_nat (struct Map_info *Map, long offset, int type, struct line_pnts *points, struct line_cats *cats) |
Rewrites feature at the given offset. More... | |
int | V2_rewrite_line_nat (struct Map_info *Map, int line, int type, struct line_pnts *points, struct line_cats *cats) |
Rewrites feature (topology level) More... | |
int | V1_delete_line_nat (struct Map_info *Map, long offset) |
Deletes feature at the given offset. More... | |
int | V2_delete_line_nat (struct Map_info *Map, int line) |
Deletes feature (topology level). More... | |
int | V1_restore_line_nat (struct Map_info *Map, long offset) |
Restores feature at the given offset. More... | |
int | V2_restore_line_nat (struct Map_info *Map, int line, long offset) |
Restores feature (topology level) More... | |
Vector library - write vector feature (native format)
Higher level functions for reading/writing/manipulating vectors.
Operations:
(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.
Definition in file write_nat.c.
long V1__rewrite_line_nat | ( | struct Map_info * | Map, |
long | offset, | ||
int | type, | ||
struct line_pnts * | points, | ||
struct line_cats * | cats | ||
) |
Rewrites feature at the given offset.
Map | pointer to vector map |
offset | feature offset |
type | feature type |
points | feature geometry |
cats | feature categories |
Definition at line 487 of file write_nat.c.
References dig__fwrite_port_C(), dig__fwrite_port_D(), dig__fwrite_port_I(), dig__fwrite_port_S(), dig_fflush(), dig_fseek(), dig_set_cur_port(), dig_type_to_store(), and if().
Referenced by V1_rewrite_line_nat(), and V1_write_line_nat().
int V1_delete_line_nat | ( | struct Map_info * | Map, |
long | offset | ||
) |
Deletes feature at the given offset.
Map | pointer to vector map |
offset | feature offset |
Definition at line 584 of file write_nat.c.
References dig__fread_port_C(), dig__fwrite_port_C(), dig_fflush(), dig_fseek(), dig_set_cur_port(), and G_debug().
Referenced by V1_rewrite_line_nat(), and V2_delete_line_nat().
int V1_restore_line_nat | ( | struct Map_info * | Map, |
long | offset | ||
) |
Restores feature at the given offset.
Map | pointer to vector map |
offset | feature offset |
Definition at line 823 of file write_nat.c.
References dig__fread_port_C(), dig__fwrite_port_C(), dig_fflush(), dig_fseek(), dig_set_cur_port(), and G_debug().
Referenced by V2_restore_line_nat().
long V1_rewrite_line_nat | ( | struct Map_info * | Map, |
long | offset, | ||
int | type, | ||
struct line_pnts * | points, | ||
struct line_cats * | cats | ||
) |
Rewrites feature at the given offset.
If the number of points or cats differs from the original one or the type is changed: GV_POINTS -> GV_LINES or GV_LINES -> GV_POINTS, the old one is deleted and the new is appended to the end of the file.
Old feature is deleted (marked as dead), new feature written.
Map | pointer to vector map |
offset | feature offset |
type | feature type |
points | feature geometry |
cats | feature categories |
Definition at line 397 of file write_nat.c.
References dig_fseek(), dig_ftell(), main::GV_LINES, NULL, V1__rewrite_line_nat(), V1_delete_line_nat(), V1_read_line_nat(), Vect_new_cats_struct(), and Vect_new_line_struct().
long V1_write_line_nat | ( | struct Map_info * | Map, |
int | type, | ||
struct line_pnts * | points, | ||
struct line_cats * | cats | ||
) |
Writes feature to 'coor' file.
Map | pointer to vector map |
type | feature type |
points | feature geometry |
cats | feature categories |
Definition at line 314 of file write_nat.c.
References dig_fseek(), dig_ftell(), and V1__rewrite_line_nat().
Referenced by V2_write_line_nat().
Deletes feature (topology level).
pointer | to vector map |
line | feature id |
Definition at line 624 of file write_nat.c.
References tools::box, dig_angle_next_line(), dig_cidx_del_cat(), dig_del_area(), dig_del_isle(), dig_del_line(), G_debug(), G_fatal_error(), NULL, V1_delete_line_nat(), V2_read_line_nat(), Vect_attach_centroids(), Vect_attach_isles(), Vect_box_copy(), Vect_box_extend(), Vect_build_line_area(), Vect_get_area_box(), Vect_get_isle_box(), and Vect_new_cats_struct().
Referenced by V2_rewrite_line_nat().
Restores feature (topology level)
Map | pointer to vector map |
line | feature id |
offset | feature offset |
Definition at line 866 of file write_nat.c.
References tools::box, dig_cidx_add_cat(), dig_line_box(), dig_line_set_box(), dig_restore_line(), G_debug(), G_fatal_error(), NULL, dialogs::type, V1_read_line_nat(), V1_restore_line_nat(), Vect_box_extend(), Vect_new_cats_struct(), and Vect_new_line_struct().
int V2_rewrite_line_nat | ( | struct Map_info * | Map, |
int | line, | ||
int | type, | ||
struct line_pnts * | points, | ||
struct line_cats * | cats | ||
) |
Rewrites feature (topology level)
Old feature is deleted (marked as dead), new feature written.
Map | pointer to vector map |
line | feature id |
type | feature type |
points | feature geometry |
cats | feature category |
Definition at line 459 of file write_nat.c.
References V2_delete_line_nat(), and V2_write_line_nat().
long V2_write_line_nat | ( | struct Map_info * | Map, |
int | type, | ||
struct line_pnts * | points, | ||
struct line_cats * | cats | ||
) |
Writes feature to 'coor' file (topology level)
Map | pointer to vector map |
type | feature type |
points | feature geometry |
cats | feature categories |
Definition at line 340 of file write_nat.c.
References tools::box, dig_add_line(), dig_line_box(), dig_line_set_box(), G_debug(), V1_write_line_nat(), Vect_box_copy(), and Vect_box_extend().
Referenced by V2_rewrite_line_nat().