GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-36359e2344
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

◆ V1_read_line_nat()

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.

◆ V1_read_next_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 71 of file read_nat.c.

References Map_info::constraint, Map_info::dig_fp, dig_ftell(), G_debug(), Map_info::region_flag, TRUE, and Vect_get_constraint_box().

◆ V2_read_line_nat()

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.

◆ V2_read_next_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.