18 #include <sys/types.h> 113 G_debug(4,
" node is dead -> write 0 only");
245 G_debug(4,
"dig_Wr_P_line() line = %d", n);
251 G_debug(4,
" line is dead -> write 0 only");
334 G_debug(4,
"dig_Rd_P_area(): n = %d", n);
491 unsigned char buf[5];
506 "Topo header: file version %d.%d , supported from GRASS version %d.%d",
510 G_debug(2,
" byte order %d", byte_order);
520 G_debug(1,
"Topology format version %d.%d",
523 (
_(
"This version of GRASS (%d.%d) is too old to read this topology format." 524 " Try to rebuild topology or upgrade GRASS to at least version %d."),
529 G_warning(
_(
"Your GRASS version does not fully support topology format %d.%d of the vector." 530 " Consider to rebuild topology or upgrade GRASS."),
539 G_warning(
_(
"Old topology format version %d.%d is not supported by this release." 540 " Try to rebuild topology using v.build or v.build.all module."),
563 G_warning(
_(
"Vector exceeds supported file size limit"));
648 unsigned char buf[10];
int dig__fwrite_port_P(const plus_t *, size_t, struct gvfile *)
Write plus_t to the Portable Vector Format.
plus_t n_areas
Current number of areas.
plus_t right
Volume number to the right, negative for hole.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
off_t coor_size
Size of coor file.
plus_t area
Area number, negative for duplicate centroid.
void dig_rewind(struct gvfile *file)
Rewind file position.
#define GV_TOPO_VER_MAJOR
#define GV_TOPO_VER_MINOR
void dig_init_portable(struct Port_info *, int)
Set Port_info structure to byte order of file.
plus_t n_klines
Current number of kernels.
int dig__fwrite_port_I(const int *, size_t, struct gvfile *)
Write integers to the Portable Vector Format.
plus_t n_holes
Current number of holes.
off_t offset
Offset in coor file for line.
int dig_type_to_store(int)
Convert type to store type.
off_t Area_offset
Offset of array of areas in topo file.
struct P_isle * dig_alloc_isle()
Allocate new isle structure.
int back_major
Earliest version that can use this data format (major)
int dig__fwrite_port_C(const char *, size_t, struct gvfile *)
Write chars to the Portable Vector Format.
struct P_line ** Line
Array of vector geometries.
off_t Isle_offset
Offset of array of isles in topo file.
int dig__fread_port_I(int *, size_t, struct gvfile *)
Read integers from the Portable Vector Format.
struct P_area * dig_alloc_area()
Allocate new area structure.
int dig_Wr_P_line(struct Plus_head *Plus, int n, struct gvfile *fp)
int dig_Wr_P_isle(struct Plus_head *Plus, int n, struct gvfile *fp)
int dig_Rd_P_node(struct Plus_head *Plus, int n, struct gvfile *fp)
int with_z
2D/3D vector data
int dig__fread_port_C(char *, size_t, struct gvfile *)
Read chars from the Portable Vector Format.
plus_t n_plines
Current number of points.
plus_t right
Area number to the right, negative for isle.
struct P_area ** Area
Array of areas.
struct P_node ** Node
Array of nodes.
void * dig_alloc_topo(char)
Allocate new topo struct.
plus_t n_lines
Number of attached lines (size of lines, angle)
plus_t left
Area number to the left, negative for isle.
int dig_Wr_P_area(struct Plus_head *Plus, int n, struct gvfile *fp)
int dig__fread_port_L(long *, size_t, struct gvfile *)
Read longs from the Portable Vector Format.
off_t Line_offset
Offset of array of vector geometries in topo file.
struct P_isle ** Isle
Array of isles.
plus_t * lines
List of connected lines.
plus_t * isles
1st generation interior islands
#define GRASS_VERSION_MINOR
plus_t n_isles
Current number of isles.
plus_t centroid
Number of first centroid within area.
#define GV_TOPO_EARLIEST_MAJOR
plus_t n_lines
Number of boundary lines.
#define GV_POINT
Feature types used in memory on run time (may change)
off_t Volume_offset
Offset of array of volumes in topo file.
off_t dig_ftell(struct gvfile *file)
Get struct gvfile position.
int dig__fwrite_port_F(const float *, size_t, struct gvfile *)
Write floats to the Portable Vector Format.
int dig__fwrite_port_O(const off_t *, size_t, struct gvfile *, size_t)
Write off_ts to the Portable Vector Format.
plus_t n_lines
Current number of lines.
int dig_Rd_P_line(struct Plus_head *Plus, int n, struct gvfile *fp)
#define GRASS_VERSION_MAJOR
struct Port_info port
Portability information.
off_t Hole_offset
Offset of array of holes in topo file.
double z
Z coordinate (used only for 3D data)
off_t Edge_offset
Offset of array of edges in topo file.
int off_t_size
Offset size.
plus_t * lines
List of boundary lines.
Basic topology-related info.
off_t Node_offset
Offset of array of nodes in topo file.
int major
Current version (major)
void * topo
Topology info.
int dig_type_from_store(int)
Convert type from store type.
float * angles
List of angles of connected lines.
struct P_line * dig_alloc_line()
Allocate new line structure.
plus_t * lines
List of boundary lines.
struct Version_info topo
Version info for topology file.
int dig_node_alloc_line(struct P_node *, int)
Allocate space in P_node struct.
struct P_node * dig_alloc_node()
Allocate new node structure.
Topological feature - node.
struct bound_box box
Bounding box of features.
plus_t n_flines
Current number of faces.
plus_t n_isles
Number of islands inside.
plus_t left
Volume number to the left, negative for hole.
int dig_area_alloc_isle(struct P_area *, int)
Allocate space in P_area for add new isles.
int byte_order
File byte order.
plus_t n_llines
Current number of lines.
int dig__fread_port_F(float *, size_t, struct gvfile *)
Read floats from the Portable Vector Format.
int dig__fread_port_O(off_t *, size_t, struct gvfile *, size_t)
Read off_ts from the Portable Vector Format.
int dig_area_alloc_line(struct P_area *, int)
allocate space in P_area for add new lines
int dig_Rd_P_isle(struct Plus_head *Plus, int n, struct gvfile *fp)
void G_warning(const char *,...) __attribute__((format(printf
int dig_Rd_P_area(struct Plus_head *Plus, int n, struct gvfile *fp)
int dig__fread_port_P(plus_t *, size_t, struct gvfile *)
Read plus_t from the Portable Vector Format.
int dig_Wr_P_node(struct Plus_head *Plus, int n, struct gvfile *fp)
plus_t n_clines
Current number of centroids.
int dig_isle_alloc_line(struct P_isle *, int)
Allocate space in P_isle for add new lines.
plus_t volume
Volume number, negative for duplicate kernel.
long head_size
Topo header size.
int minor
Current version (minor)
int dig_set_cur_port(struct Port_info *)
Set current Port_info structure.
int dig__fwrite_port_L(const long *, size_t, struct gvfile *)
Write longs to the Portable Vector Format.
int back_minor
Earliest version that can use this data format (minor)
int dig_Wr_Plus_head(struct gvfile *fp, struct Plus_head *ptr)
plus_t n_blines
Current number of boundaries.
plus_t n_lines
Number of boundary lines.
plus_t area
Area it exists w/in, if any.
int G_debug(int, const char *,...) __attribute__((format(printf
plus_t n_edges
Current number of edges.
int dig_fseek(struct gvfile *file, off_t offset, int whence)
Set struct gvfile position.
int dig_Rd_Plus_head(struct gvfile *fp, struct Plus_head *ptr)
Read Plus_head from file.
struct Plus_head::@9 version
Backward compatibility version info.
int dig__fwrite_port_D(const double *, size_t, struct gvfile *)
Write doubles to the Portable Vector Format.
plus_t n_volumes
Current number of volumes.
#define GV_TOPO_EARLIEST_MINOR
plus_t n_nodes
Current number of topological features derived from vector geometries.
int dig__fread_port_D(double *, size_t, struct gvfile *)
Read doubles from the Portable Vector Format.