19 #include <sys/types.h>
128 G_debug(4,
" node is dead -> write 0 only");
188 goto free_exit_failure;
202 goto free_exit_failure;
209 goto free_exit_failure;
211 goto free_exit_failure;
218 goto free_exit_failure;
220 goto free_exit_failure;
222 goto free_exit_failure;
224 goto free_exit_failure;
232 goto free_exit_failure;
238 goto free_exit_failure;
240 goto free_exit_failure;
248 goto free_exit_failure;
266 G_debug(4,
"dig_Wr_P_line() line = %d", n);
272 G_debug(4,
" line is dead -> write 0 only");
356 G_debug(4,
"dig_Rd_P_area(): n = %d", n);
533 unsigned char buf[5];
549 "Topo header: file version %d.%d , supported from GRASS version %d.%d",
553 G_debug(2,
" byte order %d", byte_order);
567 G_fatal_error(
_(
"This version of GRASS (%d.%d) is too old to read "
568 "this topology format."
569 " Try to rebuild topology or upgrade GRASS to at "
570 "least version %d."),
576 G_warning(
_(
"Your GRASS version does not fully support topology format "
577 "%d.%d of the vector."
578 " Consider to rebuild topology or upgrade GRASS."),
589 _(
"Old topology format version %d.%d is not supported by this "
591 " Try to rebuild topology using v.build or v.build.all module."),
613 if (
sizeof(off_t) < (
size_t)ptr->
off_t_size) {
614 G_warning(
_(
"Vector exceeds supported file size limit"));
713 unsigned char buf[10];
739 for (i = 1; i <= ptr->
n_nodes; i++) {
752 for (i = 1; i <= ptr->
n_lines; i++) {
774 for (i = 1; i <= ptr->
n_areas; i++) {
784 for (i = 1; i <= ptr->
n_isles; i++) {
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
int G_debug(int, const char *,...) __attribute__((format(printf
#define GV_TOPO_EARLIEST_MAJOR
#define GV_TOPO_EARLIEST_MINOR
#define GV_TOPO_VER_MINOR
#define GV_POINT
Feature types used in memory on run time (may change)
#define GV_TOPO_VER_MAJOR
int dig__fread_port_D(double *, size_t, struct gvfile *)
Read doubles 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.
void dig_free_line(struct P_line *)
Free line structure.
void dig_free_node(struct P_node *)
Free node structure.
struct P_isle * dig_alloc_isle(void)
Allocate new isle structure.
int dig__fwrite_port_C(const char *, size_t, struct gvfile *)
Write chars to the Portable Vector Format.
void dig_init_portable(struct Port_info *, int)
Set Port_info structure to byte order of file.
int dig__fread_port_L(long *, size_t, struct gvfile *)
Read longs from the Portable Vector Format.
int dig__fread_port_F(float *, size_t, struct gvfile *)
Read floats from the Portable Vector Format.
int dig__fwrite_port_L(const long *, size_t, struct gvfile *)
Write longs to the Portable Vector Format.
int dig__fwrite_port_I(const int *, size_t, struct gvfile *)
Write integers to the Portable Vector Format.
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_area_alloc_isle(struct P_area *, int)
Allocate space in P_area for add new isles.
int dig_set_cur_port(struct Port_info *)
Set current Port_info structure.
int dig__fwrite_port_D(const double *, size_t, struct gvfile *)
Write doubles to the Portable Vector Format.
void dig_rewind(struct gvfile *file)
Rewind file position.
int dig_node_alloc_line(struct P_node *, int)
Allocate space in P_node struct.
int dig__fread_port_C(char *, size_t, struct gvfile *)
Read chars from the Portable Vector Format.
void * dig_alloc_topo(char)
Allocate new topo struct.
int dig__fread_port_I(int *, size_t, struct gvfile *)
Read integers from the Portable Vector Format.
int dig_fseek(struct gvfile *file, off_t offset, int whence)
Set struct gvfile position.
void dig_free_area(struct P_area *)
Free area structure.
int dig_type_from_store(int)
Convert type from store type.
struct P_area * dig_alloc_area(void)
Allocate new area structure.
int dig__fread_port_P(plus_t *, size_t, struct gvfile *)
Read plus_t from the Portable Vector Format.
struct P_line * dig_alloc_line(void)
Allocate new line structure.
int dig_isle_alloc_line(struct P_isle *, int)
Allocate space in P_isle for add new lines.
int dig_area_alloc_line(struct P_area *, int)
allocate space in P_area for add new lines
void dig_free_isle(struct P_isle *)
Free isle structure.
int dig__fwrite_port_O(const off_t *, size_t, struct gvfile *, size_t)
Write off_ts to the Portable Vector Format.
int dig__fwrite_port_P(const plus_t *, size_t, struct gvfile *)
Write plus_t to the Portable Vector Format.
int dig_type_to_store(int)
Convert type to store type.
struct P_node * dig_alloc_node(void)
Allocate new node structure.
int dig_Rd_Plus_head(struct gvfile *fp, struct Plus_head *ptr)
Read Plus_head from file.
int dig_Rd_P_node(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_isle(struct Plus_head *Plus, int n, struct gvfile *fp)
int dig_Wr_P_node(struct Plus_head *Plus, int n, struct gvfile *fp)
int dig_Rd_P_line(struct Plus_head *Plus, int n, struct gvfile *fp)
int dig_Rd_P_area(struct Plus_head *Plus, int n, struct gvfile *fp)
int dig_Wr_Plus_head(struct gvfile *fp, struct Plus_head *ptr)
Write Plus_head to file.
int dig_Wr_P_line(struct Plus_head *Plus, int n, struct gvfile *fp)
int dig_Wr_P_area(struct Plus_head *Plus, int n, struct gvfile *fp)
plus_t n_isles
Number of islands inside.
plus_t * isles
1st generation interior islands
plus_t n_lines
Number of boundary lines.
plus_t * lines
List of boundary lines.
plus_t centroid
Number of first centroid within area.
plus_t * lines
List of boundary lines.
plus_t n_lines
Number of boundary lines.
plus_t area
Area it exists w/in, if any.
off_t offset
Offset in coor file for line.
void * topo
Topology info.
Topological feature - node.
plus_t n_lines
Number of attached lines (size of lines, angle)
float * angles
List of angles of connected lines.
plus_t * lines
List of connected lines.
double z
Z coordinate (used only for 3D data)
plus_t left
Area number to the left, negative for isle.
plus_t right
Area number to the right, negative for isle.
plus_t area
Area number, negative for duplicate centroid.
plus_t left
Volume number to the left, negative for hole.
plus_t right
Volume number to the right, negative for hole.
plus_t volume
Volume number, negative for duplicate kernel.
Basic topology-related info.
off_t Hole_offset
Offset of array of holes in topo file.
plus_t n_klines
Current number of kernels.
off_t Isle_offset
Offset of array of isles in topo file.
off_t Node_offset
Offset of array of nodes in topo file.
int with_z
2D/3D vector data
off_t coor_size
Size of coor file.
struct Plus_head::@9 version
Backward compatibility version info.
struct P_line ** Line
Array of vector geometries.
plus_t n_lines
Current number of lines.
off_t Volume_offset
Offset of array of volumes in topo file.
plus_t n_plines
Current number of points.
off_t Area_offset
Offset of array of areas in topo file.
int off_t_size
Offset size.
plus_t n_nodes
Current number of topological features derived from vector geometries.
plus_t n_volumes
Current number of volumes.
plus_t n_blines
Current number of boundaries.
struct P_area ** Area
Array of areas.
long head_size
Topo header size.
plus_t n_clines
Current number of centroids.
struct Version_info topo
Version info for topology file.
plus_t n_isles
Current number of isles.
plus_t n_holes
Current number of holes.
off_t Edge_offset
Offset of array of edges in topo file.
struct bound_box box
Bounding box of features.
plus_t n_edges
Current number of edges.
struct P_isle ** Isle
Array of isles.
struct P_node ** Node
Array of nodes.
struct Port_info port
Portability information.
plus_t n_areas
Current number of areas.
plus_t n_flines
Current number of faces.
off_t Line_offset
Offset of array of vector geometries in topo file.
plus_t n_llines
Current number of lines.
int byte_order
File byte order.
int minor
Current version (minor)
int back_major
Earliest version that can use this data format (major)
int back_minor
Earliest version that can use this data format (minor)
int major
Current version (major)
#define GRASS_VERSION_MINOR
#define GRASS_VERSION_MAJOR