13 #ifndef DIG___STRUCTS___
14 #define DIG___STRUCTS___
18 #include <sys/types.h>
20 #include <grass/dgl.h>
21 #include <grass/shapefil.h>
23 #include <grass/rtree.h>
SF_FeatureType
Simple feature types.
#define PORT_DOUBLE
Sizes of types used in portable format (different names used in Vlib/ and diglib/ for the same thing)
int n_types
Number of types in type.
int(* cat)[3]
Array of cats (cat, type, lines/area)
int a_cats
Allocated space in cat array.
int n_cats
Number of items in cat array.
off_t offset
Offset of the beginning of this index in cidx file.
int field
Field (layer) number.
int type[7][2]
Number of elements for each type.
int n_ucats
Number of unique cats (not updated)
off_t size
Total size (in bytes)
long mtime
Time of last modification.
Graph-related section (see GRASS Directed Graph Library)
dglSPCache_s spCache
Shortest path cache.
int line_type
Line type used to build the graph.
int cost_multip
Edge and node costs multiplicator.
double * edge_fcosts
Forward costs used for graph.
double * node_costs
Node costs used for graph.
dglGraph_s graph_s
Graph structure.
double * edge_bcosts
backward costs used for graph
struct site_att * site_att
Array of attributes loaded from db.
char * mapset
Mapset name.
int temporary
Temporary map flag.
struct gvfile dig_fp
GV file pointer (native format only)
struct dig_head head
Header info.
struct bound_box box
Region (bbox) constraint.
int support_updated
Support files were updated.
int n_site_dbl
Number of double attributes for one site.
char * gisdbase
GISDBASE path.
int n_site_att
Number of attributes in site_att array.
char * name
Map name (for 4.0)
int field
Field number constraint (see line_cats structure)
int field_flag
Non-zero value to enable field constraint.
FILE * hist_fp
History file.
plus_t next_line
Feature id for sequential access.
int type
Feature type constraint.
int n_site_str
Number of string attributes for one site.
int type_flag
Non-zero value to enable feature type constraint.
char * location
Location name.
int head_only
Open only header.
int format
Map format (native, ogr, postgis)
struct Map_info::@11 constraint
Constraints for sequential feature access.
struct dblinks * dblnk
Array of DB links.
int region_flag
Non-zero value to enable region constraint.
struct Format_info fInfo
Format info for non-native formats.
struct Graph_info dgraph
Graph info (built for network analysis)
struct Plus_head plus
Plus info (topology, version, ...)
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 alloc_lines
Allocated space for lines.
plus_t centroid
Number of first centroid within area.
plus_t alloc_isles
Allocated space for isles.
plus_t * lines
List of boundary lines.
plus_t n_lines
Number of boundary lines.
plus_t alloc_lines
Allocated space for 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 alloc_lines
Allocated space for lines.
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 E[3]
Array of edges.
plus_t right
Volume number to the right, negative for hole.
plus_t volume
Volume number, negative for duplicate kernel.
Basic topology-related info.
int do_uplist
Indicates if the list of updated features is maintained.
struct gvfile spidx_fp
Spatial index file pointer.
struct Cat_index * cidx
Array of category indexes.
off_t Hole_offset
Offset of array of holes in topo file.
plus_t n_klines
Current number of kernels.
int n_cidx
Number of category indexes (one for each field/layer)
int Spidx_built
Spatial index built?
plus_t alloc_lines
Number of allocated lines.
off_t Isle_offset
Offset of array of isles in topo file.
off_t Area_spidx_offset
Offset of areas in sidx file.
struct Port_info cidx_port
Portability information for category index.
plus_t alloc_faces
Number of allocated faces.
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.
plus_t n_faces
Current number of faces.
off_t Isle_spidx_offset
Offset of isles in sidx 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 Hole_spidx_offset
Offset of holes in sidx file.
int Spidx_new
Build new spatial index.
off_t Volume_offset
Offset of array of volumes in topo file.
plus_t n_plines
Current number of points.
struct RTree * Isle_spidx
Isles spatial index.
off_t Face_spidx_offset
Offset of faces in sidx file.
int alloc_upnodes
Allocated array of nodes.
off_t Area_offset
Offset of array of areas in topo file.
int off_t_size
Offset size.
plus_t alloc_holes
Number of allocated holes.
struct RTree * Area_spidx
Area spatial index.
plus_t n_nodes
Current number of topological features derived from vector geometries.
plus_t n_volumes
Current number of volumes.
int n_upnodes
number of updated nodes
int Spidx_file
Build new spatial index in file.
plus_t alloc_volumes
Number of allocated volumes.
off_t Volume_spidx_offset
Offset of volumes in sidx file.
int * upnodes
Array of updated nodes.
plus_t alloc_areas
Number of allocated areas.
int a_cidx
Allocated space for category indexes.
struct RTree * Line_spidx
Line spatial index.
plus_t n_blines
Current number of boundaries.
struct P_area ** Area
Array of areas.
plus_t alloc_isles
Number of allocated isles.
long head_size
Topo header size.
struct RTree * Volume_spidx
Volumes spatial index.
int spidx_with_z
2D/3D spatial index
int release_support
Release memory occupied by support structures (topo, spatial, category)
plus_t n_clines
Current number of centroids.
int cidx_up_to_date
Category index to be updated.
struct Version_info cidx
Version info for category index file.
long spidx_head_size
Spatial index header size.
plus_t alloc_nodes
Number of allocated nodes.
struct Version_info topo
Version info for topology file.
int update_cidx
Update category index if vector is modified.
plus_t n_vfaces
Current number of volume faces.
plus_t n_isles
Current number of isles.
int alloc_uplines
Allocated array of lines.
plus_t alloc_edges
Number of allocated edges.
struct RTree * Face_spidx
Faces spatial index.
int * uplines
Array of updated lines.
struct Port_info spidx_port
Portability information for spatial index.
plus_t n_holes
Current number of holes.
plus_t n_hfaces
Current number of hole faces.
long cidx_head_size
Category index header size.
struct Plus_head::@10 uplist
List of updated lines/nodes.
long coor_mtime
Time of last coor modification.
off_t * uplines_offset
Array of updated lines - offset.
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.
off_t Line_spidx_offset
Offset of lines in sidx file.
int n_uplines
Number of updated lines.
struct RTree * Node_spidx
Node spatial index.
struct P_isle ** Isle
Array of isles.
struct P_node ** Node
Array of nodes.
struct Port_info port
Portability information.
off_t Node_spidx_offset
Offset of nodes in sidx file.
struct RTree * Hole_spidx
Holes spatial index.
plus_t n_areas
Current number of areas.
int built
Highest level of topology currently available.
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.
struct Version_info spidx
Version info for spatial index file.
unsigned char flt_cnvrt[PORT_FLOAT]
Conversion matrices between file and native byte order (float)
int flt_quick
Quick reading flag for float.
unsigned char lng_cnvrt[PORT_LONG]
Conversion matrices between file and native byte order (long)
int dbl_quick
Quick reading flag for double.
unsigned char off_t_cnvrt[PORT_OFF_T]
Conversion matrices between file and native byte order (off_t)
unsigned char int_cnvrt[PORT_INT]
Conversion matrices between file and native byte order (int)
int off_t_quick
Quick reading flag for off_t.
int lng_quick
Quick reading flag for long.
int int_quick
Quick reading flag for int.
unsigned char shrt_cnvrt[PORT_SHORT]
Conversion matrices between file and native byte order (short)
int off_t_size
Size of off_t data type.
unsigned char dbl_cnvrt[PORT_DOUBLE]
Conversion matrices between file and native byte order (double)
int shrt_quick
Quick reading flag for short.
int byte_order
File byte order.
Backward compatibility version info.
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)
List of bounding boxes with id.
int alloc_values
Allocated space for items.
struct bound_box * box
Array of bounding boxes.
int n_values
Number of items in the list.
int have_boxes
flag to indicate whether bounding boxes should be added
int alloc_ranges
Allocated space for ranges.
int n_ranges
Number of ranges.
int * min
Array of minimum values.
int * max
Array of maximum values.
int field
Category layer (field)
int n_fields
Number of available layers (old: fields)
int alloc_fields
Number of allocated slots.
struct field_info * field
Pointer to the first field_info structure.
struct recycle * recycle
Recycle dead line.
struct Version_info coor_version
Version info for coor file.
off_t last_offset
Offset of last read line.
long orig_scale
Original scale.
int plani_zone
Zone (UTM only)
double digit_thresh
Threshold for digitization.
char * organization
Organization name.
off_t size
Coor file size.
int with_z
2D/3D vector data
char * user_name
User name.
long head_size
Coor header size.
char * source_date
Source date.
struct Port_info port
Portability information.
Layer (old: field) information.
char * table
Name of DB table.
char * driver
Name of DB driver ('sqlite', 'dbf', ...)
char * name
Layer name (optional)
char * key
Name of key column (usually 'cat')
int loaded
Is file loaded?
char * end
End of file in the memory (pointer to first byte after)
char * start
Pointer to beginning of the file in the memory.
FILE * file
File descriptor.
off_t alloc
Allocated space.
off_t size
Size of the file loaded to memory.
char * current
Current position set by dig_seek()
int * field
Array of layers (fields)
int alloc_cats
Allocated space for categories.
int * cat
Array of categories.
int n_cats
Number of categories attached to element.
Feature geometry info - coordinates.
double * y
Array of Y coordinates.
int alloc_points
Allocated space for points.
double * x
Array of X coordinates.
int n_points
Number of points.
double * z
Array of Z coordinates.
List of dead lines in the file.
char ** str
Array of string attributes.
double * dbl
Array of double attributes.
struct RTree * si_tree
Pointer to the search tree (R*-Tree)
char * name
Name of file to store the search tree.