This repository has been archived by the owner on Sep 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gtfsprep.h
216 lines (188 loc) · 3.6 KB
/
gtfsprep.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
// gtfsprep.h - prepare gtfs feeds
/*
This file is part of Tripover, a broad-search journey planner.
Copyright (C) 2015-2016 Joris van der Geer.
*/
#define Nearstop 64
#define Namelen 128
struct gtstop {
bool valid;
ub4 id,pid,stopid,prestopid,prepstopid;
ub4 linno;
ub4 gidofs,codeofs,parentofs,descofs;
ub4 gidlen,codelen,namelen,inamelen,parentlen,desclen,tznamlen;
ub4 pnamelen;
char *pnameref;
bool isparent,hasparent;
ub4 loctype;
ub4 ilat,ilon;
ub4 coloc;
double lat,lon,rlat,rlon;
ub4 nearcnt,enearcnt,stncnt;
ub4 nears[Nearstop];
ub4 group,iparent;
ub4 iter,subiter;
char name[Namelen];
char iname[Namelen];
char tzname[32];
char parentname[Namelen];
ub4 geondx;
};
struct geostop {
ub4 id;
ub4 ilat,ilon;
double lat,lon,rlat,rlon;
ub4 utcofs12;
ub4 pop;
ub4 namelen,tzlen;
ub1 isplace;
char name[64];
char tzname[32];
};
struct bucket {
ub4 sofs;
ub4 slen;
ub4 code;
ub4 data;
};
struct hashtab {
ub4 len;
ub4 eqlen;
ub4 maxeq;
ub4 itemcnt;
char *strpool;
ub4 spoollen,sofs;
struct bucket *bkts;
block bktmem;
block strmem;
ub4 fln;
const char *desc;
};
typedef struct hashtab hash;
struct route {
ub4 aid;
ub4 type;
ub4 tripcnt;
ub4 skipto;
ub4 linno;
ub4 eqid,eqcnt;
char name[256];
char rrid[128];
char agency[128];
};
struct iroute {
ub4 rid; // original from trip
ub4 type;
char id[64];
char name[128];
};
struct tripstop {
ub2 seq;
ub4 tdep,tarr;
ub4 stopid;
ub4 prestopid;
ub4 stid; // back link to stoptime
ub4 linno;
};
struct trip {
ub4 tid,rid,irid;
ub4 type;
ub4 bid;
ub4 sid;
ub4 join,join2;
ub4 loseq,hiseq;
ub4 lostop,histop;
ub4 lotarr,hitdep;
ub4 repiv,repstart;
ub4 loprestopid,hiprestopid;
ub4 len;
ub4 stopofs,rridofs;
ub4 linno;
ub8 seqsum,timesum;
ub4 orgtidpos,orgridpos,rridpos,sidpos,headsignpos;
ub2 orgtidlen,orgridlen,rridlen,sidlen,headsignlen;
char flno[8];
char name[64];
char iroute[16+16+4+16+32];
int watch;
};
#define Stop_idlen 126
struct stoptime {
ub4 tid;
ub4 linno;
ub4 prestopid;
ub4 stopid;
ub4 rstopid;
char *stop_id;
ub2 seq;
ub4 tdep,tarr;
};
struct gtfsnet {
ub4 agencycnt;
ub4 calendarcnt;
ub4 caldatescnt;
ub4 routecnt;
ub4 xfercnt;
ub4 iroutecnt;
ub4 stopcnt;
ub4 prestopcnt;
ub4 tripcnt;
ub4 freqcnt;
ub4 stoptimescnt;
ub4 stopseqcnt;
ub4 geostopcnt;
ub4 geopopcnt;
block agencymem;
block calendarmem;
block caldatesmem;
block routemem;
block xfermem;
block stopmem,estopmem;
block tripmem,stripmem;
block freqmem;
block stoptimesmem;
block stopseqmem;
block iroutemem;
char *agencylines;
char *calendarlines;
char *caldateslines;
char *routelines;
char *xferlines;
char *stoplines;
char *triplines,*striplines;
char *freqlines;
char *stoptimeslines;
char *stopseqlines;
char *iroutelines;
char summarylines[1024];
ub4 agencylinepos;
ub4 calendarlinepos;
ub4 caldateslinepos;
ub4 routelinepos;
ub4 xferlinepos;
ub4 stoplinepos;
ub4 triplinepos,striplinepos;
ub4 freqlinepos;
ub8 stoptimeslinepos;
ub8 stopseqlinepos;
ub4 iroutelinepos;
ub4 summarylinepos;
hash *agencyids;
hash *serviceids;
hash *routeids,*norouteids;
struct route *routes;
struct iroute *iroutes;
hash *tripids,*notripids;
hash *blockids;
struct trip *trips;
hash *stopids;
hash *prestopids;
struct gtstop *prestops;
ub4 *latsort,*lonsort;
ub4 *latsortidx,*lonsortidx;
ub4 *namlatsort,*namlonsort;
ub4 *namlatsortidx,*namlonsortidx;
struct geostop *geostops;
iadrbase net0;
};
typedef struct gtfsnet gtfsnet;