19 #include <grass/Vect.h>
20 #include <grass/glocale.h>
22 static int read_next_dummy()
30 G_fatal_error(_(
"Requested format is not compiled in this version"));
35 static int (*Read_next_line_array[][3]) () = {
43 read_next_dummy, format, format}
47 static int (*V2_read_line_array[]) () = {
68 struct line_pnts *line_p,
struct line_cats *line_c)
71 G_debug(3,
"Vect_read_next_line()");
76 return (*Read_next_line_array[Map->format][Map->level]) (
Map, line_p,
93 struct line_pnts *line_p,
struct line_cats *line_c,
int line)
99 G_fatal_error(
"Vect_read_line(): %s", _(
"vector map is not opened"));
101 if (line < 1 || line > Map->plus.n_lines)
102 G_fatal_error(_(
"Vect_read_line(): feature id %d is not reasonable "
103 "(max features in vector map <%s>: %d)"),
106 return (*V2_read_line_array[Map->format]) (
Map, line_p, line_c, line);
120 if (Map->plus.Line[line] !=
NULL)
137 if (Map->plus.Node[node] !=
NULL)
154 if (Map->plus.Area[area] !=
NULL)
171 if (Map->plus.Isle[isle] !=
NULL)
190 if (line < 1 || line > Map->plus.n_lines)
193 if (Map->plus.Line[line] !=
NULL) {
194 return Map->plus.Line[line]->offset;
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.
int Vect_read_next_line(struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c)
Read next vector feature (level 1 and 2)
int V2_read_next_line_ogr(struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c)
Read next line from OGR layer.
int Vect_node_alive(struct Map_info *Map, int node)
Check if node is alive or dead.
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.
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.
int Vect_isle_alive(struct Map_info *Map, int isle)
Check if isle is alive or dead.
int V2_read_line_ogr(struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c, int line)
Read line from layer on given offset.
long Vect_get_line_offset(const struct Map_info *Map, int line)
Get feature offset.
int V1_read_next_line_ogr(struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c)
Read next line from OGR layer. Skip empty features.
int Vect_line_alive(struct Map_info *Map, int line)
Check if feature is alive or dead.
int G_debug(int level, const char *msg,...)
Print debugging message.
int Vect_area_alive(struct Map_info *Map, int area)
Check if area is alive or dead.
int G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.
int Vect_read_line(struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c, int line)
Read vector feature.