GRASS GIS 7 Programmer's Manual  7.5.svn(2018)-r73122
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
read_nat.c File Reference

Vector library - reading features (native format) More...

#include <sys/types.h>
#include <grass/vector.h>
#include <grass/glocale.h>
Include dependency graph for read_nat.c:

Go to the source code of this file.

Functions

int V1_read_line_nat (struct Map_info *Map, struct line_pnts *Points, struct line_cats *Cats, off_t offset)
 Read vector feature on non-topological level (level 1) - native format - internal use only. More...
 
int V1_read_next_line_nat (struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c)
 Read next vector feature on non-topological level (level 1) - native format - internal use only. More...
 
int V2_read_line_nat (struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c, int line)
 Read vector feature on topological level (level 2) - native format - internal use only. More...
 
int V2_read_next_line_nat (struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c)
 Read next vector feature on topological level (level 2) - native format - internal use only. More...
 

Detailed Description

Vector library - reading features (native format)

Higher level functions for reading/writing/manipulating vectors.

(C) 2001-2009, 2011-2012 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
Original author CERL, probably Dave Gerdes or Mike Higgins.
Update to GRASS 5.7 by Radim Blazek and David D. Gray.
Update to GRASS 7 by Martin Landa <landa.martin gmail.com>

Definition in file read_nat.c.

Function Documentation

int V1_read_line_nat ( struct Map_info Map,
struct line_pnts Points,
struct line_cats Cats,
off_t  offset 
)

Read vector feature on non-topological level (level 1) - native format - internal use only.

This function implements random access for native format, constraints are ignored!

Parameters
Mappointer to Map_info struct
[out]Pointscontainer used to store line points within (pointer to line_pnts struct)
[out]Catscontainer used to store line categories within (pointer to line_cats struct)
offsetgiven offset
Returns
feature type (GV_POINT, GV_LINE, ...)
0 dead line
-2 nothing to read
-1 on failure

Definition at line 43 of file read_nat.c.

Referenced by V1_rewrite_line_nat(), and V2_restore_line_nat().

int V1_read_next_line_nat ( struct Map_info Map,
struct line_pnts line_p,
struct line_cats line_c 
)

Read next vector feature on non-topological level (level 1) - native format - internal use only.

This function implements sequential access, constraints are reflected, see Vect_set_constraint_region(), Vect_set_constraint_type(), or Vect_set_constraint_field().

Dead features are skipped.

Vect_rewind() can be used to reset reading.

Parameters
Mappointer to Map_info struct
[out]line_pcontainer used to store line points within (pointer to line_pnts struct)
[out]line_ccontainer used to store line categories within (pointer to line_cats struct)
Returns
feature type (GV_POINT, GV_LINE, ...)
0 dead line
-2 nothing to read
-1 on failure

Definition at line 72 of file read_nat.c.

References Map_info::constraint, Map_info::dig_fp, dig_ftell(), Map_info::field, Map_info::field_flag, G_debug(), NULL, Map_info::region_flag, TRUE, Map_info::type, Map_info::type_flag, Vect_box_overlap(), Vect_cat_get(), Vect_get_constraint_box(), and Vect_line_box().

int V2_read_line_nat ( struct Map_info Map,
struct line_pnts line_p,
struct line_cats line_c,
int  line 
)

Read vector feature on topological level (level 2) - native format - internal use only.

This function implements random access for native format, constraints are ignored!

Note: Topology must be built at level >= GV_BUILD_BASE

Parameters
Mappointer to Map_info struct
[out]Pointscontainer used to store line points within (pointer to line_pnts struct)
[out]Catscontainer used to store line categories within (pointer to line_cats struct)
linefeature id to read (starts at 1)
Returns
feature type (GV_POINT, GV_LINE, ...)
-2 nothing to read
-1 on failure

Definition at line 136 of file read_nat.c.

References _, G_debug(), G_warning(), Plus_head::Line, Plus_head::n_lines, NULL, P_line::offset, and Map_info::plus.

Referenced by V2_delete_line_nat(), and V2_rewrite_line_nat().

int V2_read_next_line_nat ( struct Map_info Map,
struct line_pnts line_p,
struct line_cats line_c 
)

Read next vector feature on topological level (level 2) - native format - internal use only.

This function implements sequential access, constraints are reflected, see Vect_set_constraint_region(), Vect_set_constraint_type(), or Vect_set_constraint_field().

Use Vect_rewind() to reset reading.

Dead feature are skipped.

Parameters
Mappointer to Map_info struct
[out]line_pcontainer used to store line points within (pointer to line_pnts struct)
[out]line_ccontainer used to store line categories within (pointer to line_cats struct)
Returns
feature type (GV_POINT, GV_LINE, ...)
-2 nothing to read
-1 on error

Definition at line 178 of file read_nat.c.

References Map_info::constraint, Map_info::field, Map_info::field_flag, G_debug(), Plus_head::Line, Plus_head::n_lines, Map_info::next_line, NULL, P_line::offset, Map_info::plus, Map_info::region_flag, TRUE, Map_info::type, P_line::type, Map_info::type_flag, Vect_box_overlap(), Vect_cat_get(), Vect_get_constraint_box(), and Vect_line_box().