GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
read_nat.c File Reference

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

#include <grass/gis.h>
#include <grass/Vect.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, long offset)
 Read line from coor file on given offset. More...
 
int V1_read_next_line_nat (struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c)
 Read next line from coor file. More...
 
int V2_read_line_nat (struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c, int line)
 Reads any specified line, this is NOT affected by constraints. More...
 
int V2_read_next_line_nat (struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c)
 Reads next unread line each time called. Use Vect_rewind to reset. More...
 

Detailed Description

Vector library - reading data (native format)

Higher level functions for reading/writing/manipulating vectors.

The action of this routine can be modified by:

(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.

Author
Original author CERL, probably Dave Gerdes or Mike Higgins. Update to GRASS 5.7 Radim Blazek and David D. Gray.
Date
2001

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,
long  offset 
)

Read line from coor file on given offset.

Parameters
Mapvector map
Pointscontainer used to store line points within
Catscontainer used to store line categories within
offsetgiven offset
Returns
line type
0 dead line
-2 end of table (last row)
-1 out of memory

Definition at line 48 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 line from coor file.

Parameters
Mapvector map layer
line_pcontainer used to store line points within
line_ccontainer used to store line categories within
Returns
line type
0 dead line
-2 end of table (last row)
-1 out of memory

Definition at line 68 of file read_nat.c.

References dig_ftell(), G_debug(), Vect_box_overlap(), 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 
)

Reads any specified line, this is NOT affected by constraints.

Parameters
Mapvector map layer
line_pcontainer used to store line points within
line_ccontainer used to store line categories within
lineline id
Returns
line type ( > 0 )
0 dead line
-1 out of memory
-2 end of file

Definition at line 124 of file read_nat.c.

References G_debug(), G_fatal_error(), and NULL.

Referenced by V2_delete_line_nat(), and 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 
)

Reads next unread line each time called. Use Vect_rewind to reset.

Parameters
Mapvector map layer
line_pcontainer used to store line points within
line_ccontainer used to store line categories within
Returns
line type ( > 0 )
0 dead line
-1 out of memory
-2 end of file

Definition at line 154 of file read_nat.c.

References G_debug(), NULL, V2_read_line_nat(), Vect_box_overlap(), Vect_get_constraint_box(), and Vect_get_line_box().