GRASS 8 Programmer's Manual 8.6.0dev(2026)-8843f13794
Loading...
Searching...
No Matches
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.
 
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.
 
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.
 
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.
 

Detailed Description

Vector library - reading features (native format)

Higher level functions for reading/writing/manipulating vectors.

SPDX-FileCopyrightText: 2001-2009, 2011-2012 GRASS Development Team SPDX-License-Identifier: GPL-2.0-or-later

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 41 of file read_nat.c.

Referenced by V1_rewrite_line_nat(), and V2_restore_line_nat().

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

References dig_ftell(), G_debug(), NULL, TRUE, Vect_box_overlap(), Vect_cat_get(), Vect_get_constraint_box(), and Vect_line_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]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)
linefeature id to read (starts at 1)
Returns
feature type (GV_POINT, GV_LINE, ...)
-2 nothing to read
-1 on failure

Definition at line 135 of file read_nat.c.

References _, G_debug(), G_warning(), NULL, and P_line::offset.

Referenced by V2_delete_line_nat(), and V2_rewrite_line_nat().

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

References G_debug(), NULL, P_line::offset, TRUE, P_line::type, Vect_box_overlap(), Vect_cat_get(), Vect_get_constraint_box(), and Vect_line_box().