OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
vpftidx.h
Go to the documentation of this file.
1 /* static char SCCS_ID[] = "@(#) vpftidx.h 1.5 10/9/91" ; */
2 /*************************************************************************
3  *
4  * Environmental Systems Research Institute (ESRI) Applications Programming
5  *
6  *N Module VPFTIDX
7  *
8  *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
9  *
10  *P
11  * Purpose: To create a thematic index on a VPF table column.
12  *E
13  *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
14  *
15  * Parameters:
16  *A
17  * N/A
18  *E
19  *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
20  *
21  * History:
22  *H
23  * Dave Flinn September 1991
24  *E
25  *
26  *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
27  *
28  *
29  * Portability:
30  *O
31  * This module should be ANSI C compatible
32  *E
33  *************************************************************************/
34 
35 #ifndef _VPFTIDX_
36 #define _VPFTIDX_
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 #include <ossim/vpfutil/set.h>
43 
44 typedef struct { /* Total of 40 bytes */
45  ossim_int32 nbytes , /* 40 + directory length */
46  nbins , /* Directory size */
47  table_nrows ; /* Num rows in original table */
48  char index_type , /* T = thematic, G = gazetteer */
49  column_type ; /* T, I, R, S, F, K */
50  ossim_int32 type_count ; /* usually 1, but more for T */
51  char id_data_type , /* I if > 32767, else S */
52  vpf_table_name[12] ,
53  vpf_column_name[25] , /* 16 bytes + 9 for TILE_ID */
54  padding[4] ; /* To make it a nice 60 bytes */
56 
57 #define THEMATIC_INDEX_HEADER_SIZE 60
58 
59 #define DIRECTORY_SIZE (sizeof(ossim_int32)*2)
60 
61 #define MAX_ID 32767 /* Threshold between S and I ids */
62 
63 typedef struct { /* length = sizeof (datatype) + */
64  union { /* 8 * nbins */
65  char cval ,
66  *strval ;
68  short int sval ;
69  float fval ;
70  double dval ;
71  } value ;
73  num_items ; /* For each value, count the ids */
74  /* Store the row ids here */
75 /* char *ids ;*/ /* depending on id_data_type, this */
78 
79 typedef struct {
82  FILE *fp;
84 
85 /* PROTOTYPES */
86 
87 /*char* strupr(char*);*/
88 
89 set_type read_thematic_index ( char *tablename,
90  char *value ) ;
91 
92 ThematicIndex open_thematic_index ( char *tablename );
93 
95  char *value ) ;
96 
97 void close_thematic_index ( ThematicIndex *themindex );
98 
99 set_type read_gazetteer_index (char * vpfname, char * query_str ) ;
100 
102  char * query_str ) ;
103 
105  ThematicIndexDirectory ** gid,
106  ThematicIndexHeader * gi,
107  FILE * idx_fp);
108 
109 
110 
112  FILE *fp ) ;
113 
115  FILE *fp ) ;
116 
121  FILE *fp ) ;
122 
127  FILE *fp ) ;
128 
129 
130 
131 ossim_int32 create_thematic_index ( char indextype,
132  char *tablename,
133  char *idxname ,
134  char *columnname,
135  char *idx_set );
136 
137 ossim_int32 create_gazetteer_index (char *tablename,
138  char *idx_fname ,
139  char *columnname,
140  char *idx_set);
141 
142 #ifdef __cplusplus
143 }
144 #endif
145 
146 #endif
set_type read_thematic_index(char *tablename, char *value)
ossim_int32 write_thematic_index_directory(ThematicIndexHeader h, ThematicIndexDirectory *d, ossim_int32 size, FILE *fp)
ossim_int32 create_gazetteer_index(char *tablename, char *idx_fname, char *columnname, char *idx_set)
ossim_int32 start_offset
Definition: vpftidx.h:72
void close_thematic_index(ThematicIndex *themindex)
set_type search_gazetteer_index(ThematicIndex *idx, char *query_str)
ossim_int32 write_thematic_index_header(ThematicIndexHeader h, FILE *fp)
ThematicIndex open_thematic_index(char *tablename)
FILE * fp
Definition: vpftidx.h:82
ossim_int32 table_nrows
Definition: vpftidx.h:45
ossim_int32 write_gazetteer_index_directory(ThematicIndexHeader h, ThematicIndexDirectory *d, ossim_int32 size, FILE *fp)
yy_size_t size
ossim_int32 create_thematic_index(char indextype, char *tablename, char *idxname, char *columnname, char *idx_set)
ossim_int32 type_count
Definition: vpftidx.h:50
ossim_int32 ival
Definition: vpftidx.h:67
Definition: set.h:14
ossim_int32 read_gazetteer_index_directory(ThematicIndexDirectory **gid, ThematicIndexHeader *gi, FILE *idx_fp)
set_type search_thematic_index(ThematicIndex *themindex, char *value)
set_type read_gazetteer_index(char *vpfname, char *query_str)
ThematicIndexDirectory * gid
Definition: vpftidx.h:81
ThematicIndexHeader h
Definition: vpftidx.h:80
ossim_int32 read_thematic_index_header(ThematicIndexHeader *h, FILE *fp)
int ossim_int32