18 #include <sys/types.h> 22 static int read_line_nat(
struct Map_info *,
47 return read_line_nat(Map, Points, Cats, offset);
79 G_debug(3,
"V1_read_next_line_nat()");
86 itype = read_line_nat(Map, line_p, line_c, offset);
141 G_debug(3,
"V2_read_line_nat(): line = %d", line);
144 G_warning(
_(
"Attempt to access feature with invalid id (%d)"), line);
150 G_warning(
_(
"Attempt to access dead feature %d"), line);
154 return read_line_nat(Map, line_p, line_c, Line->
offset);
185 G_debug(3,
"V2_read_next_line_nat()");
212 ret = read_line_nat(Map, line_p, line_c, Line->
offset);
249 int read_line_nat(
struct Map_info *Map,
252 register int i, dead = 0;
260 G_debug(3,
"Vect__Read_line_nat: offset = %lu", (
unsigned long) offset);
283 G_debug(3,
" type = %d, do_cats = %d dead = %d", type, do_cats, dead);
298 G_debug(3,
" n_cats = %d", n_cats);
312 for (i = 0; i < n_cats; i++) {
315 c->
field[i] = (int)field;
325 size = (off_t) (2 *
PORT_INT) * n_cats;
343 G_debug(3,
" n_points = %d", n_points);
360 for (i = 0; i < n_points; i++)
struct Version_info coor_version
Version info for coor file.
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...
off_t offset
Offset in coor file for line.
struct P_line ** Line
Array of vector geometries.
int dig__fread_port_I(int *, size_t, struct gvfile *)
Read integers from the Portable Vector Format.
int region_flag
Non-zero value to enable region constraint.
int dig__fread_port_C(char *, size_t, struct gvfile *)
Read chars from the Portable Vector Format.
int n_points
Number of points.
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...
void Vect_line_box(const struct line_pnts *, struct bound_box *)
Get bounding box of line.
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...
int type
Feature type constraint.
off_t dig_ftell(struct gvfile *file)
Get struct gvfile position.
plus_t n_lines
Current number of lines.
#define PORT_DOUBLE
Sizes of types used in portable format (different names used in Vlib/ and diglib/ for the same thing)...
int dig_alloc_cats(struct line_cats *, int)
Allocate room for 'num' fields and category arrays in struct line_cats.
double * x
Array of X coordinates.
Feature geometry info - coordinates.
int with_z
2D/3D vector data
int field_flag
Non-zero value to enable field constraint.
plus_t next_line
Feature id for sequential access.
struct Map_info::@11 constraint
Constraints for sequential feature access.
struct Port_info port
Portability information.
int dig_type_from_store(int)
Convert type from store type.
int n_cats
Number of categories attached to element.
int * cat
Array of categories.
int Vect_get_constraint_box(const struct Map_info *, struct bound_box *)
Get constraint box.
int dig_alloc_points(struct line_pnts *, int)
allocate room for 'num' X and Y arrays in struct line_pnts
struct Plus_head plus
Plus info (topology, version, ...)
int type_flag
Non-zero value to enable feature type constraint.
struct dig_head head
Header info.
double * y
Array of Y coordinates.
int dig__fread_port_S(short *, size_t, struct gvfile *)
Read shorts from the Portable Vector Format.
void G_warning(const char *,...) __attribute__((format(printf
double * z
Array of Z coordinates.
struct gvfile dig_fp
GV file pointer (native format only)
off_t last_offset
Offset of last read line.
int * field
Array of layers (fields)
int minor
Current version (minor)
int dig_set_cur_port(struct Port_info *)
Set current Port_info structure.
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 Vect_box_overlap(const struct bound_box *, const struct bound_box *)
Tests for overlap of two boxes.
int field
Field number constraint (see line_cats structure)
int G_debug(int, const char *,...) __attribute__((format(printf
int dig_fseek(struct gvfile *file, off_t offset, int whence)
Set struct gvfile position.
int Vect_cat_get(const struct line_cats *, int, int *)
Get first found category of given field.
int dig__fread_port_D(double *, size_t, struct gvfile *)
Read doubles from the Portable Vector Format.