GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
dig_structs.h
Go to the documentation of this file.
1 /*!
2  \file include/vect/dig_structs.h
3 
4  \brief Data structures for \ref vectorlib
5 
6  \author Written by Dave Gerdes (CERL) 5/1988
7  \author Updated to GRASS 5.7 by Radim Blazek (2001)
8  \author Updated to GRASS 7.0 by Markus Metz (2011)
9  \author Doxygenized by Martin Landa <landa.martin gmail.com> (2011)
10 */
11 #include <grass/config.h>
12 
13 #ifndef DIG___STRUCTS___
14 #define DIG___STRUCTS___
15 
16 #include <stdio.h>
17 
18 #include <sys/types.h>
19 
20 #include <grass/dgl.h>
21 #include <grass/shapefil.h>
22 #include <grass/rbtree.h>
23 #include <grass/rtree.h>
24 #include <grass/dbmi.h>
25 
26 #ifdef HAVE_OGR
27 #include <ogr_api.h>
28 #endif
29 
30 #ifdef HAVE_POSTGRES
31 #include <libpq-fe.h>
32 #endif
33 
34 /*!
35  \brief plus_t size
36 
37  3.10 changes plus_t to int. This assumes that any reasonable machine
38  will use 4 bytes to store an int. The diglib code is not guaranteed
39  to work if plus_t is changed to a type that is larger than an int.
40  */
41 typedef int plus_t;
42 
43 /*!
44  \brief Used by sites lib
45 */
46 struct site_att
47 {
48  /*!
49  \brief Category number
50  */
51  int cat;
52  /*!
53  \brief Array of double attributes
54  */
55  double *dbl;
56  /*!
57  \brief Array of string attributes
58  */
59  char **str;
60 };
61 
62 /*!
63  \brief Bounding box
64 */
65 struct bound_box
66 {
67  /*!
68  \brief North
69  */
70  double N;
71  /*!
72  \brief South
73  */
74  double S;
75  /*!
76  \brief East
77  */
78  double E;
79  /*!
80  \brief West
81  */
82  double W;
83  /*!
84  \brief Top
85  */
86  double T;
87  /*!
88  \brief Bottom
89  */
90  double B;
91 };
92 
93 /*!
94  \brief File definition
95 */
96 struct gvfile
97 {
98  /*!
99  \brief File descriptor
100  */
101  FILE *file;
102  /*!
103  \brief Pointer to beginning of the file in the memory
104  */
105  char *start;
106  /*!
107  \brief Current position set by dig_seek()
108  */
109  char *current;
110  /*!
111  \brief End of file in the memory (pointer to first byte after)
112  */
113  char *end;
114  /*!
115  \brief Size of the file loaded to memory
116  */
117  off_t size;
118  /*!
119  \brief Allocated space
120  */
121  off_t alloc;
122  /*!
123  \brief Is file loaded?
124 
125  - 0 - not loaded
126  - 1 - loaded
127  */
128  int loaded;
129 };
130 
131 /*!
132  \brief Layer (old: field) information
133 */
135 {
136  /*!
137  \brief Layer number
138  */
139  int number;
140  /*!
141  \brief Layer name (optional)
142  */
143  char *name;
144  /*!
145  \brief Name of DB driver ('sqlite', 'dbf', ...)
146  */
147  char *driver;
148  /*!
149  brief Name of database
150  */
151  char *database;
152  /*!
153  \brief Name of DB table
154  */
155  char *table;
156  /*!
157  \brief Name of key column (usually 'cat')
158  */
159  char *key;
160 };
161 
162 /*!
163  \brief Database links
164 */
165 struct dblinks
166 {
167  /*!
168  \brief Pointer to the first field_info structure
169  */
170  struct field_info *field;
171  /*!
172  \brief Number of allocated slots
173  */
175  /*!
176  \brief Number of available layers (old: fields)
177  */
178  int n_fields;
179 };
180 
181 /*!
182  \brief Portability info
183 
184  Set by V1_open_new() or V1_open_old()
185 */
186 struct Port_info
187 {
188  /*!
189  \brief File byte order
190  */
192  /*!
193  \brief Size of `off_t` data type
194  */
196 
197  /*!
198  \brief Conversion matrices between file and native byte order (double)
199  */
200  unsigned char dbl_cnvrt[PORT_DOUBLE];
201  /*!
202  \brief Conversion matrices between file and native byte order (float)
203  */
204  unsigned char flt_cnvrt[PORT_FLOAT];
205  /*!
206  \brief Conversion matrices between file and native byte order (long)
207  */
208  unsigned char lng_cnvrt[PORT_LONG];
209  /*!
210  \brief Conversion matrices between file and native byte order (int)
211  */
212  unsigned char int_cnvrt[PORT_INT];
213  /*!
214  \brief Conversion matrices between file and native byte order (short)
215  */
216  unsigned char shrt_cnvrt[PORT_SHORT];
217  /*!
218  \brief Conversion matrices between file and native byte order (off_t)
219  */
220  unsigned char off_t_cnvrt[PORT_OFF_T];
221  /*!
222  \brief Quick reading flag for double
223 
224  Specify if native byte order of that type is the same
225  as byte order of vector file (TRUE) or not (FALSE)
226  */
228  /*!
229  \brief Quick reading flag for float
230 
231  Specify if native byte order of that type is the same
232  as byte order of vector file (TRUE) or not (FALSE)
233  */
235  /*!
236  \brief Quick reading flag for long
237 
238  Specify if native byte order of that type is the same
239  as byte order of vector file (TRUE) or not (FALSE)
240  */
242  /*!
243  \brief Quick reading flag for int
244 
245  Specify if native byte order of that type is the same
246  as byte order of vector file (TRUE) or not (FALSE)
247  */
249  /*!
250  \brief Quick reading flag for short
251 
252  Specify if native byte order of that type is the same
253  as byte order of vector file (TRUE) or not (FALSE)
254  */
256  /*!
257  \brief Quick reading flag for off_t
258 
259  Specify if native byte order of that type is the same
260  as byte order of vector file (TRUE) or not (FALSE)
261  */
263 };
264 
265 /*!
266  \brief List of dead lines in the file
267 
268  \todo Implement it
269 
270  The space can be reused, not yet used
271 */
272 struct recycle
273 {
274  char dummy;
275 };
276 
277 /*! \brief Backward compatibility version info */
278 struct Version_info {
279  /*! \brief Current version (major) */
280  int major;
281  /*! \brief Current version (minor) */
282  int minor;
283  /*! \brief Earliest version that can use this data format (major) */
285  /*! \brief Earliest version that can use this data format (minor) */
287 };
288 
289 /*!
290  \brief Vector map header data
291 
292  Holds header data of vector map (see \ref vlibMap_info)
293 */
294 struct dig_head
295 {
296  /*!
297  \brief Organization name
298  */
300  /*!
301  \brief Map date
302  */
303  char *date;
304  /*!
305  \brief User name
306  */
307  char *user_name;
308  /*!
309  \brief Map name
310  */
311  char *map_name;
312  /*!
313  \brief Source date
314  */
315  char *source_date;
316  /*!
317  \brief Original scale
318  */
320  /*!
321  \brief Comments
322  */
323  char *comment;
324  int proj; /* projection */
325 
326  /*!
327  \brief Zone (UTM only)
328  */
330  /*!
331  \brief Threshold for digitization
332  */
333  double digit_thresh;
334 
335  /* Programmers should NOT touch any thing below here */
336  /* Library takes care of everything for you */
337 
338  /*! \brief Version info for coor file */
339  struct Version_info coor_version;
340 
341  /*!
342  \brief 2D/3D vector data
343 
344  - zero for 2D data
345  - non-zero for 3D data
346  */
347  int with_z;
348 
349  /*!
350  \brief Coor file size
351  */
352  off_t size;
353  /*!
354  \brief Coor header size
355  */
356  long head_size;
357 
358  /*!
359  \brief Portability information
360  */
361  struct Port_info port;
362 
363  /*!
364  \brief Offset of last read line
365  */
366  off_t last_offset;
367 
368  /*!
369  \brief Recycle dead line
370 
371  \todo Not implemented yet
372  */
373  struct recycle *recycle;
374 };
375 
376 /*!
377  \brief Coor file info
378 */
379 struct Coor_info
380 {
381  /*!
382  \brief Total size (in bytes)
383  */
384  off_t size;
385  /*!
386  \brief Time of last modification
387  */
388  long mtime;
389 };
390 
391 /*!
392  \brief Data structure used for building pseudo-topology
393 
394  See Vect__build_sfa() (Format_info_ogr and Format_info_pg) for
395  implementation issues.
396 */
398 {
399  /*!
400  \brief Offset list
401 
402  Array where feature/part info is stored for each feature in
403  GRASS. This is not used for GV_CENTROID. Because one feature may
404  contain more elements (geometry collection also recursively),
405  offset for one line may be stored in more records. First record
406  is FID, next records are part indexes if necessary.
407 
408  Example 1:
409 
410  5. ring in 3. polygon in 7. feature (multipolygon) of geometry
411  collection which has FID = 123 123 (feature 123: geometry
412  colletion) 6 (7. feature in geometry collection: multiPolygon) 2
413  (3. polygon) 4 (5. ring in the polygon)
414 
415  Example 2: geometry collection FID '1' containing one point, one
416  linestring and one polygon
417 
418  \verbatim
419  Offset:
420 
421  idx offset note
422  ----------------
423  0 1 FID
424  1 0 first part (point)
425 
426  2 1 FID
427  3 1 second part (linestring)
428 
429  4 1 FID
430  5 2 third part (polygon)
431  6 0 first ring of polygon
432 
433  GRASS topology:
434 
435  line idx
436  -----------------
437  1 0 point
438  2 2 line
439  3 4 boundary
440  4 1 centroid read from topo (idx == FID)
441 
442  In PostGIS Topology mode the offset array is used for mapping
443  nodes.
444  \endverbatim
445  */
446  int *array;
447  /*!
448  \brief Number of items in offset list
449  */
451  /*!
452  \brief Space allocated for offset list
453  */
455 
456 };
457 
458 /*!
459  \brief Lines cache for reading feature (non-native formats)
460 */
462  /*!
463  \brief Lines array
464 
465  Some simple features require more allocated lines (eg. polygon
466  with more rings, multipoint, or geometrycollection)
467 
468  Line cache is also used for PostGIS Topology to store single
469  topological element (ctype == CACHE_FEATURE) or all elements
470  from the map (ctype == CACHE_MAP) to avoid random access which
471  is very costly.
472  */
473  struct line_pnts **lines;
474  /*!
475  \brief List of line types (GV_POINT, GV_LINE, ...)
476  */
478  /*!
479  \brief List of line cats (used only for PostGIS Topology access)
480  */
482  /*!
483  \brief Number of allocated lines in cache
484  */
486  /*!
487  \brief Number of lines which forms current feature
488  */
490  /*!
491  \brief Next line to be read from cache
492  */
494  /*!
495  \brief Feature id
496  */
497  long fid;
498  /*!
499  \brief Simple feature type (currently used only by PG format)
500  */
502  /*!
503  \brief Cache type
504 
505  Currently used only by PostGIS Topology which allows caching the
506  whole map (CACHE_MAP) */
507  int ctype;
508 };
509 
510 /*!
511  \brief Non-native format info (OGR)
512 
513  \todo Structure size should not change depending on compilation I
514  think, do it better
515 */
517 {
518  /*!
519  \brief OGR driver name
520  */
521  char *driver_name;
522  /*!
523  \brief OGR datasource name
524  */
525  char *dsn;
526  /*!
527  \brief OGR layer name
528  */
529  char *layer_name;
530  /*!
531  \brief SQL where statement (to filter features)
532  */
533  char *where;
534 #ifdef HAVE_OGR
535  /*!
536  \brief Pointer to OGRDriver
537  */
538  OGRSFDriverH driver;
539  /*!
540  \brief Pointer to OGRDataSource
541  */
542  OGRDataSourceH ds;
543  /*!
544  \brief Pointer to OGRLayer
545  */
546  OGRLayerH layer;
547 #else
548  void *driver;
549  void *ds;
550  void *layer;
551 #endif
552 
553  /*!
554  \brief Open DB driver when writing attributes
555 
556  This driver is open by V2_open_new_ogr() and closed by
557  V1_close_ogr().
558  */
560 
561  /*!
562  \brief Array of OGR DSN options
563  */
564  char **dsn_options;
565  /*!
566  \brief Array of OGR layer options
567  */
569 
570  /*!
571  \brief Lines cache for reading feature
572  */
573  struct Format_info_cache cache;
574 
575  /*!
576  \brief Cache to avoid repeated reading (level 2)
577 
578  NULL if no feature is in cache
579  */
580 #ifdef HAVE_OGR
581  OGRFeatureH feature_cache;
582 #else
583  void *feature_cache;
584 #endif
585 
586  /*!
587  \brief Offset list used for building pseudo-topology
588  */
589  struct Format_info_offset offset;
590 
591  /*!
592  \brief Next line to be read
593 
594  Used by V2_read_next_line_ogr()
595  */
597 };
598 
599 /*!
600  \brief Non-native format info (PostGIS)
601 */
603 {
604  /*!
605  \brief Connection string
606  */
607  char *conninfo;
608  /*!
609  \brief Database name (derived from conninfo)
610  */
611  char *db_name;
612  /*!
613  \brief Schema name
614  */
615  char *schema_name;
616  /*!
617  \brief Table name
618  */
619  char *table_name;
620  /*!
621  \brief SQL where statement (fo filter features)
622  */
623  char *where;
624  /*!
625  \brief FID column
626  */
627  char *fid_column;
628  /*!
629  \brief Geometry column (simple feature access)
630  */
631  char *geom_column;
632  /*!
633  \brief Feature type (simple feature access)
634  */
636  /*!
637  \brief Coordinates dimension (2D or 3D)
638  */
639  int coor_dim;
640  /*!
641  \brief Spatial reference system id (see spatial_ref_sys
642  table)
643  */
644  int srid;
645 
646  /*!
647  \brief Open DB driver when writing attributes
648 
649  This driver is open by V2_open_new_pg() and closed by
650  V1_close_pg().
651  */
653  struct field_info *fi;
654 
655  /*!
656  \brief Start/Finish transaction
657  */
659 #ifdef HAVE_POSTGRES
660  /*!
661  \brief PGconn object (generated by PQconnectdb)
662  */
663  PGconn *conn;
664  PGresult *res;
665 #else
666  void *conn;
667  void *res;
668 #endif
669  /*!
670  \brief Open cursor
671  */
672  char *cursor_name;
674 
675  /*!
676  \brief Next line to be read
677  */
679 
680  /*!
681  \brief Lines cache for reading feature
682  */
683  struct Format_info_cache cache;
684 
685  /*!
686  \brief Offset list used for building pseudo-topology (simple
687  features access)
688  */
689  struct Format_info_offset offset;
690 
691  /* PostGIS topology support */
692  /*!
693  \brief TopoGeometry column (feature table)
694  */
696  /*!
697  \brief Topology schema name and id
698  */
701  /*!
702  \brief Topology format
703 
704  TRUE to store only Topo-Geo data in DB otherwise GRASS-like
705  topology is also maintained in DB
706  */
708 };
709 
710 /*!
711  \brief Non-native format info (currently only OGR is implemented)
712 */
714 {
715  /*!
716  \brief id?
717  */
718  int i;
719  /*!
720  \brief OGR info
721  */
722  struct Format_info_ogr ogr;
723  /*!
724  \brief PostGIS info
725  */
726  struct Format_info_pg pg;
727 };
728 
729 /*!
730  \brief Category index
731 */
732 struct Cat_index
733 {
734  /*!
735  \brief Field (layer) number
736  */
737  int field;
738  /*!
739  \brief Number of items in cat array
740  */
741  int n_cats;
742  /*!
743  \brief Allocated space in cat array
744  */
745  int a_cats;
746  /*!
747  \brief Array of cats (cat, type, lines/area)
748  */
749  int (*cat)[3];
750  /*!
751  \brief Number of unique cats (not updated)
752  */
753  int n_ucats;
754  /*!
755  \brief Number of types in type
756  */
757  int n_types;
758  /*!
759  \brief Number of elements for each type
760 
761  - GV_POINT
762  - GV_LINE
763  - GV_BOUNDARY
764  - GV_CENTROID
765  - GV_FACE
766  - GV_KERNEL
767  - GV_AREA
768  */
769  int type[7][2];
770  /*!
771  \brief Offset of the beginning of this index in cidx file
772  */
773  off_t offset;
774 };
775 
776 /*!
777  \brief Basic topology-related info
778 
779  Holds basic topology-related information about vector map
780 
781  Important note: you should NOT store non-topological information in
782  topological structures.
783 */
784 struct Plus_head
785 {
786  /*! \brief Backward compatibility version info */
787  struct {
788  /*! \brief Version info for topology file */
789  struct Version_info topo;
790  /*! \brief Version info for spatial index file */
791  struct Version_info spidx;
792  /*! \brief Version info for category index file */
793  struct Version_info cidx;
794  } version;
795 
796  /*!
797  \brief 2D/3D vector data
798 
799  - WITH_Z
800  - WITHOUT_Z
801  */
802  int with_z;
803  /*!
804  \brief 2D/3D spatial index
805 
806  - WITH_Z
807  - WITHOUT_Z
808  */
810 
811  /*!
812  \brief Offset size
813 
814  Because Plus_head is available to all releveant
815  functions
816  */
818 
819  /*** file header size ***/
820 
821  /*!
822  \brief Topo header size
823  */
824  long head_size;
825  /*!
826  \brief Spatial index header size
827  */
829  /*!
830  \brief Category index header size
831  */
833 
834  /*!
835  \brief Release memory occupied by support structures
836  (topo, spatial, category)
837  */
839 
840  /*** portability info */
841 
842  /*!
843  \brief Portability information
844  */
845  struct Port_info port;
846  /*!
847  \brief Portability information for spatial index
848  */
849  struct Port_info spidx_port;
850  /*!
851  \brief Portability information for category index
852  */
853  struct Port_info cidx_port;
854  /*!
855  \brief Access mode
856 
857  - GV_MODE_READ
858  - GV_MODE_WRITE
859  - GV_MODE_RW
860  */
861  int mode;
862 
863  /*!
864  \brief Highest level of topology currently available
865 
866  - GV_BUILD_NONE
867  - GV_BUILD_BASE
868  - GV_BUILD_AREAS
869  - GV_BUILD_ATTACH_ISLES
870  - GV_BUILD_CENTROIDS
871  - GV_BUILD_ALL
872  */
873  int built;
874  /*!
875  \brief Bounding box of features
876  */
877  struct bound_box box;
878 
879  /*** topology ***/
880  /*!
881  \brief Array of nodes
882  */
883  struct P_node **Node;
884  /*!
885  \brief Array of vector geometries
886  */
887  struct P_line **Line;
888  /*!
889  \brief Array of areas
890  */
891  struct P_area **Area;
892  /*!
893  \brief Array of isles
894  */
895  struct P_isle **Isle;
896 
897  /* add here P_FACE, P_VOLUME, P_HOLE */
898 
899  /*!
900  \brief Current number of points
901  */
903  /*!
904  \brief Current number of lines
905  */
907  /*!
908  \brief Current number of boundaries
909  */
911  /*!
912  \brief Current number of centroids
913  */
915  /*!
916  \brief Current number of faces
917  */
919  /*!
920  \brief Current number of kernels
921  */
923  /*!
924  \brief Current number of volume faces
925  */
927  /*!
928  \brief Current number of hole faces
929  */
931 
932  /*!
933  \brief Current number of topological features derived from vector
934  geometries
935  */
936  /*!
937  \brief Current number of nodes
938  */
940  /*!
941  \brief Current number of edges
942  */
944  /*!
945  \brief Current number of lines
946  */
948  /*!
949  \brief Current number of areas
950  */
952  /*!
953  \brief Current number of isles
954  */
956  /*!
957  \brief Current number of faces
958  */
960  /*!
961  \brief Current number of volumes
962  */
964  /*!
965  \brief Current number of holes
966  */
968 
969  /*!
970  \brief Number of allocated nodes
971 
972  i.e. array size - 1
973  */
975  /*!
976  \brief Number of allocated edges
977 
978  i.e. array size - 1
979  */
981  /*!
982  \brief Number of allocated lines
983 
984  i.e. array size - 1
985  */
987  /*!
988  \brief Number of allocated areas
989 
990  i.e. array size - 1
991  */
993  /*!
994  \brief Number of allocated isles
995 
996  i.e. array size - 1
997  */
999  /*!
1000  \brief Number of allocated faces
1001 
1002  i.e. array size - 1
1003  */
1005  /*!
1006  \brief Number of allocated volumes
1007 
1008  i.e. array size - 1
1009  */
1011  /*!
1012  \brief Number of allocated holes
1013 
1014  i.e. array size - 1
1015  */
1017 
1018  /*!
1019  \brief Offset of array of nodes in topo file
1020  */
1022  /*!
1023  \brief Offset of array of edges in topo file
1024  */
1026  /*!
1027  \brief Offset of array of vector geometries in topo file
1028  */
1030  /*!
1031  \brief Offset of array of areas in topo file
1032  */
1034  /*!
1035  \brief Offset of array of isles in topo file
1036  */
1038  /*!
1039  \brief Offset of array of volumes in topo file
1040  */
1042  /*!
1043  \brief Offset of array of holes in topo file
1044  */
1046 
1047  /*** spatial index ***/
1048  /*!
1049  \brief Spatial index built?
1050 
1051  Set to 1 if spatial index is available
1052  */
1054  /*!
1055  \brief Build new spatial index
1056 
1057  Set to 1 if new spatial index will be generated
1058  */
1060  /*!
1061  \brief Build new spatial index in file
1062 
1063  Set to 1 to build new indices in file
1064  */
1066 
1067  /*!
1068  \brief Spatial index file pointer
1069  */
1070  struct gvfile spidx_fp;
1071 
1072  /*!
1073  \brief Offset of nodes in sidx file
1074  */
1076  /*!
1077  \brief Offset of lines in sidx file
1078  */
1080  /*!
1081  \brief Offset of areas in sidx file
1082  */
1084  /*!
1085  \brief Offset of isles in sidx file
1086  */
1088  /*!
1089  \brief Offset of faces in sidx file
1090  */
1092  /*!
1093  \brief Offset of volumes in sidx file
1094  */
1096  /*!
1097  \brief Offset of holes in sidx file
1098  */
1100 
1101  /*!
1102  \brief Node spatial index
1103  */
1105  /*!
1106  \brief Line spatial index
1107  */
1109  /*!
1110  \brief Area spatial index
1111  */
1113  /*!
1114  \brief Isles spatial index
1115  */
1117  /*!
1118  \brief Faces spatial index
1119  */
1121  /*!
1122  \brief Volumes spatial index
1123  */
1125  /*!
1126  \brief Holes spatial index
1127  */
1129 
1130  /*** category index ***/
1131  /*!
1132  \brief Update category index if vector is modified
1133 
1134  By default, category index is not updated
1135  */
1137 
1138  /*!
1139  \brief Number of category indexes (one for each field/layer)
1140  */
1141  int n_cidx;
1142  /*!
1143  \brief Allocated space for category indexes
1144  */
1145  int a_cidx;
1146  /*!
1147  \brief Array of category indexes
1148  */
1149  struct Cat_index *cidx;
1150  /*!
1151  \brief Category index to be updated
1152 
1153  Set to 1 when cidx is created
1154  and reset to 0 whenever any line is changed
1155  */
1157 
1158  /*!
1159  \brief Size of coor file
1160  */
1161  off_t coor_size;
1162  /*!
1163  \brief Time of last coor modification
1164  */
1166 
1167  /*** level 2 ***/
1168  /*!
1169  \brief List of updated lines/nodes
1170 
1171  Note: Vect_set_updated() must be called to maintain this list
1172  */
1173  struct {
1174  /*!
1175  \brief Indicates if the list of updated features is maintained
1176  */
1178 
1179  /*!
1180  \brief Array of updated lines
1181 
1182  List of lines and nodes updated (topo info for the line was
1183  changed) by last write/rewrite/delete operation.
1184  Lines/nodes in the list may be deleted (e.g. delete
1185  boundary: first added for delete area and then delete
1186  */
1187  int *uplines;
1188  /*!
1189  \brief Array of updated lines - offset
1190 
1191  Negative value for dead (deleted) lines - used by Vect_restore_line()
1192  */
1194  /*!
1195  \brief Allocated array of lines
1196  */
1198  /*!
1199  \brief Number of updated lines
1200  */
1202  /*!
1203  \brief Array of updated nodes
1204  */
1205  int *upnodes;
1206  /*!
1207  \brief Allocated array of nodes
1208  */
1210  /*!
1211  \brief number of updated nodes
1212  */
1214  } uplist;
1215 };
1216 
1217 /*!
1218  \brief Graph-related section (see \ref dglib)
1219 */
1220 struct Graph_info {
1221  /*!
1222  \brief Line type used to build the graph
1223  */
1225  /*!
1226  \brief Graph structure
1227  */
1229  /*!
1230  \brief Shortest path cache
1231  */
1233  /*!
1234  \brief Forward costs used for graph
1235 
1236  dglGetEdge() is not supported for _DGL_V1)
1237  */
1238  double *edge_fcosts;
1239  /*!
1240  \brief backward costs used for graph
1241  */
1242  double *edge_bcosts;
1243  /*!
1244  \brief Node costs used for graph
1245  */
1246  double *node_costs;
1247  /*!
1248  \brief Edge and node costs multiplicator
1249  */
1251 };
1252 
1253 /*! \brief
1254  Vector map info
1255 
1256  Maintains all information about an individual open vector map. The
1257  structure must be passed to the most vector library routines.
1258 */
1259 struct Map_info
1260 {
1261  /*** common info for all formats ***/
1262 
1263  /*!
1264  \brief Map format (native, ogr, postgis)
1265 
1266  - GV_FORMAT_NATIVE
1267  - GV_FORMAT_OGR
1268  - GV_FORMAT_OGR_DIRECT
1269  - GV_FORMAT_POSTGIS
1270  */
1271  int format;
1272 
1273  /*!
1274  \brief Temporary map flag
1275  */
1277 
1278  /*!
1279  \brief Array of DB links
1280  */
1281  struct dblinks *dblnk;
1282 
1283  /*!
1284  \brief Plus info (topology, version, ...)
1285  */
1286  struct Plus_head plus;
1287 
1288  /*!
1289  \brief Open indicator
1290 
1291  Should be 0x5522AA22 (VECT_OPEN_CODE) if opened correctly
1292  or 0x22AA2255 (VECT_CLOSED_CODE) if closed
1293 
1294  Anything else implies that structure has never been initialized
1295  */
1296  int open;
1297 
1298  /* Open mode
1299 
1300  - read (GV_MODE_READ),
1301  - write (GV_MODE_WRITE),
1302  - rw (GV_MODE_RW)
1303  */
1304  int mode;
1305 
1306  /*!
1307  \brief Topology level
1308 
1309  - 1 (without topo)
1310  - 2 (with 2D topology)
1311  - 3 (with 3D topology) - not yet implemented
1312  */
1313  int level;
1314 
1315  /*!
1316  \brief Open only header
1317 
1318  Non-zero code to open only header of vector map
1319  */
1321 
1322  /*!
1323  \brief Support files were updated
1324 
1325  Non-zero code to indicate that supoort file were updated
1326  */
1328 
1329  /*!
1330  \brief Map name (for 4.0)
1331  */
1332  char *name;
1333  /*!
1334  \brief Mapset name
1335  */
1336  char *mapset;
1337  /*!
1338  \brief Location name
1339 
1340  Note: location and gisdbase is useful if changed (v.proj or external apps)
1341  */
1342  char *location;
1343  /*!
1344  \brief GISDBASE path
1345  */
1346  char *gisdbase;
1347 
1348  /*!
1349  \brief Feature id for sequential access
1350 
1351  Note: Line id starts with 1 - see Vect_read_next_line()
1352  */
1354 
1355  /*!
1356  \brief Constraints for sequential feature access
1357  */
1358  struct {
1359  /*!
1360  \brief Non-zero value to enable region constraint
1361  */
1363  /*!
1364  \brief Region (bbox) constraint
1365  */
1366  struct bound_box box;
1367  /*!
1368  \brief Non-zero value to enable feature type constraint
1369  */
1371  /*!
1372  \brief Feature type constraint
1373  */
1374  int type;
1375  /*!
1376  \brief Non-zero value to enable field constraint
1377  */
1379  /*!
1380  \brief Field number constraint (see line_cats structure)
1381  */
1382  int field;
1383  } constraint;
1384 
1385  /*!
1386  \brief ???
1387  */
1388  int proj;
1389 
1390  /*!
1391  \brief History file
1392  */
1393  FILE *hist_fp;
1394 
1395  /*!
1396  \brief Graph info (built for network analysis)
1397  */
1398  struct Graph_info dgraph;
1399 
1400  /*!
1401  \brief Header info
1402  */
1403  struct dig_head head;
1404 
1405  /*** format specific ***/
1406 
1407  /*!
1408  \brief GV file pointer (native format only)
1409  */
1410  struct gvfile dig_fp;
1411 
1412  /*!
1413  \brief Format info for non-native formats
1414  */
1415  struct Format_info fInfo;
1416 
1417  /* temporary solution for sites - to be removed ?*/
1418 
1419  /*!
1420  \brief Array of attributes loaded from db
1421 
1422  \todo To be removed?
1423  */
1425  /*!
1426  \brief Number of attributes in site_att array
1427 
1428  \todo To be removed?
1429  */
1431  /*!
1432  \brief Number of double attributes for one site
1433 
1434  \todo To be removed
1435  */
1437  /*!
1438  \brief Number of string attributes for one site
1439 
1440  \todo To be removed?
1441  */
1443 };
1444 
1445 /*!
1446  \brief Topological feature - node
1447 */
1448 struct P_node
1449 {
1450  /*!
1451  \brief X coordinate
1452  */
1453  double x;
1454  /*!
1455  \brief Y coordinate
1456  */
1457  double y;
1458  /*!
1459  \brief Z coordinate (used only for 3D data)
1460  */
1461  double z;
1462  /*!
1463  \brief Allocated space for lines
1464  */
1466  /*!
1467  \brief Number of attached lines (size of
1468  lines, angle)
1469 
1470  If 0, then is degenerate node, for snapping ???
1471  */
1473  /*!
1474  \brief List of connected lines
1475 
1476  Line id can be positive (for lines which starts at the node) or
1477  negative (for lines which ends at the node).
1478  */
1480  /*!
1481  \brief List of angles of connected lines
1482 
1483  Angles for lines/boundaries are in radians between -PI and
1484  PI. Value for points or lines with identical points
1485  (degenerated) is set to -9. See dig_calc_begin_angle() and
1486  dig_calc_end_angle() for details.
1487  */
1488  float *angles;
1489 };
1490 
1491 /*!
1492  \brief Line topology
1493 */
1494 struct P_topo_l
1495 {
1496  /*!
1497  \brief Start node
1498  */
1500  /*!
1501  \brief End node
1502  */
1504 };
1505 
1506 /*!
1507  \brief Boundary topology
1508 */
1509 struct P_topo_b
1510 {
1511  /*!
1512  \brief Start node
1513  */
1515  /*!
1516  \brief End node
1517  */
1519  /*!
1520  \brief Area number to the left, negative for isle
1521  */
1523  /*!
1524  \brief Area number to the right, negative for isle
1525  */
1527 };
1528 
1529 /*!
1530  \brief Centroid topology
1531 */
1532 struct P_topo_c
1533 {
1534  /*!
1535  \brief Area number, negative for duplicate centroid
1536  */
1538 };
1539 
1540 /*!
1541  \brief Face topology
1542 */
1543 struct P_topo_f
1544 {
1545  /* TODO */
1546  /*!
1547  \brief Array of edges
1548  */
1549  plus_t E[3];
1550  /*!
1551  \brief Volume number to the left, negative for hole
1552  */
1554  /*!
1555  \brief Volume number to the right, negative for hole
1556  */
1558 };
1559 
1560 /*!
1561  \brief Kernel topology
1562 */
1563 struct P_topo_k
1564 {
1565  /*!
1566  \brief Volume number, negative for duplicate kernel
1567  */
1569 };
1570 
1571 /*!
1572  \brief Vector geometry
1573 */
1574 struct P_line
1575 {
1576  /*!
1577  \brief Line type
1578 
1579  - GV_POINT
1580  - GV_LINE
1581  - GV_BOUNDARY
1582  - GV_CENTROID
1583  - GV_FACE
1584  - GV_KERNEL
1585  */
1586  char type;
1587  /*!
1588  \brief Offset in coor file for line
1589 
1590  OGR-links: offset array index
1591  PG-links: node/edge id
1592  */
1593  off_t offset;
1594  /*!
1595  \brief Topology info
1596 
1597  NULL for points
1598  */
1599  void *topo;
1600 };
1601 
1602 /*!
1603  \brief Area (topology) info
1604 */
1605 struct P_area
1606 {
1607  /*!
1608  \brief Number of boundary lines
1609  */
1611  /*!
1612  \brief Allocated space for lines
1613  */
1615  /*!
1616  \brief List of boundary lines
1617 
1618  - negative means direction N2 to N1
1619  - lines are in clockwise order
1620  */
1622 
1623  /********* Above this line is compatible with P_isle **********/
1624 
1625  /*!
1626  \brief Number of first centroid within area
1627  */
1629  /*!
1630  \brief Number of islands inside
1631  */
1633  /*!
1634  \brief Allocated space for isles
1635  */
1637  /*!
1638  \brief 1st generation interior islands
1639  */
1641 };
1642 
1643 /*!
1644  \brief Isle (topology) info
1645 */
1646 struct P_isle
1647 {
1648  /*!
1649  \brief Number of boundary lines
1650  */
1652  /*!
1653  \brief Allocated space for lines
1654  */
1656  /*!
1657  \brief List of boundary lines
1658 
1659  - negative means direction N2 to N1
1660  - lines are in counter clockwise order
1661  */
1663 
1664  /********* Above this line is compatible with P_area **********/
1665 
1666  /*!
1667  \brief Area it exists w/in, if any
1668  */
1670 };
1671 
1672 /*!
1673  \brief Feature geometry info - coordinates
1674 */
1676 {
1677  /*!
1678  \brief Array of X coordinates
1679  */
1680  double *x;
1681  /*!
1682  \brief Array of Y coordinates
1683  */
1684  double *y;
1685  /*!
1686  \brief Array of Z coordinates
1687  */
1688  double *z;
1689  /*!
1690  \brief Number of points
1691  */
1693  /*!
1694  \brief Allocated space for points
1695  */
1697 };
1698 
1699 /*!
1700  \brief Feature category info
1701 */
1703 {
1704  /*!
1705  \brief Array of layers (fields)
1706  */
1707  int *field;
1708  /*!
1709  \brief Array of categories
1710  */
1711  int *cat;
1712  /*!
1713  \brief Number of categories attached to element
1714  */
1715  int n_cats;
1716  /*!
1717  \brief Allocated space for categories
1718  */
1720 };
1721 
1722 /*! \brief Category list */
1723 struct cat_list
1724 {
1725  /*!
1726  \brief Category layer (field)
1727  */
1728  int field;
1729  /*!
1730  \brief Array of minimum values
1731  */
1732  int *min;
1733  /*!
1734  \brief Array of maximum values
1735  */
1736  int *max;
1737  /*!
1738  \brief Number of ranges
1739  */
1741  /*!
1742  \brief Allocated space for ranges
1743  */
1745 };
1746 
1747 /*!
1748  \brief List of bounding boxes with id
1749 */
1750 struct boxlist
1751 {
1752  /*!
1753  \brief Array of ids
1754  */
1755  int *id;
1756  /*!
1757  \brief Array of bounding boxes
1758  */
1759  struct bound_box *box;
1760  /*!
1761  \brief flag to indicate whether bounding boxes should be added
1762  */
1764  /*!
1765  \brief Number of items in the list
1766  */
1768  /*!
1769  \brief Allocated space for items
1770  */
1772 };
1773 
1774 /*!
1775  \brief Vector array
1776 
1777  Space allocated is size + 1
1778 */
1779 struct varray
1780 {
1781  /*!
1782  \brief Array size
1783  */
1784  int size;
1785  /*!
1786  \brief Array
1787 
1788  Where 'class' or new category
1789  or something like that is stored
1790  */
1791  int *c;
1792 };
1793 
1794 /*!
1795  \brief Spatial index info
1796 
1797  For use in modules
1798 */
1800 {
1801  /*!
1802  \brief Pointer to the search tree (R*-Tree)
1803  */
1804  struct RTree *si_tree;
1805  /*!
1806  \brief Name of file to store the search tree
1807  */
1808  char *name;
1809 };
1810 
1811 #endif /* DIG___STRUCTS___ */
#define PORT_FLOAT
Definition: dig_defines.h:46
char * toposchema_name
Topology schema name and id.
Definition: dig_structs.h:699
int * array
Offset list.
Definition: dig_structs.h:446
int Spidx_new
Build new spatial index.
Definition: dig_structs.h:1059
plus_t n_areas
Current number of areas.
Definition: dig_structs.h:951
plus_t right
Volume number to the right, negative for hole.
Definition: dig_structs.h:1557
plus_t n_hfaces
Current number of hole faces.
Definition: dig_structs.h:930
#define PORT_SHORT
Definition: dig_defines.h:49
char * name
Map name (for 4.0)
Definition: dig_structs.h:1332
Bounding box.
Definition: dig_structs.h:65
int flt_quick
Quick reading flag for float.
Definition: dig_structs.h:234
off_t coor_size
Size of coor file.
Definition: dig_structs.h:1161
int plus_t
plus_t size
Definition: dig_structs.h:41
int built
Highest level of topology currently available.
Definition: dig_structs.h:873
plus_t alloc_nodes
Number of allocated nodes.
Definition: dig_structs.h:974
plus_t area
Area number, negative for duplicate centroid.
Definition: dig_structs.h:1537
char * name
Name of file to store the search tree.
Definition: dig_structs.h:1808
int a_cidx
Allocated space for category indexes.
Definition: dig_structs.h:1145
unsigned char lng_cnvrt[sizeof(long)]
Definition: port_init.c:127
int * id
Array of ids.
Definition: dig_structs.h:1755
int alloc_ranges
Allocated space for ranges.
Definition: dig_structs.h:1744
int alloc_points
Allocated space for points.
Definition: dig_structs.h:1696
int n_uplines
Number of updated lines.
Definition: dig_structs.h:1201
int open
Open indicator.
Definition: dig_structs.h:1296
struct RTree * Face_spidx
Faces spatial index.
Definition: dig_structs.h:1120
int dbl_quick
Quick reading flag for double.
Definition: dig_structs.h:227
plus_t n_klines
Current number of kernels.
Definition: dig_structs.h:922
double W
West.
Definition: dig_structs.h:82
plus_t n_holes
Current number of holes.
Definition: dig_structs.h:967
off_t offset
Offset in coor file for line.
Definition: dig_structs.h:1593
plus_t alloc_faces
Number of allocated faces.
Definition: dig_structs.h:1004
off_t Area_offset
Offset of array of areas in topo file.
Definition: dig_structs.h:1033
off_t Isle_spidx_offset
Offset of isles in sidx file.
Definition: dig_structs.h:1087
OGRSFDriverH driver
Pointer to OGRDriver.
Definition: dig_structs.h:538
struct RTree * Hole_spidx
Holes spatial index.
Definition: dig_structs.h:1128
PGconn * conn
PGconn object (generated by PQconnectdb)
Definition: dig_structs.h:663
int n_types
Number of types in type.
Definition: dig_structs.h:757
int back_major
Earliest version that can use this data format (major)
Definition: dig_structs.h:284
off_t size
Total size (in bytes)
Definition: dig_structs.h:384
int size
Array size.
Definition: dig_structs.h:1784
Vector geometry.
Definition: dig_structs.h:1574
OGRDataSourceH ds
Pointer to OGRDataSource.
Definition: dig_structs.h:542
char * date
Map date.
Definition: dig_structs.h:303
struct P_line ** Line
Array of vector geometries.
Definition: dig_structs.h:887
off_t Isle_offset
Offset of array of isles in topo file.
Definition: dig_structs.h:1037
int spidx_with_z
2D/3D spatial index
Definition: dig_structs.h:809
int region_flag
Non-zero value to enable region constraint.
Definition: dig_structs.h:1362
int shrt_quick
Quick reading flag for short.
Definition: dig_structs.h:255
int with_z
2D/3D vector data
Definition: dig_structs.h:802
Isle (topology) info.
Definition: dig_structs.h:1646
SF_FeatureType feature_type
Feature type (simple feature access)
Definition: dig_structs.h:635
off_t offset
Offset of the beginning of this index in cidx file.
Definition: dig_structs.h:773
plus_t n_plines
Current number of points.
Definition: dig_structs.h:902
plus_t right
Area number to the right, negative for isle.
Definition: dig_structs.h:1526
int * uplines
Array of updated lines.
Definition: dig_structs.h:1187
struct P_area ** Area
Array of areas.
Definition: dig_structs.h:891
struct P_node ** Node
Array of nodes.
Definition: dig_structs.h:883
Graph-related section (see GRASS Directed Graph Library)
Definition: dig_structs.h:1220
struct RTree * Isle_spidx
Isles spatial index.
Definition: dig_structs.h:1116
int mode
Access mode.
Definition: dig_structs.h:861
long cidx_head_size
Category index header size.
Definition: dig_structs.h:832
char * current
Current position set by dig_seek()
Definition: dig_structs.h:109
long fid
Feature id.
Definition: dig_structs.h:497
char * end
End of file in the memory (pointer to first byte after)
Definition: dig_structs.h:113
double x
X coordinate.
Definition: dig_structs.h:1453
int release_support
Release memory occupied by support structures (topo, spatial, category)
Definition: dig_structs.h:838
int alloc_cats
Allocated space for categories.
Definition: dig_structs.h:1719
int n_points
Number of points.
Definition: dig_structs.h:1692
char dummy
Definition: dig_structs.h:274
int off_t_size
Size of off_t data type.
Definition: dig_structs.h:195
char * table
Name of DB table.
Definition: dig_structs.h:155
struct RTree * Node_spidx
Node spatial index.
Definition: dig_structs.h:1104
plus_t n_lines
Number of attached lines (size of lines, angle)
Definition: dig_structs.h:1472
char * location
Location name.
Definition: dig_structs.h:1342
double * edge_fcosts
Forward costs used for graph.
Definition: dig_structs.h:1238
plus_t alloc_volumes
Number of allocated volumes.
Definition: dig_structs.h:1010
plus_t n_faces
Current number of faces.
Definition: dig_structs.h:959
plus_t left
Area number to the left, negative for isle.
Definition: dig_structs.h:1522
int * lines_cats
List of line cats (used only for PostGIS Topology access)
Definition: dig_structs.h:481
char * source_date
Source date.
Definition: dig_structs.h:315
int * min
Array of minimum values.
Definition: dig_structs.h:1732
Category index.
Definition: dig_structs.h:732
char * dsn
OGR datasource name.
Definition: dig_structs.h:525
off_t Line_offset
Offset of array of vector geometries in topo file.
Definition: dig_structs.h:1029
double E
East.
Definition: dig_structs.h:78
struct P_isle ** Isle
Array of isles.
Definition: dig_structs.h:895
int field
Field (layer) number.
Definition: dig_structs.h:737
int proj
???
Definition: dig_structs.h:1388
char ** layer_options
Array of OGR layer options.
Definition: dig_structs.h:568
plus_t * lines
List of connected lines.
Definition: dig_structs.h:1479
long mtime
Time of last modification.
Definition: dig_structs.h:388
int inTransaction
Start/Finish transaction.
Definition: dig_structs.h:658
plus_t * isles
1st generation interior islands
Definition: dig_structs.h:1640
struct RTree * Line_spidx
Line spatial index.
Definition: dig_structs.h:1108
plus_t n_isles
Current number of isles.
Definition: dig_structs.h:955
plus_t centroid
Number of first centroid within area.
Definition: dig_structs.h:1628
struct RTree * Volume_spidx
Volumes spatial index.
Definition: dig_structs.h:1124
int level
Topology level.
Definition: dig_structs.h:1313
Vector array.
Definition: dig_structs.h:1779
off_t alloc
Allocated space.
Definition: dig_structs.h:121
char * table_name
Table name.
Definition: dig_structs.h:619
int do_uplist
Indicates if the list of updated features is maintained.
Definition: dig_structs.h:1177
struct Cat_index * cidx
Array of category indexes.
Definition: dig_structs.h:1149
plus_t n_lines
Number of boundary lines.
Definition: dig_structs.h:1651
dbDriver * dbdriver
Open DB driver when writing attributes.
Definition: dig_structs.h:652
int plani_zone
Zone (UTM only)
Definition: dig_structs.h:329
#define PORT_LONG
Definition: dig_defines.h:47
char * db_name
Database name (derived from conninfo)
Definition: dig_structs.h:611
double * edge_bcosts
backward costs used for graph
Definition: dig_structs.h:1242
plus_t N1
Start node.
Definition: dig_structs.h:1514
int type
Feature type constraint.
Definition: dig_structs.h:1374
int Spidx_built
Spatial index built?
Definition: dig_structs.h:1053
int n_values
Number of items in the list.
Definition: dig_structs.h:1767
struct bound_box * box
Array of bounding boxes.
Definition: dig_structs.h:1759
char * topogeom_column
TopoGeometry column (feature table)
Definition: dig_structs.h:695
int int_quick
Quick reading flag for int.
Definition: dig_structs.h:248
off_t Volume_offset
Offset of array of volumes in topo file.
Definition: dig_structs.h:1041
plus_t N2
End node.
Definition: dig_structs.h:1503
char * database
Definition: dig_structs.h:151
#define PORT_OFF_T
Definition: dig_defines.h:51
int lines_num
Number of lines which forms current feature.
Definition: dig_structs.h:489
off_t Area_spidx_offset
Offset of areas in sidx file.
Definition: dig_structs.h:1083
plus_t n_lines
Current number of lines.
Definition: dig_structs.h:947
#define PORT_DOUBLE
Sizes of types used in portable format (different names used in Vlib/ and diglib/ for the same thing)...
Definition: dig_defines.h:45
int n_ranges
Number of ranges.
Definition: dig_structs.h:1740
plus_t alloc_areas
Number of allocated areas.
Definition: dig_structs.h:992
Feature category info.
Definition: dig_structs.h:1702
int n_ucats
Number of unique cats (not updated)
Definition: dig_structs.h:753
struct RTree * si_tree
Pointer to the search tree (R*-Tree)
Definition: dig_structs.h:1804
double N
North.
Definition: dig_structs.h:70
plus_t N1
Start node.
Definition: dig_structs.h:1499
plus_t alloc_lines
Allocated space for lines.
Definition: dig_structs.h:1655
Layer (old: field) information.
Definition: dig_structs.h:134
plus_t alloc_lines
Allocated space for lines.
Definition: dig_structs.h:1465
off_t Hole_offset
Offset of array of holes in topo file.
Definition: dig_structs.h:1045
double * x
Array of X coordinates.
Definition: dig_structs.h:1680
char type
Line type.
Definition: dig_structs.h:1586
Vector map header data.
Definition: dig_structs.h:294
double z
Z coordinate (used only for 3D data)
Definition: dig_structs.h:1461
int cidx_up_to_date
Category index to be updated.
Definition: dig_structs.h:1156
Feature geometry info - coordinates.
Definition: dig_structs.h:1675
int with_z
2D/3D vector data
Definition: dig_structs.h:347
char * name
Layer name (optional)
Definition: dig_structs.h:143
int field_flag
Non-zero value to enable field constraint.
Definition: dig_structs.h:1378
off_t Edge_offset
Offset of array of edges in topo file.
Definition: dig_structs.h:1025
Centroid topology.
Definition: dig_structs.h:1532
int off_t_size
Offset size.
Definition: dig_structs.h:817
int i
id?
Definition: dig_structs.h:718
plus_t * lines
List of boundary lines.
Definition: dig_structs.h:1621
off_t * uplines_offset
Array of updated lines - offset.
Definition: dig_structs.h:1193
int loaded
Is file loaded?
Definition: dig_structs.h:128
plus_t next_line
Feature id for sequential access.
Definition: dig_structs.h:1353
int cat
Category number.
Definition: dig_structs.h:51
int ctype
Cache type.
Definition: dig_structs.h:507
Basic topology-related info.
Definition: dig_structs.h:784
off_t Node_offset
Offset of array of nodes in topo file.
Definition: dig_structs.h:1021
int alloc_upnodes
Allocated array of nodes.
Definition: dig_structs.h:1209
Data structure used for building pseudo-topology.
Definition: dig_structs.h:397
int major
Current version (major)
Definition: dig_structs.h:280
dglGraph_s graph_s
Graph structure.
Definition: dig_structs.h:1228
int n_cats
Number of items in cat array.
Definition: dig_structs.h:741
Non-native format info (PostGIS)
Definition: dig_structs.h:602
plus_t alloc_lines
Number of allocated lines.
Definition: dig_structs.h:986
char * geom_column
Geometry column (simple feature access)
Definition: dig_structs.h:631
Line topology.
Definition: dig_structs.h:1494
int n_site_str
Number of string attributes for one site.
Definition: dig_structs.h:1442
void * topo
Topology info.
Definition: dig_structs.h:1599
int n_upnodes
number of updated nodes
Definition: dig_structs.h:1213
int lines_alloc
Number of allocated lines in cache.
Definition: dig_structs.h:485
int Spidx_file
Build new spatial index in file.
Definition: dig_structs.h:1065
float * angles
List of angles of connected lines.
Definition: dig_structs.h:1488
int field
Category layer (field)
Definition: dig_structs.h:1728
struct RTree * Area_spidx
Area spatial index.
Definition: dig_structs.h:1112
char * cursor_name
Open cursor.
Definition: dig_structs.h:672
Boundary topology.
Definition: dig_structs.h:1509
int next_line
Next line to be read.
Definition: dig_structs.h:596
unsigned char off_t_cnvrt[sizeof(off_t)]
Definition: port_init.c:126
int n_cats
Number of categories attached to element.
Definition: dig_structs.h:1715
int * cat
Array of categories.
Definition: dig_structs.h:1711
char ** str
Array of string attributes.
Definition: dig_structs.h:59
plus_t * lines
List of boundary lines.
Definition: dig_structs.h:1662
Category list.
Definition: dig_structs.h:1723
double B
Bottom.
Definition: dig_structs.h:90
struct recycle * recycle
Recycle dead line.
Definition: dig_structs.h:373
const struct driver * driver
Definition: driver/init.c:25
unsigned char dbl_cnvrt[sizeof(double)]
Definition: port_init.c:124
Non-native format info (OGR)
Definition: dig_structs.h:516
struct field_info * fi
Definition: dig_structs.h:653
char * map_name
Map name.
Definition: dig_structs.h:311
long orig_scale
Original scale.
Definition: dig_structs.h:319
int alloc_uplines
Allocated array of lines.
Definition: dig_structs.h:1197
int next_line
Next line to be read.
Definition: dig_structs.h:678
Used by sites lib.
Definition: dig_structs.h:46
long spidx_head_size
Spatial index header size.
Definition: dig_structs.h:828
Topological feature - node.
Definition: dig_structs.h:1448
struct site_att * site_att
Array of attributes loaded from db.
Definition: dig_structs.h:1424
off_t size
Size of the file loaded to memory.
Definition: dig_structs.h:117
int topo_geo_only
Topology format.
Definition: dig_structs.h:707
double T
Top.
Definition: dig_structs.h:86
Lines cache for reading feature (non-native formats)
Definition: dig_structs.h:461
char * mapset
Mapset name.
Definition: dig_structs.h:1336
char * comment
Comments.
Definition: dig_structs.h:323
plus_t n_vfaces
Current number of volume faces.
Definition: dig_structs.h:926
int type_flag
Non-zero value to enable feature type constraint.
Definition: dig_structs.h:1370
int head_only
Open only header.
Definition: dig_structs.h:1320
dglSPCache_s spCache
Shortest path cache.
Definition: dig_structs.h:1232
plus_t n_flines
Current number of faces.
Definition: dig_structs.h:918
plus_t n_isles
Number of islands inside.
Definition: dig_structs.h:1632
plus_t left
Volume number to the left, negative for hole.
Definition: dig_structs.h:1553
plus_t alloc_isles
Allocated space for isles.
Definition: dig_structs.h:1636
Face topology.
Definition: dig_structs.h:1543
int off_t_quick
Quick reading flag for off_t.
Definition: dig_structs.h:262
int array_num
Number of items in offset list.
Definition: dig_structs.h:450
plus_t alloc_holes
Number of allocated holes.
Definition: dig_structs.h:1016
int srid
Spatial reference system id (see spatial_ref_sys table)
Definition: dig_structs.h:644
int * lines_types
List of line types (GV_POINT, GV_LINE, ...)
Definition: dig_structs.h:477
plus_t alloc_lines
Allocated space for lines.
Definition: dig_structs.h:1614
int array_alloc
Space allocated for offset list.
Definition: dig_structs.h:454
double y
Y coordinate.
Definition: dig_structs.h:1457
char * organization
Organization name.
Definition: dig_structs.h:299
int support_updated
Support files were updated.
Definition: dig_structs.h:1327
Backward compatibility version info.
Definition: dig_structs.h:278
Vector map info.
Definition: dig_structs.h:1259
off_t Line_spidx_offset
Offset of lines in sidx file.
Definition: dig_structs.h:1079
off_t size
Coor file size.
Definition: dig_structs.h:352
int byte_order
File byte order.
Definition: dig_structs.h:191
long coor_mtime
Time of last coor modification.
Definition: dig_structs.h:1165
int have_boxes
flag to indicate whether bounding boxes should be added
Definition: dig_structs.h:1763
double * y
Array of Y coordinates.
Definition: dig_structs.h:1684
plus_t n_llines
Current number of lines.
Definition: dig_structs.h:906
struct dblinks * dblnk
Array of DB links.
Definition: dig_structs.h:1281
Area (topology) info.
Definition: dig_structs.h:1605
int n_site_att
Number of attributes in site_att array.
Definition: dig_structs.h:1430
char * driver
Name of DB driver (&#39;sqlite&#39;, &#39;dbf&#39;, ...)
Definition: dig_structs.h:147
char * layer_name
OGR layer name.
Definition: dig_structs.h:529
Kernel topology.
Definition: dig_structs.h:1563
FILE * file
File descriptor.
Definition: dig_structs.h:101
OGRFeatureH feature_cache
Cache to avoid repeated reading (level 2)
Definition: dig_structs.h:581
int n_site_dbl
Number of double attributes for one site.
Definition: dig_structs.h:1436
int alloc_values
Allocated space for items.
Definition: dig_structs.h:1771
plus_t alloc_edges
Number of allocated edges.
Definition: dig_structs.h:980
unsigned char int_cnvrt[sizeof(int)]
Definition: port_init.c:128
double digit_thresh
Threshold for digitization.
Definition: dig_structs.h:333
int temporary
Temporary map flag.
Definition: dig_structs.h:1276
int a_cats
Allocated space in cat array.
Definition: dig_structs.h:745
char ** dsn_options
Array of OGR DSN options.
Definition: dig_structs.h:564
char * conninfo
Connection string.
Definition: dig_structs.h:607
List of bounding boxes with id.
Definition: dig_structs.h:1750
Coor file info.
Definition: dig_structs.h:379
int lines_next
Next line to be read from cache.
Definition: dig_structs.h:493
unsigned char shrt_cnvrt[sizeof(short)]
Definition: port_init.c:129
int cost_multip
Edge and node costs multiplicator.
Definition: dig_structs.h:1250
int number
Layer number.
Definition: dig_structs.h:139
PGresult * res
Definition: dig_structs.h:664
off_t Volume_spidx_offset
Offset of volumes in sidx file.
Definition: dig_structs.h:1095
double S
South.
Definition: dig_structs.h:74
char * driver_name
OGR driver name.
Definition: dig_structs.h:521
struct line_pnts ** lines
Lines array.
Definition: dig_structs.h:473
dbDriver * dbdriver
Open DB driver when writing attributes.
Definition: dig_structs.h:559
List of dead lines in the file.
Definition: dig_structs.h:272
off_t Node_spidx_offset
Offset of nodes in sidx file.
Definition: dig_structs.h:1075
int coor_dim
Coordinates dimension (2D or 3D)
Definition: dig_structs.h:639
Portability info.
Definition: dig_structs.h:186
double * z
Array of Z coordinates.
Definition: dig_structs.h:1688
off_t last_offset
Offset of last read line.
Definition: dig_structs.h:366
char * start
Pointer to beginning of the file in the memory.
Definition: dig_structs.h:105
Spatial index info.
Definition: dig_structs.h:1799
plus_t n_clines
Current number of centroids.
Definition: dig_structs.h:914
int * upnodes
Array of updated nodes.
Definition: dig_structs.h:1205
int format
Map format (native, ogr, postgis)
Definition: dig_structs.h:1271
int * field
Array of layers (fields)
Definition: dig_structs.h:1707
plus_t volume
Volume number, negative for duplicate kernel.
Definition: dig_structs.h:1568
long head_size
Topo header size.
Definition: dig_structs.h:824
int minor
Current version (minor)
Definition: dig_structs.h:282
SF_FeatureType sf_type
Simple feature type (currently used only by PG format)
Definition: dig_structs.h:501
OGRLayerH layer
Pointer to OGRLayer.
Definition: dig_structs.h:546
int back_minor
Earliest version that can use this data format (minor)
Definition: dig_structs.h:286
char * user_name
User name.
Definition: dig_structs.h:307
double * node_costs
Node costs used for graph.
Definition: dig_structs.h:1246
off_t Hole_spidx_offset
Offset of holes in sidx file.
Definition: dig_structs.h:1099
plus_t n_blines
Current number of boundaries.
Definition: dig_structs.h:910
int field
Field number constraint (see line_cats structure)
Definition: dig_structs.h:1382
File definition.
Definition: dig_structs.h:96
char * schema_name
Schema name.
Definition: dig_structs.h:615
plus_t N2
End node.
Definition: dig_structs.h:1518
#define PORT_INT
Definition: dig_defines.h:48
char * where
SQL where statement (to filter features)
Definition: dig_structs.h:533
int update_cidx
Update category index if vector is modified.
Definition: dig_structs.h:1136
int lng_quick
Quick reading flag for long.
Definition: dig_structs.h:241
plus_t n_lines
Number of boundary lines.
Definition: dig_structs.h:1610
plus_t area
Area it exists w/in, if any.
Definition: dig_structs.h:1669
Non-native format info (currently only OGR is implemented)
Definition: dig_structs.h:713
Definition: rtree.h:128
double * dbl
Array of double attributes.
Definition: dig_structs.h:55
long head_size
Coor header size.
Definition: dig_structs.h:356
plus_t n_edges
Current number of edges.
Definition: dig_structs.h:943
int line_type
Line type used to build the graph.
Definition: dig_structs.h:1224
char * gisdbase
GISDBASE path.
Definition: dig_structs.h:1346
char * where
SQL where statement (fo filter features)
Definition: dig_structs.h:623
char * fid_column
FID column.
Definition: dig_structs.h:627
plus_t n_volumes
Current number of volumes.
Definition: dig_structs.h:963
off_t Face_spidx_offset
Offset of faces in sidx file.
Definition: dig_structs.h:1091
unsigned char flt_cnvrt[sizeof(float)]
Definition: port_init.c:125
int n_cidx
Number of category indexes (one for each field/layer)
Definition: dig_structs.h:1141
plus_t alloc_isles
Number of allocated isles.
Definition: dig_structs.h:998
plus_t n_nodes
Current number of topological features derived from vector geometries.
Definition: dig_structs.h:939
SF_FeatureType
Simple feature types.
Definition: dig_defines.h:234
int * max
Array of maximum values.
Definition: dig_structs.h:1736
FILE * hist_fp
History file.
Definition: dig_structs.h:1393
int * c
Array.
Definition: dig_structs.h:1791
char * key
Name of key column (usually &#39;cat&#39;)
Definition: dig_structs.h:159