gtfs 4.12.0 → 4.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -5
- package/dist/bin/gtfs-export.d.ts +1 -0
- package/dist/bin/gtfs-export.js +3646 -0
- package/dist/bin/gtfs-export.js.map +1 -0
- package/dist/bin/gtfs-import.d.ts +1 -0
- package/dist/bin/gtfs-import.js +4146 -0
- package/dist/bin/gtfs-import.js.map +1 -0
- package/dist/bin/gtfsrealtime-update.d.ts +1 -0
- package/dist/bin/gtfsrealtime-update.js +3802 -0
- package/dist/bin/gtfsrealtime-update.js.map +1 -0
- package/dist/index.d.ts +169 -0
- package/dist/index.js +5205 -0
- package/dist/index.js.map +1 -0
- package/package.json +26 -12
- package/.eslintrc.json +0 -28
- package/.github/workflows/nodejs.yml +0 -21
- package/.husky/pre-commit +0 -4
- package/@types/index.d.ts +0 -606
- package/@types/tests.ts +0 -31
- package/@types/tsconfig.json +0 -17
- package/CHANGELOG.md +0 -905
- package/bin/gtfs-export.js +0 -42
- package/bin/gtfs-import.js +0 -52
- package/bin/gtfsrealtime-update.js +0 -35
- package/config-sample-full.json +0 -20
- package/config-sample-rtupdates.json +0 -16
- package/config-sample.json +0 -8
- package/docs/images/node-gtfs-logo.svg +0 -18
- package/index.js +0 -1
- package/lib/advancedQuery.js +0 -36
- package/lib/db.js +0 -92
- package/lib/export.js +0 -141
- package/lib/file-utils.js +0 -103
- package/lib/geojson-utils.js +0 -138
- package/lib/gtfs/agencies.js +0 -32
- package/lib/gtfs/areas.js +0 -27
- package/lib/gtfs/attributions.js +0 -32
- package/lib/gtfs/booking-rules.js +0 -32
- package/lib/gtfs/calendar-dates.js +0 -32
- package/lib/gtfs/calendars.js +0 -32
- package/lib/gtfs/fare-attributes.js +0 -32
- package/lib/gtfs/fare-leg-rules.js +0 -32
- package/lib/gtfs/fare-media.js +0 -32
- package/lib/gtfs/fare-products.js +0 -32
- package/lib/gtfs/fare-rules.js +0 -32
- package/lib/gtfs/fare-transfer-rules.js +0 -32
- package/lib/gtfs/feed-info.js +0 -32
- package/lib/gtfs/frequencies.js +0 -32
- package/lib/gtfs/levels.js +0 -27
- package/lib/gtfs/location-group-stops.js +0 -32
- package/lib/gtfs/location-groups.js +0 -32
- package/lib/gtfs/locations.js +0 -32
- package/lib/gtfs/networks.js +0 -32
- package/lib/gtfs/pathways.js +0 -32
- package/lib/gtfs/route-networks.js +0 -32
- package/lib/gtfs/routes.js +0 -72
- package/lib/gtfs/shapes.js +0 -119
- package/lib/gtfs/stop-areas.js +0 -32
- package/lib/gtfs/stop-times.js +0 -32
- package/lib/gtfs/stops.js +0 -136
- package/lib/gtfs/timeframes.js +0 -32
- package/lib/gtfs/transfers.js +0 -32
- package/lib/gtfs/translations.js +0 -32
- package/lib/gtfs/trips.js +0 -27
- package/lib/gtfs-plus/calendar-attributes.js +0 -32
- package/lib/gtfs-plus/directions.js +0 -32
- package/lib/gtfs-plus/route-attributes.js +0 -32
- package/lib/gtfs-plus/stop-attributes.js +0 -32
- package/lib/gtfs-realtime/service-alerts.js +0 -34
- package/lib/gtfs-realtime/stop-time-updates.js +0 -32
- package/lib/gtfs-realtime/trip-updates.js +0 -32
- package/lib/gtfs-realtime/vehicle-positions.js +0 -32
- package/lib/gtfs-ride/board-alights.js +0 -32
- package/lib/gtfs-ride/ride-feed-infos.js +0 -32
- package/lib/gtfs-ride/rider-trips.js +0 -32
- package/lib/gtfs-ride/riderships.js +0 -32
- package/lib/gtfs-ride/trip-capacities.js +0 -32
- package/lib/gtfs.js +0 -261
- package/lib/import.js +0 -803
- package/lib/log-utils.js +0 -73
- package/lib/non-standard/timetable-notes-references.js +0 -32
- package/lib/non-standard/timetable-notes.js +0 -32
- package/lib/non-standard/timetable-pages.js +0 -32
- package/lib/non-standard/timetable-stop-order.js +0 -32
- package/lib/non-standard/timetables.js +0 -32
- package/lib/non-standard/trips-dated-vehicle-journey.js +0 -32
- package/lib/ods/deadhead-times.js +0 -32
- package/lib/ods/deadheads.js +0 -32
- package/lib/ods/ops-locations.js +0 -32
- package/lib/ods/run-events.js +0 -32
- package/lib/ods/runs-pieces.js +0 -32
- package/lib/utils.js +0 -178
- package/models/gtfs/agency.js +0 -49
- package/models/gtfs/areas.js +0 -19
- package/models/gtfs/attributions.js +0 -68
- package/models/gtfs/booking-rules.js +0 -92
- package/models/gtfs/calendar-dates.js +0 -34
- package/models/gtfs/calendar.js +0 -76
- package/models/gtfs/fare-attributes.js +0 -48
- package/models/gtfs/fare-leg-rules.js +0 -55
- package/models/gtfs/fare-media.js +0 -26
- package/models/gtfs/fare-products.js +0 -35
- package/models/gtfs/fare-rules.js +0 -34
- package/models/gtfs/fare-transfer-rules.js +0 -56
- package/models/gtfs/feed-info.js +0 -50
- package/models/gtfs/frequencies.js +0 -46
- package/models/gtfs/levels.js +0 -25
- package/models/gtfs/location-group-stops.js +0 -22
- package/models/gtfs/location-groups.js +0 -19
- package/models/gtfs/locations.js +0 -12
- package/models/gtfs/networks.js +0 -20
- package/models/gtfs/pathways.js +0 -74
- package/models/gtfs/route-networks.js +0 -21
- package/models/gtfs/routes.js +0 -79
- package/models/gtfs/shapes.js +0 -41
- package/models/gtfs/stop-areas.js +0 -20
- package/models/gtfs/stop-times.js +0 -120
- package/models/gtfs/stops.js +0 -85
- package/models/gtfs/timeframes.js +0 -29
- package/models/gtfs/transfers.js +0 -56
- package/models/gtfs/translations.js +0 -48
- package/models/gtfs/trips.js +0 -70
- package/models/gtfs-plus/calendar-attributes.js +0 -22
- package/models/gtfs-plus/directions.js +0 -29
- package/models/gtfs-plus/route-attributes.js +0 -34
- package/models/gtfs-plus/stop-attributes.js +0 -35
- package/models/gtfs-realtime/service-alert-targets.js +0 -37
- package/models/gtfs-realtime/service-alerts.js +0 -60
- package/models/gtfs-realtime/stop-time-updates.js +0 -85
- package/models/gtfs-realtime/trip-updates.js +0 -75
- package/models/gtfs-realtime/vehicle-positions.js +0 -135
- package/models/gtfs-ride/board-alight.js +0 -132
- package/models/gtfs-ride/ride-feed-info.js +0 -40
- package/models/gtfs-ride/rider-trip.js +0 -113
- package/models/gtfs-ride/ridership.js +0 -127
- package/models/gtfs-ride/trip-capacity.js +0 -51
- package/models/models.js +0 -120
- package/models/non-standard/timetable-notes-references.js +0 -50
- package/models/non-standard/timetable-notes.js +0 -24
- package/models/non-standard/timetable-pages.js +0 -23
- package/models/non-standard/timetable-stop-order.js +0 -32
- package/models/non-standard/timetables.js +0 -144
- package/models/non-standard/trips-dated-vehicle-journey.js +0 -34
- package/models/ods/deadhead-times.js +0 -65
- package/models/ods/deadheads.js +0 -60
- package/models/ods/ops-locations.js +0 -46
- package/models/ods/run-events.js +0 -70
- package/models/ods/runs-pieces.js +0 -59
- package/test/fixture/caltrain_20160406.zip +0 -0
- package/test/mocha/advanced-query.js +0 -74
- package/test/mocha/delete-db.js +0 -62
- package/test/mocha/export-gtfs.js +0 -147
- package/test/mocha/fare-transfer-rules.js +0 -32
- package/test/mocha/get-agencies.js +0 -90
- package/test/mocha/get-areas.js +0 -27
- package/test/mocha/get-attributions.js +0 -27
- package/test/mocha/get-board-alights.js +0 -28
- package/test/mocha/get-booking-rules.js +0 -28
- package/test/mocha/get-calendar-attributes.js +0 -33
- package/test/mocha/get-calendar-dates.js +0 -107
- package/test/mocha/get-calendars.js +0 -94
- package/test/mocha/get-directions.js +0 -28
- package/test/mocha/get-fare-attributes.js +0 -51
- package/test/mocha/get-fare-leg-rules.js +0 -27
- package/test/mocha/get-fare-media.js +0 -27
- package/test/mocha/get-fare-products.js +0 -27
- package/test/mocha/get-fare-rules.js +0 -50
- package/test/mocha/get-feed-info.js +0 -28
- package/test/mocha/get-frequencies.js +0 -28
- package/test/mocha/get-levels.js +0 -28
- package/test/mocha/get-location-group-stops.js +0 -33
- package/test/mocha/get-location-groups.js +0 -28
- package/test/mocha/get-locations.js +0 -69
- package/test/mocha/get-networks.js +0 -28
- package/test/mocha/get-pathways.js +0 -28
- package/test/mocha/get-ride-feed-infos.js +0 -24
- package/test/mocha/get-rider-trips.js +0 -28
- package/test/mocha/get-riderships.js +0 -28
- package/test/mocha/get-route-attributes.js +0 -33
- package/test/mocha/get-route-networks.js +0 -28
- package/test/mocha/get-routes.js +0 -143
- package/test/mocha/get-shapes-as-geojson.js +0 -92
- package/test/mocha/get-shapes.js +0 -240
- package/test/mocha/get-stop-attributes.js +0 -28
- package/test/mocha/get-stops-as-geojson.js +0 -87
- package/test/mocha/get-stops.js +0 -343
- package/test/mocha/get-stoptimes.js +0 -67
- package/test/mocha/get-timeframes.js +0 -28
- package/test/mocha/get-timetable-pages.js +0 -28
- package/test/mocha/get-timetable-stop-orders.js +0 -33
- package/test/mocha/get-timetables.js +0 -28
- package/test/mocha/get-transfers.js +0 -28
- package/test/mocha/get-translations.js +0 -28
- package/test/mocha/get-trip-capacities.js +0 -28
- package/test/mocha/get-trips.js +0 -53
- package/test/mocha/import-gtfs.js +0 -173
- package/test/mocha/open-db.js +0 -149
- package/test/mocha/raw-query.js +0 -34
- package/test/test-config.js +0 -12
|
@@ -0,0 +1,3646 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/bin/gtfs-export.ts
|
|
4
|
+
import yargs from "yargs";
|
|
5
|
+
import { hideBin } from "yargs/helpers";
|
|
6
|
+
import PrettyError from "pretty-error";
|
|
7
|
+
|
|
8
|
+
// src/lib/file-utils.ts
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
import { existsSync } from "node:fs";
|
|
11
|
+
import { mkdir, readFile, rm } from "node:fs/promises";
|
|
12
|
+
import { omit, snakeCase } from "lodash-es";
|
|
13
|
+
import sanitize from "sanitize-filename";
|
|
14
|
+
import untildify from "untildify";
|
|
15
|
+
import StreamZip from "node-stream-zip";
|
|
16
|
+
async function getConfig(argv2) {
|
|
17
|
+
let config;
|
|
18
|
+
let data;
|
|
19
|
+
if (argv2.configPath) {
|
|
20
|
+
try {
|
|
21
|
+
data = await readFile(path.resolve(untildify(argv2.configPath)), "utf8");
|
|
22
|
+
} catch (error) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
`Cannot find configuration file at \`${argv2.configPath}\`. Use config-sample.json as a starting point.`
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
config = Object.assign(JSON.parse(data), argv2);
|
|
29
|
+
} catch (error) {
|
|
30
|
+
throw new Error(
|
|
31
|
+
`Cannot parse configuration file at \`${argv2.configPath}\`. Check to ensure that it is valid JSON.`
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
} else if (argv2.gtfsPath || argv2.gtfsUrl || argv2.sqlitePath) {
|
|
35
|
+
const agencies = [];
|
|
36
|
+
if (argv2.gtfsPath) {
|
|
37
|
+
agencies.push({
|
|
38
|
+
path: argv2.gtfsPath
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (argv2.gtfsUrl) {
|
|
42
|
+
agencies.push({
|
|
43
|
+
url: argv2.gtfsUrl
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
config = {
|
|
47
|
+
agencies,
|
|
48
|
+
...omit(argv2, ["path", "url"])
|
|
49
|
+
};
|
|
50
|
+
} else if (existsSync(path.resolve("./config.json"))) {
|
|
51
|
+
try {
|
|
52
|
+
data = await readFile(path.resolve("./config.json"), "utf8");
|
|
53
|
+
} catch (error) {
|
|
54
|
+
throw new Error(
|
|
55
|
+
`Cannot open configuration file at \`${path.resolve("./config.json")}\`. Check to ensure that it exists. Use config-sample.json as a starting point.`
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
config = Object.assign(JSON.parse(data), argv2);
|
|
60
|
+
console.log("Using configuration from ./config.json");
|
|
61
|
+
} catch (error) {
|
|
62
|
+
throw new Error(
|
|
63
|
+
`Cannot parse configuration file at \`${path.resolve("./config.json")}\`. Check to ensure that it is valid JSON.`
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
throw new Error(
|
|
68
|
+
"Cannot find configuration file. Use config-sample.json as a starting point, pass --configPath option."
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
return config;
|
|
72
|
+
}
|
|
73
|
+
async function prepDirectory(exportPath) {
|
|
74
|
+
await rm(exportPath, { recursive: true, force: true });
|
|
75
|
+
await mkdir(exportPath, { recursive: true });
|
|
76
|
+
}
|
|
77
|
+
function generateFolderName(folderName) {
|
|
78
|
+
return snakeCase(sanitize(folderName));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// src/lib/log-utils.ts
|
|
82
|
+
import { clearLine, cursorTo } from "node:readline";
|
|
83
|
+
import { noop } from "lodash-es";
|
|
84
|
+
import * as colors from "yoctocolors";
|
|
85
|
+
function log(config) {
|
|
86
|
+
if (config.verbose === false) {
|
|
87
|
+
return noop;
|
|
88
|
+
}
|
|
89
|
+
if (config.logFunction) {
|
|
90
|
+
return config.logFunction;
|
|
91
|
+
}
|
|
92
|
+
return (text, overwrite) => {
|
|
93
|
+
if (overwrite === true && process.stdout.isTTY) {
|
|
94
|
+
clearLine(process.stdout, 0);
|
|
95
|
+
cursorTo(process.stdout, 0);
|
|
96
|
+
} else {
|
|
97
|
+
process.stdout.write("\n");
|
|
98
|
+
}
|
|
99
|
+
process.stdout.write(text);
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function logWarning(config) {
|
|
103
|
+
if (config.logFunction) {
|
|
104
|
+
return config.logFunction;
|
|
105
|
+
}
|
|
106
|
+
return (text) => {
|
|
107
|
+
process.stdout.write(`
|
|
108
|
+
${formatWarning(text)}
|
|
109
|
+
`);
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function formatWarning(text) {
|
|
113
|
+
const warningMessage = `${colors.underline("Warning")}: ${text}`;
|
|
114
|
+
return colors.yellow(warningMessage);
|
|
115
|
+
}
|
|
116
|
+
function formatError(error) {
|
|
117
|
+
const messageText = error instanceof Error ? error.message : error;
|
|
118
|
+
const errorMessage = `${colors.underline("Error")}: ${messageText.replace(
|
|
119
|
+
"Error: ",
|
|
120
|
+
""
|
|
121
|
+
)}`;
|
|
122
|
+
return colors.red(errorMessage);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// src/lib/import.ts
|
|
126
|
+
import { parse } from "csv-parse";
|
|
127
|
+
import pluralize from "pluralize";
|
|
128
|
+
import stripBomStream from "strip-bom-stream";
|
|
129
|
+
import { temporaryDirectory } from "tempy";
|
|
130
|
+
import untildify3 from "untildify";
|
|
131
|
+
import mapSeries from "promise-map-series";
|
|
132
|
+
import GtfsRealtimeBindings from "gtfs-realtime-bindings";
|
|
133
|
+
import sqlString2 from "sqlstring-sqlite";
|
|
134
|
+
|
|
135
|
+
// src/models/gtfs/agency.ts
|
|
136
|
+
var model = {
|
|
137
|
+
filenameBase: "agency",
|
|
138
|
+
filenameExtension: "txt",
|
|
139
|
+
schema: [
|
|
140
|
+
{
|
|
141
|
+
name: "agency_id",
|
|
142
|
+
type: "text",
|
|
143
|
+
primary: true,
|
|
144
|
+
prefix: true
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: "agency_name",
|
|
148
|
+
type: "text",
|
|
149
|
+
required: true,
|
|
150
|
+
nocase: true
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "agency_url",
|
|
154
|
+
type: "text",
|
|
155
|
+
required: true
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "agency_timezone",
|
|
159
|
+
type: "text",
|
|
160
|
+
required: true
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "agency_lang",
|
|
164
|
+
type: "text",
|
|
165
|
+
nocase: true
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: "agency_phone",
|
|
169
|
+
type: "text",
|
|
170
|
+
nocase: true
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "agency_fare_url",
|
|
174
|
+
type: "text"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: "agency_email",
|
|
178
|
+
type: "text",
|
|
179
|
+
nocase: true
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
};
|
|
183
|
+
var agency_default = model;
|
|
184
|
+
|
|
185
|
+
// src/models/gtfs/areas.ts
|
|
186
|
+
var model2 = {
|
|
187
|
+
filenameBase: "areas",
|
|
188
|
+
filenameExtension: "txt",
|
|
189
|
+
schema: [
|
|
190
|
+
{
|
|
191
|
+
name: "area_id",
|
|
192
|
+
type: "text",
|
|
193
|
+
required: true,
|
|
194
|
+
primary: true,
|
|
195
|
+
prefix: true
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: "area_name",
|
|
199
|
+
type: "text"
|
|
200
|
+
}
|
|
201
|
+
]
|
|
202
|
+
};
|
|
203
|
+
var areas_default = model2;
|
|
204
|
+
|
|
205
|
+
// src/models/gtfs/attributions.ts
|
|
206
|
+
var model3 = {
|
|
207
|
+
filenameBase: "attributions",
|
|
208
|
+
filenameExtension: "txt",
|
|
209
|
+
schema: [
|
|
210
|
+
{
|
|
211
|
+
name: "attribution_id",
|
|
212
|
+
type: "text",
|
|
213
|
+
primary: true,
|
|
214
|
+
required: true,
|
|
215
|
+
prefix: true
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: "agency_id",
|
|
219
|
+
type: "text",
|
|
220
|
+
prefix: true
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: "route_id",
|
|
224
|
+
type: "text",
|
|
225
|
+
prefix: true
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
name: "trip_id",
|
|
229
|
+
type: "text",
|
|
230
|
+
prefix: true
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
name: "organization_name",
|
|
234
|
+
type: "text",
|
|
235
|
+
required: true,
|
|
236
|
+
nocase: true
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: "is_producer",
|
|
240
|
+
type: "integer",
|
|
241
|
+
min: 0,
|
|
242
|
+
max: 1
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
name: "is_operator",
|
|
246
|
+
type: "integer",
|
|
247
|
+
min: 0,
|
|
248
|
+
max: 1
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
name: "is_authority",
|
|
252
|
+
type: "integer",
|
|
253
|
+
min: 0,
|
|
254
|
+
max: 1
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
name: "attribution_url",
|
|
258
|
+
type: "text"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
name: "attribution_email",
|
|
262
|
+
type: "text",
|
|
263
|
+
nocase: true
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
name: "attribution_phone",
|
|
267
|
+
type: "text",
|
|
268
|
+
nocase: true
|
|
269
|
+
}
|
|
270
|
+
]
|
|
271
|
+
};
|
|
272
|
+
var attributions_default = model3;
|
|
273
|
+
|
|
274
|
+
// src/models/gtfs/booking-rules.ts
|
|
275
|
+
var model4 = {
|
|
276
|
+
filenameBase: "booking_rules",
|
|
277
|
+
filenameExtension: "txt",
|
|
278
|
+
schema: [
|
|
279
|
+
{
|
|
280
|
+
name: "booking_rule_id",
|
|
281
|
+
type: "text",
|
|
282
|
+
primary: true,
|
|
283
|
+
prefix: true
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
name: "booking_type",
|
|
287
|
+
type: "integer",
|
|
288
|
+
required: true,
|
|
289
|
+
min: 0,
|
|
290
|
+
max: 2
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
name: "prior_notice_duration_min",
|
|
294
|
+
type: "integer",
|
|
295
|
+
min: 0
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
name: "prior_notice_duration_max",
|
|
299
|
+
type: "integer",
|
|
300
|
+
min: 0
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
name: "prior_notice_last_day",
|
|
304
|
+
type: "integer",
|
|
305
|
+
min: 0
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
name: "prior_notice_last_time",
|
|
309
|
+
type: "text"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
name: "prior_notice_last_timestamp",
|
|
313
|
+
type: "integer",
|
|
314
|
+
index: true
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
name: "prior_notice_start_day",
|
|
318
|
+
type: "integer",
|
|
319
|
+
min: 0
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
name: "prior_notice_start_time",
|
|
323
|
+
type: "text"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
name: "prior_notice_start_timestamp",
|
|
327
|
+
type: "integer",
|
|
328
|
+
index: true
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
name: "prior_notice_service_id",
|
|
332
|
+
type: "text",
|
|
333
|
+
prefix: true
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
name: "message",
|
|
337
|
+
type: "text",
|
|
338
|
+
nocase: true
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
name: "pickup_message",
|
|
342
|
+
type: "text",
|
|
343
|
+
nocase: true
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
name: "drop_off_message",
|
|
347
|
+
type: "text",
|
|
348
|
+
nocase: true
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
name: "phone_number",
|
|
352
|
+
type: "text",
|
|
353
|
+
nocase: true
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
name: "info_url",
|
|
357
|
+
type: "text"
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
name: "booking_url",
|
|
361
|
+
type: "text"
|
|
362
|
+
}
|
|
363
|
+
]
|
|
364
|
+
};
|
|
365
|
+
var booking_rules_default = model4;
|
|
366
|
+
|
|
367
|
+
// src/models/gtfs/calendar-dates.ts
|
|
368
|
+
var model5 = {
|
|
369
|
+
filenameBase: "calendar_dates",
|
|
370
|
+
filenameExtension: "txt",
|
|
371
|
+
schema: [
|
|
372
|
+
{
|
|
373
|
+
name: "service_id",
|
|
374
|
+
type: "text",
|
|
375
|
+
required: true,
|
|
376
|
+
primary: true,
|
|
377
|
+
prefix: true
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
name: "date",
|
|
381
|
+
type: "integer",
|
|
382
|
+
required: true,
|
|
383
|
+
primary: true
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
name: "exception_type",
|
|
387
|
+
type: "integer",
|
|
388
|
+
required: true,
|
|
389
|
+
min: 1,
|
|
390
|
+
max: 2,
|
|
391
|
+
index: true
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
name: "holiday_name",
|
|
395
|
+
type: "text",
|
|
396
|
+
nocase: true
|
|
397
|
+
}
|
|
398
|
+
]
|
|
399
|
+
};
|
|
400
|
+
var calendar_dates_default = model5;
|
|
401
|
+
|
|
402
|
+
// src/models/gtfs/calendar.ts
|
|
403
|
+
var model6 = {
|
|
404
|
+
filenameBase: "calendar",
|
|
405
|
+
filenameExtension: "txt",
|
|
406
|
+
schema: [
|
|
407
|
+
{
|
|
408
|
+
name: "service_id",
|
|
409
|
+
type: "text",
|
|
410
|
+
required: true,
|
|
411
|
+
primary: true,
|
|
412
|
+
prefix: true
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
name: "monday",
|
|
416
|
+
type: "integer",
|
|
417
|
+
required: true,
|
|
418
|
+
min: 0,
|
|
419
|
+
max: 1
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
name: "tuesday",
|
|
423
|
+
type: "integer",
|
|
424
|
+
required: true,
|
|
425
|
+
min: 0,
|
|
426
|
+
max: 1
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
name: "wednesday",
|
|
430
|
+
type: "integer",
|
|
431
|
+
required: true,
|
|
432
|
+
min: 0,
|
|
433
|
+
max: 1
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
name: "thursday",
|
|
437
|
+
type: "integer",
|
|
438
|
+
required: true,
|
|
439
|
+
min: 0,
|
|
440
|
+
max: 1
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
name: "friday",
|
|
444
|
+
type: "integer",
|
|
445
|
+
required: true,
|
|
446
|
+
min: 0,
|
|
447
|
+
max: 1
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
name: "saturday",
|
|
451
|
+
type: "integer",
|
|
452
|
+
required: true,
|
|
453
|
+
min: 0,
|
|
454
|
+
max: 1
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
name: "sunday",
|
|
458
|
+
type: "integer",
|
|
459
|
+
required: true,
|
|
460
|
+
min: 0,
|
|
461
|
+
max: 1
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
name: "start_date",
|
|
465
|
+
type: "integer",
|
|
466
|
+
required: true,
|
|
467
|
+
index: true
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
name: "end_date",
|
|
471
|
+
type: "integer",
|
|
472
|
+
required: true,
|
|
473
|
+
index: true
|
|
474
|
+
}
|
|
475
|
+
]
|
|
476
|
+
};
|
|
477
|
+
var calendar_default = model6;
|
|
478
|
+
|
|
479
|
+
// src/models/gtfs/fare-attributes.ts
|
|
480
|
+
var model7 = {
|
|
481
|
+
filenameBase: "fare_attributes",
|
|
482
|
+
filenameExtension: "txt",
|
|
483
|
+
schema: [
|
|
484
|
+
{
|
|
485
|
+
name: "fare_id",
|
|
486
|
+
type: "text",
|
|
487
|
+
required: true,
|
|
488
|
+
primary: true,
|
|
489
|
+
prefix: true
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
name: "price",
|
|
493
|
+
type: "real",
|
|
494
|
+
required: true
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
name: "currency_type",
|
|
498
|
+
type: "text",
|
|
499
|
+
required: true
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
name: "payment_method",
|
|
503
|
+
type: "integer",
|
|
504
|
+
required: true,
|
|
505
|
+
min: 0,
|
|
506
|
+
max: 1
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
name: "transfers",
|
|
510
|
+
type: "integer",
|
|
511
|
+
min: 0,
|
|
512
|
+
max: 2
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
name: "agency_id",
|
|
516
|
+
type: "text",
|
|
517
|
+
prefix: true
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
name: "transfer_duration",
|
|
521
|
+
type: "integer",
|
|
522
|
+
min: 0
|
|
523
|
+
}
|
|
524
|
+
]
|
|
525
|
+
};
|
|
526
|
+
var fare_attributes_default = model7;
|
|
527
|
+
|
|
528
|
+
// src/models/gtfs/fare-leg-rules.ts
|
|
529
|
+
var model8 = {
|
|
530
|
+
filenameBase: "fare_leg_rules",
|
|
531
|
+
filenameExtension: "txt",
|
|
532
|
+
schema: [
|
|
533
|
+
{
|
|
534
|
+
name: "leg_group_id",
|
|
535
|
+
type: "text",
|
|
536
|
+
prefix: true
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
name: "network_id",
|
|
540
|
+
type: "text",
|
|
541
|
+
primary: true,
|
|
542
|
+
prefix: true
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
name: "from_area_id",
|
|
546
|
+
type: "text",
|
|
547
|
+
primary: true,
|
|
548
|
+
prefix: true
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
name: "to_area_id",
|
|
552
|
+
type: "text",
|
|
553
|
+
primary: true,
|
|
554
|
+
prefix: true
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
name: "from_timeframe_group_id",
|
|
558
|
+
type: "text",
|
|
559
|
+
primary: true,
|
|
560
|
+
prefix: true
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
name: "to_timeframe_group_id",
|
|
564
|
+
type: "text",
|
|
565
|
+
primary: true,
|
|
566
|
+
prefix: true
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
name: "fare_product_id",
|
|
570
|
+
type: "text",
|
|
571
|
+
required: true,
|
|
572
|
+
primary: true,
|
|
573
|
+
prefix: true
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
name: "rule_priority",
|
|
577
|
+
type: "integer",
|
|
578
|
+
min: 0
|
|
579
|
+
}
|
|
580
|
+
]
|
|
581
|
+
};
|
|
582
|
+
var fare_leg_rules_default = model8;
|
|
583
|
+
|
|
584
|
+
// src/models/gtfs/fare-media.ts
|
|
585
|
+
var model9 = {
|
|
586
|
+
filenameBase: "fare_media",
|
|
587
|
+
filenameExtension: "txt",
|
|
588
|
+
schema: [
|
|
589
|
+
{
|
|
590
|
+
name: "fare_media_id",
|
|
591
|
+
type: "text",
|
|
592
|
+
required: true,
|
|
593
|
+
primary: true,
|
|
594
|
+
prefix: true
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
name: "fare_media_name",
|
|
598
|
+
type: "text"
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
name: "fare_media_type",
|
|
602
|
+
type: "integer",
|
|
603
|
+
required: true,
|
|
604
|
+
min: 0,
|
|
605
|
+
max: 4
|
|
606
|
+
}
|
|
607
|
+
]
|
|
608
|
+
};
|
|
609
|
+
var fare_media_default = model9;
|
|
610
|
+
|
|
611
|
+
// src/models/gtfs/fare-products.ts
|
|
612
|
+
var model10 = {
|
|
613
|
+
filenameBase: "fare_products",
|
|
614
|
+
filenameExtension: "txt",
|
|
615
|
+
schema: [
|
|
616
|
+
{
|
|
617
|
+
name: "fare_product_id",
|
|
618
|
+
type: "text",
|
|
619
|
+
required: true,
|
|
620
|
+
primary: true,
|
|
621
|
+
prefix: true
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
name: "fare_product_name",
|
|
625
|
+
type: "text"
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
name: "fare_media_id",
|
|
629
|
+
type: "text",
|
|
630
|
+
primary: true,
|
|
631
|
+
prefix: true
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
name: "amount",
|
|
635
|
+
type: "real",
|
|
636
|
+
required: true
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
name: "currency",
|
|
640
|
+
type: "text",
|
|
641
|
+
required: true
|
|
642
|
+
}
|
|
643
|
+
]
|
|
644
|
+
};
|
|
645
|
+
var fare_products_default = model10;
|
|
646
|
+
|
|
647
|
+
// src/models/gtfs/fare-rules.ts
|
|
648
|
+
var model11 = {
|
|
649
|
+
filenameBase: "fare_rules",
|
|
650
|
+
filenameExtension: "txt",
|
|
651
|
+
schema: [
|
|
652
|
+
{
|
|
653
|
+
name: "fare_id",
|
|
654
|
+
type: "text",
|
|
655
|
+
required: true,
|
|
656
|
+
prefix: true
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
name: "route_id",
|
|
660
|
+
type: "text",
|
|
661
|
+
prefix: true
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
name: "origin_id",
|
|
665
|
+
type: "text",
|
|
666
|
+
prefix: true
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
name: "destination_id",
|
|
670
|
+
type: "text",
|
|
671
|
+
prefix: true
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
name: "contains_id",
|
|
675
|
+
type: "text",
|
|
676
|
+
prefix: true
|
|
677
|
+
}
|
|
678
|
+
]
|
|
679
|
+
};
|
|
680
|
+
var fare_rules_default = model11;
|
|
681
|
+
|
|
682
|
+
// src/models/gtfs/fare-transfer-rules.ts
|
|
683
|
+
var model12 = {
|
|
684
|
+
filenameBase: "fare_transfer_rules",
|
|
685
|
+
filenameExtension: "txt",
|
|
686
|
+
schema: [
|
|
687
|
+
{
|
|
688
|
+
name: "from_leg_group_id",
|
|
689
|
+
type: "text",
|
|
690
|
+
primary: true,
|
|
691
|
+
prefix: true
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
name: "to_leg_group_id",
|
|
695
|
+
type: "text",
|
|
696
|
+
primary: true,
|
|
697
|
+
prefix: true
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
name: "transfer_count",
|
|
701
|
+
type: "integer",
|
|
702
|
+
min: -1,
|
|
703
|
+
primary: true
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
name: "transfer_id",
|
|
707
|
+
type: "text",
|
|
708
|
+
prefix: true
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
name: "duration_limit",
|
|
712
|
+
type: "integer",
|
|
713
|
+
min: 0,
|
|
714
|
+
primary: true
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
name: "duration_limit_type",
|
|
718
|
+
type: "integer",
|
|
719
|
+
min: 0,
|
|
720
|
+
max: 3
|
|
721
|
+
},
|
|
722
|
+
{
|
|
723
|
+
name: "fare_transfer_type",
|
|
724
|
+
type: "integer",
|
|
725
|
+
min: 0,
|
|
726
|
+
max: 2,
|
|
727
|
+
required: true
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
name: "fare_product_id",
|
|
731
|
+
type: "text",
|
|
732
|
+
primary: true,
|
|
733
|
+
prefix: true
|
|
734
|
+
}
|
|
735
|
+
]
|
|
736
|
+
};
|
|
737
|
+
var fare_transfer_rules_default = model12;
|
|
738
|
+
|
|
739
|
+
// src/models/gtfs/feed-info.ts
|
|
740
|
+
var model13 = {
|
|
741
|
+
filenameBase: "feed_info",
|
|
742
|
+
filenameExtension: "txt",
|
|
743
|
+
schema: [
|
|
744
|
+
{
|
|
745
|
+
name: "feed_publisher_name",
|
|
746
|
+
type: "text",
|
|
747
|
+
required: true,
|
|
748
|
+
nocase: true
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
name: "feed_publisher_url",
|
|
752
|
+
type: "text",
|
|
753
|
+
required: true
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
name: "feed_lang",
|
|
757
|
+
type: "text",
|
|
758
|
+
required: true
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
name: "default_lang",
|
|
762
|
+
type: "text",
|
|
763
|
+
nocase: true
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
name: "feed_start_date",
|
|
767
|
+
type: "integer"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
name: "feed_end_date",
|
|
771
|
+
type: "integer"
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
name: "feed_version",
|
|
775
|
+
type: "text"
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
name: "feed_contact_email",
|
|
779
|
+
type: "text",
|
|
780
|
+
nocase: true
|
|
781
|
+
},
|
|
782
|
+
{
|
|
783
|
+
name: "feed_contact_url",
|
|
784
|
+
type: "text"
|
|
785
|
+
}
|
|
786
|
+
]
|
|
787
|
+
};
|
|
788
|
+
var feed_info_default = model13;
|
|
789
|
+
|
|
790
|
+
// src/models/gtfs/frequencies.ts
|
|
791
|
+
var model14 = {
|
|
792
|
+
filenameBase: "frequencies",
|
|
793
|
+
filenameExtension: "txt",
|
|
794
|
+
schema: [
|
|
795
|
+
{
|
|
796
|
+
name: "trip_id",
|
|
797
|
+
type: "text",
|
|
798
|
+
required: true,
|
|
799
|
+
primary: true,
|
|
800
|
+
prefix: true
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
name: "start_time",
|
|
804
|
+
type: "text",
|
|
805
|
+
required: true,
|
|
806
|
+
primary: true
|
|
807
|
+
},
|
|
808
|
+
{
|
|
809
|
+
name: "start_timestamp",
|
|
810
|
+
type: "integer"
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
name: "end_time",
|
|
814
|
+
type: "text",
|
|
815
|
+
required: true
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
name: "end_timestamp",
|
|
819
|
+
type: "integer"
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
name: "headway_secs",
|
|
823
|
+
type: "integer",
|
|
824
|
+
required: true,
|
|
825
|
+
min: 0
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
name: "exact_times",
|
|
829
|
+
type: "integer",
|
|
830
|
+
min: 0,
|
|
831
|
+
max: 1
|
|
832
|
+
}
|
|
833
|
+
]
|
|
834
|
+
};
|
|
835
|
+
var frequencies_default = model14;
|
|
836
|
+
|
|
837
|
+
// src/models/gtfs/levels.ts
|
|
838
|
+
var model15 = {
|
|
839
|
+
filenameBase: "levels",
|
|
840
|
+
filenameExtension: "txt",
|
|
841
|
+
schema: [
|
|
842
|
+
{
|
|
843
|
+
name: "level_id",
|
|
844
|
+
type: "text",
|
|
845
|
+
primary: true,
|
|
846
|
+
required: true,
|
|
847
|
+
prefix: true
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
name: "level_index",
|
|
851
|
+
type: "real",
|
|
852
|
+
required: true
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
name: "level_name",
|
|
856
|
+
type: "text",
|
|
857
|
+
nocase: true
|
|
858
|
+
}
|
|
859
|
+
]
|
|
860
|
+
};
|
|
861
|
+
var levels_default = model15;
|
|
862
|
+
|
|
863
|
+
// src/models/gtfs/location-groups.ts
|
|
864
|
+
var model16 = {
|
|
865
|
+
filenameBase: "location_groups",
|
|
866
|
+
filenameExtension: "txt",
|
|
867
|
+
schema: [
|
|
868
|
+
{
|
|
869
|
+
name: "location_group_id",
|
|
870
|
+
type: "text",
|
|
871
|
+
primary: true,
|
|
872
|
+
prefix: true
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
name: "location_group_name",
|
|
876
|
+
type: "text",
|
|
877
|
+
nocase: true
|
|
878
|
+
}
|
|
879
|
+
]
|
|
880
|
+
};
|
|
881
|
+
var location_groups_default = model16;
|
|
882
|
+
|
|
883
|
+
// src/models/gtfs/location-group-stops.ts
|
|
884
|
+
var model17 = {
|
|
885
|
+
filenameBase: "location_group_stops",
|
|
886
|
+
filenameExtension: "txt",
|
|
887
|
+
schema: [
|
|
888
|
+
{
|
|
889
|
+
name: "location_group_id",
|
|
890
|
+
type: "text",
|
|
891
|
+
prefix: true,
|
|
892
|
+
index: true,
|
|
893
|
+
required: true
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
name: "stop_id",
|
|
897
|
+
type: "text",
|
|
898
|
+
required: true,
|
|
899
|
+
prefix: true,
|
|
900
|
+
index: true
|
|
901
|
+
}
|
|
902
|
+
]
|
|
903
|
+
};
|
|
904
|
+
var location_group_stops_default = model17;
|
|
905
|
+
|
|
906
|
+
// src/models/gtfs/locations.ts
|
|
907
|
+
var model18 = {
|
|
908
|
+
filenameBase: "locations",
|
|
909
|
+
filenameExtension: "geojson",
|
|
910
|
+
schema: [
|
|
911
|
+
{
|
|
912
|
+
name: "geojson",
|
|
913
|
+
type: "text"
|
|
914
|
+
}
|
|
915
|
+
]
|
|
916
|
+
};
|
|
917
|
+
var locations_default = model18;
|
|
918
|
+
|
|
919
|
+
// src/models/gtfs/networks.ts
|
|
920
|
+
var model19 = {
|
|
921
|
+
filenameBase: "networks",
|
|
922
|
+
filenameExtension: "txt",
|
|
923
|
+
schema: [
|
|
924
|
+
{
|
|
925
|
+
name: "network_id",
|
|
926
|
+
type: "text",
|
|
927
|
+
primary: true,
|
|
928
|
+
required: true,
|
|
929
|
+
prefix: true
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
name: "network_name",
|
|
933
|
+
type: "text",
|
|
934
|
+
nocase: true
|
|
935
|
+
}
|
|
936
|
+
]
|
|
937
|
+
};
|
|
938
|
+
var networks_default = model19;
|
|
939
|
+
|
|
940
|
+
// src/models/gtfs/pathways.ts
|
|
941
|
+
var model20 = {
|
|
942
|
+
filenameBase: "pathways",
|
|
943
|
+
filenameExtension: "txt",
|
|
944
|
+
schema: [
|
|
945
|
+
{
|
|
946
|
+
name: "pathway_id",
|
|
947
|
+
type: "text",
|
|
948
|
+
primary: true,
|
|
949
|
+
required: true,
|
|
950
|
+
prefix: true
|
|
951
|
+
},
|
|
952
|
+
{
|
|
953
|
+
name: "from_stop_id",
|
|
954
|
+
type: "text",
|
|
955
|
+
required: true,
|
|
956
|
+
prefix: true
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
name: "to_stop_id",
|
|
960
|
+
type: "text",
|
|
961
|
+
required: true,
|
|
962
|
+
prefix: true
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
name: "pathway_mode",
|
|
966
|
+
type: "integer",
|
|
967
|
+
required: true,
|
|
968
|
+
min: 1,
|
|
969
|
+
max: 7
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
name: "is_bidirectional",
|
|
973
|
+
type: "integer",
|
|
974
|
+
required: true,
|
|
975
|
+
min: 0,
|
|
976
|
+
max: 1
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
name: "length",
|
|
980
|
+
type: "real",
|
|
981
|
+
min: 0
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
name: "traversal_time",
|
|
985
|
+
type: "integer",
|
|
986
|
+
min: 0
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
name: "stair_count",
|
|
990
|
+
type: "integer"
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
name: "max_slope",
|
|
994
|
+
type: "real"
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
name: "min_width",
|
|
998
|
+
type: "real",
|
|
999
|
+
min: 0
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
name: "signposted_as",
|
|
1003
|
+
type: "text",
|
|
1004
|
+
nocase: true
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
name: "reversed_signposted_as",
|
|
1008
|
+
type: "text",
|
|
1009
|
+
nocase: true
|
|
1010
|
+
}
|
|
1011
|
+
]
|
|
1012
|
+
};
|
|
1013
|
+
var pathways_default = model20;
|
|
1014
|
+
|
|
1015
|
+
// src/models/gtfs/route-networks.ts
|
|
1016
|
+
var model21 = {
|
|
1017
|
+
filenameBase: "route_networks",
|
|
1018
|
+
filenameExtension: "txt",
|
|
1019
|
+
schema: [
|
|
1020
|
+
{
|
|
1021
|
+
name: "network_id",
|
|
1022
|
+
type: "text",
|
|
1023
|
+
required: true,
|
|
1024
|
+
prefix: true
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
name: "route_id",
|
|
1028
|
+
type: "text",
|
|
1029
|
+
primary: true,
|
|
1030
|
+
index: true,
|
|
1031
|
+
prefix: true
|
|
1032
|
+
}
|
|
1033
|
+
]
|
|
1034
|
+
};
|
|
1035
|
+
var route_networks_default = model21;
|
|
1036
|
+
|
|
1037
|
+
// src/models/gtfs/routes.ts
|
|
1038
|
+
var model22 = {
|
|
1039
|
+
filenameBase: "routes",
|
|
1040
|
+
filenameExtension: "txt",
|
|
1041
|
+
schema: [
|
|
1042
|
+
{
|
|
1043
|
+
name: "route_id",
|
|
1044
|
+
type: "text",
|
|
1045
|
+
primary: true,
|
|
1046
|
+
required: true,
|
|
1047
|
+
prefix: true
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
name: "agency_id",
|
|
1051
|
+
type: "text",
|
|
1052
|
+
prefix: true
|
|
1053
|
+
},
|
|
1054
|
+
{
|
|
1055
|
+
name: "route_short_name",
|
|
1056
|
+
type: "text",
|
|
1057
|
+
nocase: true
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
name: "route_long_name",
|
|
1061
|
+
type: "text",
|
|
1062
|
+
nocase: true
|
|
1063
|
+
},
|
|
1064
|
+
{
|
|
1065
|
+
name: "route_desc",
|
|
1066
|
+
type: "text",
|
|
1067
|
+
nocase: true
|
|
1068
|
+
},
|
|
1069
|
+
{
|
|
1070
|
+
name: "route_type",
|
|
1071
|
+
type: "integer",
|
|
1072
|
+
required: true,
|
|
1073
|
+
min: 0
|
|
1074
|
+
// Support extended GTFS route types with no max value
|
|
1075
|
+
// https://developers.google.com/transit/gtfs/reference/extended-route-types
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
name: "route_url",
|
|
1079
|
+
type: "text"
|
|
1080
|
+
},
|
|
1081
|
+
{
|
|
1082
|
+
name: "route_color",
|
|
1083
|
+
type: "text",
|
|
1084
|
+
nocase: true
|
|
1085
|
+
},
|
|
1086
|
+
{
|
|
1087
|
+
name: "route_text_color",
|
|
1088
|
+
type: "text",
|
|
1089
|
+
nocase: true
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
name: "route_sort_order",
|
|
1093
|
+
type: "integer",
|
|
1094
|
+
min: 0
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
name: "continuous_pickup",
|
|
1098
|
+
type: "integer",
|
|
1099
|
+
min: 0,
|
|
1100
|
+
max: 3
|
|
1101
|
+
},
|
|
1102
|
+
{
|
|
1103
|
+
name: "continuous_drop_off",
|
|
1104
|
+
type: "integer",
|
|
1105
|
+
min: 0,
|
|
1106
|
+
max: 3
|
|
1107
|
+
},
|
|
1108
|
+
{
|
|
1109
|
+
name: "network_id",
|
|
1110
|
+
type: "text",
|
|
1111
|
+
prefix: true
|
|
1112
|
+
}
|
|
1113
|
+
]
|
|
1114
|
+
};
|
|
1115
|
+
var routes_default = model22;
|
|
1116
|
+
|
|
1117
|
+
// src/models/gtfs/shapes.ts
|
|
1118
|
+
var model23 = {
|
|
1119
|
+
filenameBase: "shapes",
|
|
1120
|
+
filenameExtension: "txt",
|
|
1121
|
+
schema: [
|
|
1122
|
+
{
|
|
1123
|
+
name: "shape_id",
|
|
1124
|
+
type: "text",
|
|
1125
|
+
required: true,
|
|
1126
|
+
primary: true,
|
|
1127
|
+
prefix: true
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
name: "shape_pt_lat",
|
|
1131
|
+
type: "real",
|
|
1132
|
+
required: true,
|
|
1133
|
+
min: -90,
|
|
1134
|
+
max: 90
|
|
1135
|
+
},
|
|
1136
|
+
{
|
|
1137
|
+
name: "shape_pt_lon",
|
|
1138
|
+
type: "real",
|
|
1139
|
+
required: true,
|
|
1140
|
+
min: -180,
|
|
1141
|
+
max: 180
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
name: "shape_pt_sequence",
|
|
1145
|
+
type: "integer",
|
|
1146
|
+
required: true,
|
|
1147
|
+
primary: true,
|
|
1148
|
+
min: 0
|
|
1149
|
+
},
|
|
1150
|
+
{
|
|
1151
|
+
name: "shape_dist_traveled",
|
|
1152
|
+
type: "real",
|
|
1153
|
+
min: 0
|
|
1154
|
+
}
|
|
1155
|
+
]
|
|
1156
|
+
};
|
|
1157
|
+
var shapes_default = model23;
|
|
1158
|
+
|
|
1159
|
+
// src/models/gtfs/stop-areas.ts
|
|
1160
|
+
var model24 = {
|
|
1161
|
+
filenameBase: "stop_areas",
|
|
1162
|
+
filenameExtension: "txt",
|
|
1163
|
+
schema: [
|
|
1164
|
+
{
|
|
1165
|
+
name: "area_id",
|
|
1166
|
+
type: "text",
|
|
1167
|
+
required: true,
|
|
1168
|
+
prefix: true
|
|
1169
|
+
},
|
|
1170
|
+
{
|
|
1171
|
+
name: "stop_id",
|
|
1172
|
+
type: "text",
|
|
1173
|
+
required: true,
|
|
1174
|
+
prefix: true
|
|
1175
|
+
}
|
|
1176
|
+
]
|
|
1177
|
+
};
|
|
1178
|
+
var stop_areas_default = model24;
|
|
1179
|
+
|
|
1180
|
+
// src/models/gtfs/stop-times.ts
|
|
1181
|
+
var model25 = {
|
|
1182
|
+
filenameBase: "stop_times",
|
|
1183
|
+
filenameExtension: "txt",
|
|
1184
|
+
schema: [
|
|
1185
|
+
{
|
|
1186
|
+
name: "trip_id",
|
|
1187
|
+
type: "text",
|
|
1188
|
+
required: true,
|
|
1189
|
+
primary: true,
|
|
1190
|
+
prefix: true
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
name: "arrival_time",
|
|
1194
|
+
type: "text"
|
|
1195
|
+
},
|
|
1196
|
+
{
|
|
1197
|
+
name: "arrival_timestamp",
|
|
1198
|
+
type: "integer",
|
|
1199
|
+
index: true
|
|
1200
|
+
},
|
|
1201
|
+
{
|
|
1202
|
+
name: "departure_time",
|
|
1203
|
+
type: "text"
|
|
1204
|
+
},
|
|
1205
|
+
{
|
|
1206
|
+
name: "departure_timestamp",
|
|
1207
|
+
type: "integer",
|
|
1208
|
+
index: true
|
|
1209
|
+
},
|
|
1210
|
+
{
|
|
1211
|
+
name: "location_group_id",
|
|
1212
|
+
type: "text",
|
|
1213
|
+
prefix: true,
|
|
1214
|
+
index: true
|
|
1215
|
+
},
|
|
1216
|
+
{
|
|
1217
|
+
name: "location_id",
|
|
1218
|
+
type: "text",
|
|
1219
|
+
prefix: true,
|
|
1220
|
+
index: true
|
|
1221
|
+
},
|
|
1222
|
+
{
|
|
1223
|
+
name: "stop_id",
|
|
1224
|
+
type: "text",
|
|
1225
|
+
required: true,
|
|
1226
|
+
prefix: true,
|
|
1227
|
+
index: true
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
name: "stop_sequence",
|
|
1231
|
+
type: "integer",
|
|
1232
|
+
required: true,
|
|
1233
|
+
primary: true,
|
|
1234
|
+
min: 0
|
|
1235
|
+
},
|
|
1236
|
+
{
|
|
1237
|
+
name: "stop_headsign",
|
|
1238
|
+
type: "text",
|
|
1239
|
+
nocase: true
|
|
1240
|
+
},
|
|
1241
|
+
{
|
|
1242
|
+
name: "start_pickup_drop_off_window",
|
|
1243
|
+
type: "text"
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
name: "start_pickup_drop_off_window_timestamp",
|
|
1247
|
+
type: "integer",
|
|
1248
|
+
index: true
|
|
1249
|
+
},
|
|
1250
|
+
{
|
|
1251
|
+
name: "pickup_type",
|
|
1252
|
+
type: "integer",
|
|
1253
|
+
min: 0,
|
|
1254
|
+
max: 3
|
|
1255
|
+
},
|
|
1256
|
+
{
|
|
1257
|
+
name: "drop_off_type",
|
|
1258
|
+
type: "integer",
|
|
1259
|
+
min: 0,
|
|
1260
|
+
max: 3
|
|
1261
|
+
},
|
|
1262
|
+
{
|
|
1263
|
+
name: "continuous_pickup",
|
|
1264
|
+
type: "integer",
|
|
1265
|
+
min: 0,
|
|
1266
|
+
max: 3
|
|
1267
|
+
},
|
|
1268
|
+
{
|
|
1269
|
+
name: "continuous_drop_off",
|
|
1270
|
+
type: "integer",
|
|
1271
|
+
min: 0,
|
|
1272
|
+
max: 3
|
|
1273
|
+
},
|
|
1274
|
+
{
|
|
1275
|
+
name: "shape_dist_traveled",
|
|
1276
|
+
type: "real",
|
|
1277
|
+
min: 0
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
name: "timepoint",
|
|
1281
|
+
type: "integer",
|
|
1282
|
+
min: 0,
|
|
1283
|
+
max: 1
|
|
1284
|
+
},
|
|
1285
|
+
{
|
|
1286
|
+
name: "pickup_booking_rule_id",
|
|
1287
|
+
type: "text",
|
|
1288
|
+
prefix: true,
|
|
1289
|
+
index: true
|
|
1290
|
+
},
|
|
1291
|
+
{
|
|
1292
|
+
name: "drop_off_booking_rule_id",
|
|
1293
|
+
type: "text",
|
|
1294
|
+
prefix: true,
|
|
1295
|
+
index: true
|
|
1296
|
+
}
|
|
1297
|
+
]
|
|
1298
|
+
};
|
|
1299
|
+
var stop_times_default = model25;
|
|
1300
|
+
|
|
1301
|
+
// src/models/gtfs/stops.ts
|
|
1302
|
+
var model26 = {
|
|
1303
|
+
filenameBase: "stops",
|
|
1304
|
+
filenameExtension: "txt",
|
|
1305
|
+
schema: [
|
|
1306
|
+
{
|
|
1307
|
+
name: "stop_id",
|
|
1308
|
+
type: "text",
|
|
1309
|
+
primary: true,
|
|
1310
|
+
required: true,
|
|
1311
|
+
prefix: true
|
|
1312
|
+
},
|
|
1313
|
+
{
|
|
1314
|
+
name: "stop_code",
|
|
1315
|
+
type: "text"
|
|
1316
|
+
},
|
|
1317
|
+
{
|
|
1318
|
+
name: "stop_name",
|
|
1319
|
+
type: "text",
|
|
1320
|
+
nocase: true
|
|
1321
|
+
},
|
|
1322
|
+
{
|
|
1323
|
+
name: "tts_stop_name",
|
|
1324
|
+
type: "text",
|
|
1325
|
+
nocase: true
|
|
1326
|
+
},
|
|
1327
|
+
{
|
|
1328
|
+
name: "stop_desc",
|
|
1329
|
+
type: "text",
|
|
1330
|
+
nocase: true
|
|
1331
|
+
},
|
|
1332
|
+
{
|
|
1333
|
+
name: "stop_lat",
|
|
1334
|
+
type: "real",
|
|
1335
|
+
min: -90,
|
|
1336
|
+
max: 90
|
|
1337
|
+
},
|
|
1338
|
+
{
|
|
1339
|
+
name: "stop_lon",
|
|
1340
|
+
type: "real",
|
|
1341
|
+
min: -180,
|
|
1342
|
+
max: 180
|
|
1343
|
+
},
|
|
1344
|
+
{
|
|
1345
|
+
name: "zone_id",
|
|
1346
|
+
type: "text",
|
|
1347
|
+
prefix: true
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
name: "stop_url",
|
|
1351
|
+
type: "text"
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
name: "location_type",
|
|
1355
|
+
type: "integer",
|
|
1356
|
+
min: 0,
|
|
1357
|
+
max: 4
|
|
1358
|
+
},
|
|
1359
|
+
{
|
|
1360
|
+
name: "parent_station",
|
|
1361
|
+
type: "text",
|
|
1362
|
+
index: true
|
|
1363
|
+
},
|
|
1364
|
+
{
|
|
1365
|
+
name: "stop_timezone",
|
|
1366
|
+
type: "text"
|
|
1367
|
+
},
|
|
1368
|
+
{
|
|
1369
|
+
name: "wheelchair_boarding",
|
|
1370
|
+
type: "integer",
|
|
1371
|
+
min: 0,
|
|
1372
|
+
max: 2
|
|
1373
|
+
},
|
|
1374
|
+
{
|
|
1375
|
+
name: "level_id",
|
|
1376
|
+
type: "text",
|
|
1377
|
+
prefix: true
|
|
1378
|
+
},
|
|
1379
|
+
{
|
|
1380
|
+
name: "platform_code",
|
|
1381
|
+
type: "text"
|
|
1382
|
+
}
|
|
1383
|
+
]
|
|
1384
|
+
};
|
|
1385
|
+
var stops_default = model26;
|
|
1386
|
+
|
|
1387
|
+
// src/models/gtfs/timeframes.ts
|
|
1388
|
+
var model27 = {
|
|
1389
|
+
filenameBase: "timeframes",
|
|
1390
|
+
filenameExtension: "txt",
|
|
1391
|
+
schema: [
|
|
1392
|
+
{
|
|
1393
|
+
name: "timeframe_group_id",
|
|
1394
|
+
type: "text",
|
|
1395
|
+
primary: true,
|
|
1396
|
+
prefix: true
|
|
1397
|
+
},
|
|
1398
|
+
{
|
|
1399
|
+
name: "start_time",
|
|
1400
|
+
type: "text"
|
|
1401
|
+
},
|
|
1402
|
+
{
|
|
1403
|
+
name: "end_time",
|
|
1404
|
+
type: "text"
|
|
1405
|
+
},
|
|
1406
|
+
{
|
|
1407
|
+
name: "service_id",
|
|
1408
|
+
type: "text",
|
|
1409
|
+
required: true,
|
|
1410
|
+
index: true,
|
|
1411
|
+
prefix: true
|
|
1412
|
+
}
|
|
1413
|
+
]
|
|
1414
|
+
};
|
|
1415
|
+
var timeframes_default = model27;
|
|
1416
|
+
|
|
1417
|
+
// src/models/gtfs/transfers.ts
|
|
1418
|
+
var model28 = {
|
|
1419
|
+
filenameBase: "transfers",
|
|
1420
|
+
filenameExtension: "txt",
|
|
1421
|
+
schema: [
|
|
1422
|
+
{
|
|
1423
|
+
name: "from_stop_id",
|
|
1424
|
+
type: "text",
|
|
1425
|
+
primary: true,
|
|
1426
|
+
prefix: true
|
|
1427
|
+
},
|
|
1428
|
+
{
|
|
1429
|
+
name: "to_stop_id",
|
|
1430
|
+
type: "text",
|
|
1431
|
+
primary: true,
|
|
1432
|
+
prefix: true
|
|
1433
|
+
},
|
|
1434
|
+
{
|
|
1435
|
+
name: "from_route_id",
|
|
1436
|
+
type: "text",
|
|
1437
|
+
primary: true,
|
|
1438
|
+
prefix: true
|
|
1439
|
+
},
|
|
1440
|
+
{
|
|
1441
|
+
name: "to_route_id",
|
|
1442
|
+
type: "text",
|
|
1443
|
+
primary: true,
|
|
1444
|
+
prefix: true
|
|
1445
|
+
},
|
|
1446
|
+
{
|
|
1447
|
+
name: "from_trip_id",
|
|
1448
|
+
type: "text",
|
|
1449
|
+
primary: true,
|
|
1450
|
+
prefix: true
|
|
1451
|
+
},
|
|
1452
|
+
{
|
|
1453
|
+
name: "to_trip_id",
|
|
1454
|
+
type: "text",
|
|
1455
|
+
primary: true,
|
|
1456
|
+
prefix: true
|
|
1457
|
+
},
|
|
1458
|
+
{
|
|
1459
|
+
name: "transfer_type",
|
|
1460
|
+
type: "integer",
|
|
1461
|
+
min: 0,
|
|
1462
|
+
max: 5,
|
|
1463
|
+
default: 0
|
|
1464
|
+
},
|
|
1465
|
+
{
|
|
1466
|
+
name: "min_transfer_time",
|
|
1467
|
+
type: "integer",
|
|
1468
|
+
min: 0
|
|
1469
|
+
}
|
|
1470
|
+
]
|
|
1471
|
+
};
|
|
1472
|
+
var transfers_default = model28;
|
|
1473
|
+
|
|
1474
|
+
// src/models/gtfs/translations.ts
|
|
1475
|
+
var model29 = {
|
|
1476
|
+
filenameBase: "translations",
|
|
1477
|
+
filenameExtension: "txt",
|
|
1478
|
+
schema: [
|
|
1479
|
+
{
|
|
1480
|
+
name: "table_name",
|
|
1481
|
+
type: "text",
|
|
1482
|
+
primary: true,
|
|
1483
|
+
required: true
|
|
1484
|
+
},
|
|
1485
|
+
{
|
|
1486
|
+
name: "field_name",
|
|
1487
|
+
type: "text",
|
|
1488
|
+
primary: true,
|
|
1489
|
+
required: true
|
|
1490
|
+
},
|
|
1491
|
+
{
|
|
1492
|
+
name: "language",
|
|
1493
|
+
type: "text",
|
|
1494
|
+
primary: true,
|
|
1495
|
+
required: true
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
name: "translation",
|
|
1499
|
+
type: "text",
|
|
1500
|
+
required: true
|
|
1501
|
+
},
|
|
1502
|
+
{
|
|
1503
|
+
name: "record_id",
|
|
1504
|
+
type: "text",
|
|
1505
|
+
primary: true,
|
|
1506
|
+
prefix: true
|
|
1507
|
+
},
|
|
1508
|
+
{
|
|
1509
|
+
name: "record_sub_id",
|
|
1510
|
+
type: "text",
|
|
1511
|
+
primary: true,
|
|
1512
|
+
prefix: true
|
|
1513
|
+
},
|
|
1514
|
+
{
|
|
1515
|
+
name: "field_value",
|
|
1516
|
+
type: "text",
|
|
1517
|
+
primary: true
|
|
1518
|
+
}
|
|
1519
|
+
]
|
|
1520
|
+
};
|
|
1521
|
+
var translations_default = model29;
|
|
1522
|
+
|
|
1523
|
+
// src/models/gtfs/trips.ts
|
|
1524
|
+
var model30 = {
|
|
1525
|
+
filenameBase: "trips",
|
|
1526
|
+
filenameExtension: "txt",
|
|
1527
|
+
schema: [
|
|
1528
|
+
{
|
|
1529
|
+
name: "route_id",
|
|
1530
|
+
type: "text",
|
|
1531
|
+
required: true,
|
|
1532
|
+
index: true,
|
|
1533
|
+
prefix: true
|
|
1534
|
+
},
|
|
1535
|
+
{
|
|
1536
|
+
name: "service_id",
|
|
1537
|
+
type: "text",
|
|
1538
|
+
required: true,
|
|
1539
|
+
index: true,
|
|
1540
|
+
prefix: true
|
|
1541
|
+
},
|
|
1542
|
+
{
|
|
1543
|
+
name: "trip_id",
|
|
1544
|
+
type: "text",
|
|
1545
|
+
primary: true,
|
|
1546
|
+
required: true,
|
|
1547
|
+
prefix: true
|
|
1548
|
+
},
|
|
1549
|
+
{
|
|
1550
|
+
name: "trip_headsign",
|
|
1551
|
+
type: "text",
|
|
1552
|
+
nocase: true
|
|
1553
|
+
},
|
|
1554
|
+
{
|
|
1555
|
+
name: "trip_short_name",
|
|
1556
|
+
type: "text",
|
|
1557
|
+
nocase: true
|
|
1558
|
+
},
|
|
1559
|
+
{
|
|
1560
|
+
name: "direction_id",
|
|
1561
|
+
type: "integer",
|
|
1562
|
+
min: 0,
|
|
1563
|
+
max: 1,
|
|
1564
|
+
index: true
|
|
1565
|
+
},
|
|
1566
|
+
{
|
|
1567
|
+
name: "block_id",
|
|
1568
|
+
type: "text",
|
|
1569
|
+
index: true,
|
|
1570
|
+
prefix: true
|
|
1571
|
+
},
|
|
1572
|
+
{
|
|
1573
|
+
name: "shape_id",
|
|
1574
|
+
type: "text",
|
|
1575
|
+
index: true,
|
|
1576
|
+
prefix: true
|
|
1577
|
+
},
|
|
1578
|
+
{
|
|
1579
|
+
name: "wheelchair_accessible",
|
|
1580
|
+
type: "integer",
|
|
1581
|
+
min: 0,
|
|
1582
|
+
max: 2
|
|
1583
|
+
},
|
|
1584
|
+
{
|
|
1585
|
+
name: "bikes_allowed",
|
|
1586
|
+
type: "integer",
|
|
1587
|
+
min: 0,
|
|
1588
|
+
max: 2
|
|
1589
|
+
}
|
|
1590
|
+
]
|
|
1591
|
+
};
|
|
1592
|
+
var trips_default = model30;
|
|
1593
|
+
|
|
1594
|
+
// src/models/non-standard/timetables.ts
|
|
1595
|
+
var model31 = {
|
|
1596
|
+
filenameBase: "timetables",
|
|
1597
|
+
filenameExtension: "txt",
|
|
1598
|
+
nonstandard: true,
|
|
1599
|
+
schema: [
|
|
1600
|
+
{
|
|
1601
|
+
name: "id",
|
|
1602
|
+
type: "integer",
|
|
1603
|
+
primary: true,
|
|
1604
|
+
prefix: true
|
|
1605
|
+
},
|
|
1606
|
+
{
|
|
1607
|
+
name: "timetable_id",
|
|
1608
|
+
type: "text",
|
|
1609
|
+
prefix: true
|
|
1610
|
+
},
|
|
1611
|
+
{
|
|
1612
|
+
name: "route_id",
|
|
1613
|
+
type: "text",
|
|
1614
|
+
prefix: true
|
|
1615
|
+
},
|
|
1616
|
+
{
|
|
1617
|
+
name: "direction_id",
|
|
1618
|
+
type: "integer",
|
|
1619
|
+
min: 0,
|
|
1620
|
+
max: 1
|
|
1621
|
+
},
|
|
1622
|
+
{
|
|
1623
|
+
name: "start_date",
|
|
1624
|
+
type: "integer"
|
|
1625
|
+
},
|
|
1626
|
+
{
|
|
1627
|
+
name: "end_date",
|
|
1628
|
+
type: "integer"
|
|
1629
|
+
},
|
|
1630
|
+
{
|
|
1631
|
+
name: "monday",
|
|
1632
|
+
type: "integer",
|
|
1633
|
+
required: true,
|
|
1634
|
+
min: 0,
|
|
1635
|
+
max: 1
|
|
1636
|
+
},
|
|
1637
|
+
{
|
|
1638
|
+
name: "tuesday",
|
|
1639
|
+
type: "integer",
|
|
1640
|
+
required: true,
|
|
1641
|
+
min: 0,
|
|
1642
|
+
max: 1
|
|
1643
|
+
},
|
|
1644
|
+
{
|
|
1645
|
+
name: "wednesday",
|
|
1646
|
+
type: "integer",
|
|
1647
|
+
required: true,
|
|
1648
|
+
min: 0,
|
|
1649
|
+
max: 1
|
|
1650
|
+
},
|
|
1651
|
+
{
|
|
1652
|
+
name: "thursday",
|
|
1653
|
+
type: "integer",
|
|
1654
|
+
required: true,
|
|
1655
|
+
min: 0,
|
|
1656
|
+
max: 1
|
|
1657
|
+
},
|
|
1658
|
+
{
|
|
1659
|
+
name: "friday",
|
|
1660
|
+
type: "integer",
|
|
1661
|
+
required: true,
|
|
1662
|
+
min: 0,
|
|
1663
|
+
max: 1
|
|
1664
|
+
},
|
|
1665
|
+
{
|
|
1666
|
+
name: "saturday",
|
|
1667
|
+
type: "integer",
|
|
1668
|
+
required: true,
|
|
1669
|
+
min: 0,
|
|
1670
|
+
max: 1
|
|
1671
|
+
},
|
|
1672
|
+
{
|
|
1673
|
+
name: "sunday",
|
|
1674
|
+
type: "integer",
|
|
1675
|
+
required: true,
|
|
1676
|
+
min: 0,
|
|
1677
|
+
max: 1
|
|
1678
|
+
},
|
|
1679
|
+
{
|
|
1680
|
+
name: "start_time",
|
|
1681
|
+
type: "text"
|
|
1682
|
+
},
|
|
1683
|
+
{
|
|
1684
|
+
name: "start_timestamp",
|
|
1685
|
+
type: "integer"
|
|
1686
|
+
},
|
|
1687
|
+
{
|
|
1688
|
+
name: "end_time",
|
|
1689
|
+
type: "text"
|
|
1690
|
+
},
|
|
1691
|
+
{
|
|
1692
|
+
name: "end_timestamp",
|
|
1693
|
+
type: "integer"
|
|
1694
|
+
},
|
|
1695
|
+
{
|
|
1696
|
+
name: "timetable_label",
|
|
1697
|
+
type: "text",
|
|
1698
|
+
nocase: true
|
|
1699
|
+
},
|
|
1700
|
+
{
|
|
1701
|
+
name: "service_notes",
|
|
1702
|
+
type: "text",
|
|
1703
|
+
nocase: true
|
|
1704
|
+
},
|
|
1705
|
+
{
|
|
1706
|
+
name: "orientation",
|
|
1707
|
+
type: "text"
|
|
1708
|
+
},
|
|
1709
|
+
{
|
|
1710
|
+
name: "timetable_page_id",
|
|
1711
|
+
type: "text"
|
|
1712
|
+
},
|
|
1713
|
+
{
|
|
1714
|
+
name: "timetable_sequence",
|
|
1715
|
+
type: "integer",
|
|
1716
|
+
min: 0,
|
|
1717
|
+
index: true
|
|
1718
|
+
},
|
|
1719
|
+
{
|
|
1720
|
+
name: "direction_name",
|
|
1721
|
+
type: "text"
|
|
1722
|
+
},
|
|
1723
|
+
{
|
|
1724
|
+
name: "include_exceptions",
|
|
1725
|
+
type: "integer",
|
|
1726
|
+
min: 0,
|
|
1727
|
+
max: 1
|
|
1728
|
+
},
|
|
1729
|
+
{
|
|
1730
|
+
name: "show_trip_continuation",
|
|
1731
|
+
type: "integer",
|
|
1732
|
+
min: 0,
|
|
1733
|
+
max: 1
|
|
1734
|
+
}
|
|
1735
|
+
]
|
|
1736
|
+
};
|
|
1737
|
+
var timetables_default = model31;
|
|
1738
|
+
|
|
1739
|
+
// src/models/non-standard/timetable-pages.ts
|
|
1740
|
+
var model32 = {
|
|
1741
|
+
filenameBase: "timetable_pages",
|
|
1742
|
+
filenameExtension: "txt",
|
|
1743
|
+
nonstandard: true,
|
|
1744
|
+
schema: [
|
|
1745
|
+
{
|
|
1746
|
+
name: "timetable_page_id",
|
|
1747
|
+
type: "text",
|
|
1748
|
+
primary: true,
|
|
1749
|
+
prefix: true
|
|
1750
|
+
},
|
|
1751
|
+
{
|
|
1752
|
+
name: "timetable_page_label",
|
|
1753
|
+
type: "text"
|
|
1754
|
+
},
|
|
1755
|
+
{
|
|
1756
|
+
name: "filename",
|
|
1757
|
+
type: "text"
|
|
1758
|
+
}
|
|
1759
|
+
]
|
|
1760
|
+
};
|
|
1761
|
+
var timetable_pages_default = model32;
|
|
1762
|
+
|
|
1763
|
+
// src/models/non-standard/timetable-stop-order.ts
|
|
1764
|
+
var model33 = {
|
|
1765
|
+
filenameBase: "timetable_stop_order",
|
|
1766
|
+
filenameExtension: "txt",
|
|
1767
|
+
nonstandard: true,
|
|
1768
|
+
schema: [
|
|
1769
|
+
{
|
|
1770
|
+
name: "id",
|
|
1771
|
+
type: "integer",
|
|
1772
|
+
primary: true,
|
|
1773
|
+
prefix: true
|
|
1774
|
+
},
|
|
1775
|
+
{
|
|
1776
|
+
name: "timetable_id",
|
|
1777
|
+
type: "text",
|
|
1778
|
+
index: true,
|
|
1779
|
+
prefix: true
|
|
1780
|
+
},
|
|
1781
|
+
{
|
|
1782
|
+
name: "stop_id",
|
|
1783
|
+
type: "text",
|
|
1784
|
+
prefix: true
|
|
1785
|
+
},
|
|
1786
|
+
{
|
|
1787
|
+
name: "stop_sequence",
|
|
1788
|
+
type: "integer",
|
|
1789
|
+
min: 0,
|
|
1790
|
+
index: true
|
|
1791
|
+
}
|
|
1792
|
+
]
|
|
1793
|
+
};
|
|
1794
|
+
var timetable_stop_order_default = model33;
|
|
1795
|
+
|
|
1796
|
+
// src/models/non-standard/timetable-notes.ts
|
|
1797
|
+
var model34 = {
|
|
1798
|
+
filenameBase: "timetable_notes",
|
|
1799
|
+
filenameExtension: "txt",
|
|
1800
|
+
nonstandard: true,
|
|
1801
|
+
schema: [
|
|
1802
|
+
{
|
|
1803
|
+
name: "note_id",
|
|
1804
|
+
type: "text",
|
|
1805
|
+
primary: true,
|
|
1806
|
+
prefix: true
|
|
1807
|
+
},
|
|
1808
|
+
{
|
|
1809
|
+
name: "symbol",
|
|
1810
|
+
type: "text"
|
|
1811
|
+
},
|
|
1812
|
+
{
|
|
1813
|
+
name: "note",
|
|
1814
|
+
type: "text",
|
|
1815
|
+
nocase: true
|
|
1816
|
+
}
|
|
1817
|
+
]
|
|
1818
|
+
};
|
|
1819
|
+
var timetable_notes_default = model34;
|
|
1820
|
+
|
|
1821
|
+
// src/models/non-standard/timetable-notes-references.ts
|
|
1822
|
+
var model35 = {
|
|
1823
|
+
filenameBase: "timetable_notes_references",
|
|
1824
|
+
filenameExtension: "txt",
|
|
1825
|
+
nonstandard: true,
|
|
1826
|
+
schema: [
|
|
1827
|
+
{
|
|
1828
|
+
name: "note_id",
|
|
1829
|
+
type: "text",
|
|
1830
|
+
prefix: true
|
|
1831
|
+
},
|
|
1832
|
+
{
|
|
1833
|
+
name: "timetable_id",
|
|
1834
|
+
type: "text",
|
|
1835
|
+
index: true,
|
|
1836
|
+
prefix: true
|
|
1837
|
+
},
|
|
1838
|
+
{
|
|
1839
|
+
name: "route_id",
|
|
1840
|
+
type: "text",
|
|
1841
|
+
index: true,
|
|
1842
|
+
prefix: true
|
|
1843
|
+
},
|
|
1844
|
+
{
|
|
1845
|
+
name: "trip_id",
|
|
1846
|
+
type: "text",
|
|
1847
|
+
index: true,
|
|
1848
|
+
prefix: true
|
|
1849
|
+
},
|
|
1850
|
+
{
|
|
1851
|
+
name: "stop_id",
|
|
1852
|
+
type: "text",
|
|
1853
|
+
index: true,
|
|
1854
|
+
prefix: true
|
|
1855
|
+
},
|
|
1856
|
+
{
|
|
1857
|
+
name: "stop_sequence",
|
|
1858
|
+
type: "integer",
|
|
1859
|
+
min: 0,
|
|
1860
|
+
index: true
|
|
1861
|
+
},
|
|
1862
|
+
{
|
|
1863
|
+
name: "show_on_stoptime",
|
|
1864
|
+
type: "integer",
|
|
1865
|
+
min: 0,
|
|
1866
|
+
max: 1
|
|
1867
|
+
}
|
|
1868
|
+
]
|
|
1869
|
+
};
|
|
1870
|
+
var timetable_notes_references_default = model35;
|
|
1871
|
+
|
|
1872
|
+
// src/models/non-standard/trips-dated-vehicle-journey.ts
|
|
1873
|
+
var model36 = {
|
|
1874
|
+
filenameBase: "trips_dated_vehicle_journeys",
|
|
1875
|
+
filenameExtension: "txt",
|
|
1876
|
+
nonstandard: true,
|
|
1877
|
+
schema: [
|
|
1878
|
+
{
|
|
1879
|
+
name: "trip_id",
|
|
1880
|
+
type: "text",
|
|
1881
|
+
required: true,
|
|
1882
|
+
index: true,
|
|
1883
|
+
prefix: true
|
|
1884
|
+
},
|
|
1885
|
+
{
|
|
1886
|
+
name: "operating_day_date",
|
|
1887
|
+
type: "text",
|
|
1888
|
+
index: true,
|
|
1889
|
+
required: true
|
|
1890
|
+
},
|
|
1891
|
+
{
|
|
1892
|
+
name: "dated_vehicle_journey_gid",
|
|
1893
|
+
type: "text",
|
|
1894
|
+
required: true
|
|
1895
|
+
},
|
|
1896
|
+
{
|
|
1897
|
+
name: "journey_number",
|
|
1898
|
+
type: "integer",
|
|
1899
|
+
min: 0,
|
|
1900
|
+
max: 65535,
|
|
1901
|
+
index: true
|
|
1902
|
+
}
|
|
1903
|
+
]
|
|
1904
|
+
};
|
|
1905
|
+
var trips_dated_vehicle_journey_default = model36;
|
|
1906
|
+
|
|
1907
|
+
// src/models/gtfs-plus/calendar-attributes.ts
|
|
1908
|
+
var model37 = {
|
|
1909
|
+
filenameBase: "calendar_attributes",
|
|
1910
|
+
filenameExtension: "txt",
|
|
1911
|
+
nonstandard: true,
|
|
1912
|
+
extension: "gtfs-plus",
|
|
1913
|
+
schema: [
|
|
1914
|
+
{
|
|
1915
|
+
name: "service_id",
|
|
1916
|
+
type: "text",
|
|
1917
|
+
primary: true,
|
|
1918
|
+
prefix: true
|
|
1919
|
+
},
|
|
1920
|
+
{
|
|
1921
|
+
name: "service_description",
|
|
1922
|
+
type: "text",
|
|
1923
|
+
required: true,
|
|
1924
|
+
nocase: true
|
|
1925
|
+
}
|
|
1926
|
+
]
|
|
1927
|
+
};
|
|
1928
|
+
var calendar_attributes_default = model37;
|
|
1929
|
+
|
|
1930
|
+
// src/models/gtfs-plus/directions.ts
|
|
1931
|
+
var model38 = {
|
|
1932
|
+
filenameBase: "directions",
|
|
1933
|
+
filenameExtension: "txt",
|
|
1934
|
+
nonstandard: true,
|
|
1935
|
+
extension: "gtfs-plus",
|
|
1936
|
+
schema: [
|
|
1937
|
+
{
|
|
1938
|
+
name: "route_id",
|
|
1939
|
+
type: "text",
|
|
1940
|
+
required: true,
|
|
1941
|
+
primary: true,
|
|
1942
|
+
prefix: true
|
|
1943
|
+
},
|
|
1944
|
+
{
|
|
1945
|
+
name: "direction_id",
|
|
1946
|
+
type: "integer",
|
|
1947
|
+
min: 0,
|
|
1948
|
+
max: 1,
|
|
1949
|
+
primary: true
|
|
1950
|
+
},
|
|
1951
|
+
{
|
|
1952
|
+
name: "direction",
|
|
1953
|
+
type: "text",
|
|
1954
|
+
required: true
|
|
1955
|
+
}
|
|
1956
|
+
]
|
|
1957
|
+
};
|
|
1958
|
+
var directions_default = model38;
|
|
1959
|
+
|
|
1960
|
+
// src/models/gtfs-plus/route-attributes.ts
|
|
1961
|
+
var model39 = {
|
|
1962
|
+
filenameBase: "route_attributes",
|
|
1963
|
+
filenameExtension: "txt",
|
|
1964
|
+
nonstandard: true,
|
|
1965
|
+
extension: "gtfs-plus",
|
|
1966
|
+
schema: [
|
|
1967
|
+
{
|
|
1968
|
+
name: "route_id",
|
|
1969
|
+
type: "text",
|
|
1970
|
+
primary: true,
|
|
1971
|
+
prefix: true
|
|
1972
|
+
},
|
|
1973
|
+
{
|
|
1974
|
+
name: "category",
|
|
1975
|
+
type: "integer",
|
|
1976
|
+
min: 0,
|
|
1977
|
+
required: true
|
|
1978
|
+
},
|
|
1979
|
+
{
|
|
1980
|
+
name: "subcategory",
|
|
1981
|
+
type: "integer",
|
|
1982
|
+
min: 101,
|
|
1983
|
+
required: true
|
|
1984
|
+
},
|
|
1985
|
+
{
|
|
1986
|
+
name: "running_way",
|
|
1987
|
+
type: "integer",
|
|
1988
|
+
min: 1,
|
|
1989
|
+
required: true
|
|
1990
|
+
}
|
|
1991
|
+
]
|
|
1992
|
+
};
|
|
1993
|
+
var route_attributes_default = model39;
|
|
1994
|
+
|
|
1995
|
+
// src/models/gtfs-plus/stop-attributes.ts
|
|
1996
|
+
var model40 = {
|
|
1997
|
+
filenameBase: "stop_attributes",
|
|
1998
|
+
filenameExtension: "txt",
|
|
1999
|
+
nonstandard: true,
|
|
2000
|
+
extension: "gtfs-plus",
|
|
2001
|
+
schema: [
|
|
2002
|
+
{
|
|
2003
|
+
name: "stop_id",
|
|
2004
|
+
type: "text",
|
|
2005
|
+
required: true,
|
|
2006
|
+
primary: true,
|
|
2007
|
+
prefix: true
|
|
2008
|
+
},
|
|
2009
|
+
{
|
|
2010
|
+
name: "accessibility_id",
|
|
2011
|
+
type: "integer",
|
|
2012
|
+
min: 0
|
|
2013
|
+
},
|
|
2014
|
+
{
|
|
2015
|
+
name: "cardinal_direction",
|
|
2016
|
+
type: "text"
|
|
2017
|
+
},
|
|
2018
|
+
{
|
|
2019
|
+
name: "relative_position",
|
|
2020
|
+
type: "text"
|
|
2021
|
+
},
|
|
2022
|
+
{
|
|
2023
|
+
name: "stop_city",
|
|
2024
|
+
type: "text",
|
|
2025
|
+
nocase: true
|
|
2026
|
+
}
|
|
2027
|
+
]
|
|
2028
|
+
};
|
|
2029
|
+
var stop_attributes_default = model40;
|
|
2030
|
+
|
|
2031
|
+
// src/models/gtfs-ride/board-alight.ts
|
|
2032
|
+
var model41 = {
|
|
2033
|
+
filenameBase: "board_alight",
|
|
2034
|
+
filenameExtension: "txt",
|
|
2035
|
+
nonstandard: true,
|
|
2036
|
+
extension: "gtfs-ride",
|
|
2037
|
+
schema: [
|
|
2038
|
+
{
|
|
2039
|
+
name: "trip_id",
|
|
2040
|
+
type: "text",
|
|
2041
|
+
required: true,
|
|
2042
|
+
index: true,
|
|
2043
|
+
prefix: true
|
|
2044
|
+
},
|
|
2045
|
+
{
|
|
2046
|
+
name: "stop_id",
|
|
2047
|
+
type: "text",
|
|
2048
|
+
required: true,
|
|
2049
|
+
index: true,
|
|
2050
|
+
prefix: true
|
|
2051
|
+
},
|
|
2052
|
+
{
|
|
2053
|
+
name: "stop_sequence",
|
|
2054
|
+
type: "integer",
|
|
2055
|
+
required: true,
|
|
2056
|
+
min: 0,
|
|
2057
|
+
index: true
|
|
2058
|
+
},
|
|
2059
|
+
{
|
|
2060
|
+
name: "record_use",
|
|
2061
|
+
type: "integer",
|
|
2062
|
+
required: true,
|
|
2063
|
+
min: 0,
|
|
2064
|
+
max: 1,
|
|
2065
|
+
index: true
|
|
2066
|
+
},
|
|
2067
|
+
{
|
|
2068
|
+
name: "schedule_relationship",
|
|
2069
|
+
type: "integer",
|
|
2070
|
+
min: 0,
|
|
2071
|
+
max: 8
|
|
2072
|
+
},
|
|
2073
|
+
{
|
|
2074
|
+
name: "boardings",
|
|
2075
|
+
type: "integer",
|
|
2076
|
+
min: 0
|
|
2077
|
+
},
|
|
2078
|
+
{
|
|
2079
|
+
name: "alightings",
|
|
2080
|
+
type: "integer",
|
|
2081
|
+
min: 0
|
|
2082
|
+
},
|
|
2083
|
+
{
|
|
2084
|
+
name: "current_load",
|
|
2085
|
+
type: "integer",
|
|
2086
|
+
min: 0
|
|
2087
|
+
},
|
|
2088
|
+
{
|
|
2089
|
+
name: "load_count",
|
|
2090
|
+
type: "integer",
|
|
2091
|
+
min: 0
|
|
2092
|
+
},
|
|
2093
|
+
{
|
|
2094
|
+
name: "load_type",
|
|
2095
|
+
type: "integer",
|
|
2096
|
+
min: 0,
|
|
2097
|
+
max: 1
|
|
2098
|
+
},
|
|
2099
|
+
{
|
|
2100
|
+
name: "rack_down",
|
|
2101
|
+
type: "integer",
|
|
2102
|
+
min: 0,
|
|
2103
|
+
max: 1
|
|
2104
|
+
},
|
|
2105
|
+
{
|
|
2106
|
+
name: "bike_boardings",
|
|
2107
|
+
type: "integer",
|
|
2108
|
+
min: 0
|
|
2109
|
+
},
|
|
2110
|
+
{
|
|
2111
|
+
name: "bike_alightings",
|
|
2112
|
+
type: "integer",
|
|
2113
|
+
min: 0
|
|
2114
|
+
},
|
|
2115
|
+
{
|
|
2116
|
+
name: "ramp_used",
|
|
2117
|
+
type: "integer",
|
|
2118
|
+
min: 0,
|
|
2119
|
+
max: 1
|
|
2120
|
+
},
|
|
2121
|
+
{
|
|
2122
|
+
name: "ramp_boardings",
|
|
2123
|
+
type: "integer",
|
|
2124
|
+
min: 0
|
|
2125
|
+
},
|
|
2126
|
+
{
|
|
2127
|
+
name: "ramp_alightings",
|
|
2128
|
+
type: "integer",
|
|
2129
|
+
min: 0
|
|
2130
|
+
},
|
|
2131
|
+
{
|
|
2132
|
+
name: "service_date",
|
|
2133
|
+
type: "integer",
|
|
2134
|
+
index: true
|
|
2135
|
+
},
|
|
2136
|
+
{
|
|
2137
|
+
name: "service_arrival_time",
|
|
2138
|
+
type: "text"
|
|
2139
|
+
},
|
|
2140
|
+
{
|
|
2141
|
+
name: "service_arrival_timestamp",
|
|
2142
|
+
type: "integer",
|
|
2143
|
+
index: true
|
|
2144
|
+
},
|
|
2145
|
+
{
|
|
2146
|
+
name: "service_departure_time",
|
|
2147
|
+
type: "text"
|
|
2148
|
+
},
|
|
2149
|
+
{
|
|
2150
|
+
name: "service_departure_timestamp",
|
|
2151
|
+
type: "integer",
|
|
2152
|
+
index: true
|
|
2153
|
+
},
|
|
2154
|
+
{
|
|
2155
|
+
name: "source",
|
|
2156
|
+
type: "integer",
|
|
2157
|
+
min: 0,
|
|
2158
|
+
max: 4
|
|
2159
|
+
}
|
|
2160
|
+
]
|
|
2161
|
+
};
|
|
2162
|
+
var board_alight_default = model41;
|
|
2163
|
+
|
|
2164
|
+
// src/models/gtfs-ride/rider-trip.ts
|
|
2165
|
+
var model42 = {
|
|
2166
|
+
filenameBase: "rider_trip",
|
|
2167
|
+
filenameExtension: "txt",
|
|
2168
|
+
nonstandard: true,
|
|
2169
|
+
extension: "gtfs-ride",
|
|
2170
|
+
schema: [
|
|
2171
|
+
{
|
|
2172
|
+
name: "rider_id",
|
|
2173
|
+
type: "text",
|
|
2174
|
+
primary: true,
|
|
2175
|
+
prefix: true
|
|
2176
|
+
},
|
|
2177
|
+
{
|
|
2178
|
+
name: "agency_id",
|
|
2179
|
+
type: "text",
|
|
2180
|
+
index: true,
|
|
2181
|
+
prefix: true
|
|
2182
|
+
},
|
|
2183
|
+
{
|
|
2184
|
+
name: "trip_id",
|
|
2185
|
+
type: "text",
|
|
2186
|
+
index: true,
|
|
2187
|
+
prefix: true
|
|
2188
|
+
},
|
|
2189
|
+
{
|
|
2190
|
+
name: "boarding_stop_id",
|
|
2191
|
+
type: "text",
|
|
2192
|
+
index: true,
|
|
2193
|
+
prefix: true
|
|
2194
|
+
},
|
|
2195
|
+
{
|
|
2196
|
+
name: "boarding_stop_sequence",
|
|
2197
|
+
type: "integer",
|
|
2198
|
+
min: 0,
|
|
2199
|
+
index: true
|
|
2200
|
+
},
|
|
2201
|
+
{
|
|
2202
|
+
name: "alighting_stop_id",
|
|
2203
|
+
type: "text",
|
|
2204
|
+
index: true,
|
|
2205
|
+
prefix: true
|
|
2206
|
+
},
|
|
2207
|
+
{
|
|
2208
|
+
name: "alighting_stop_sequence",
|
|
2209
|
+
type: "integer",
|
|
2210
|
+
min: 0,
|
|
2211
|
+
index: true
|
|
2212
|
+
},
|
|
2213
|
+
{
|
|
2214
|
+
name: "service_date",
|
|
2215
|
+
type: "integer",
|
|
2216
|
+
index: true
|
|
2217
|
+
},
|
|
2218
|
+
{
|
|
2219
|
+
name: "boarding_time",
|
|
2220
|
+
type: "text"
|
|
2221
|
+
},
|
|
2222
|
+
{
|
|
2223
|
+
name: "boarding_timestamp",
|
|
2224
|
+
type: "integer",
|
|
2225
|
+
index: true
|
|
2226
|
+
},
|
|
2227
|
+
{
|
|
2228
|
+
name: "alighting_time",
|
|
2229
|
+
type: "text"
|
|
2230
|
+
},
|
|
2231
|
+
{
|
|
2232
|
+
name: "alighting_timestamp",
|
|
2233
|
+
type: "integer",
|
|
2234
|
+
index: true
|
|
2235
|
+
},
|
|
2236
|
+
{
|
|
2237
|
+
name: "rider_type",
|
|
2238
|
+
type: "integer",
|
|
2239
|
+
min: 0,
|
|
2240
|
+
max: 13
|
|
2241
|
+
},
|
|
2242
|
+
{
|
|
2243
|
+
name: "rider_type_description",
|
|
2244
|
+
type: "text"
|
|
2245
|
+
},
|
|
2246
|
+
{
|
|
2247
|
+
name: "fare_paid",
|
|
2248
|
+
type: "real"
|
|
2249
|
+
},
|
|
2250
|
+
{
|
|
2251
|
+
name: "transaction_type",
|
|
2252
|
+
type: "integer",
|
|
2253
|
+
min: 0,
|
|
2254
|
+
max: 8
|
|
2255
|
+
},
|
|
2256
|
+
{
|
|
2257
|
+
name: "fare_media",
|
|
2258
|
+
type: "integer",
|
|
2259
|
+
min: 0,
|
|
2260
|
+
max: 9
|
|
2261
|
+
},
|
|
2262
|
+
{
|
|
2263
|
+
name: "accompanying_device",
|
|
2264
|
+
type: "integer",
|
|
2265
|
+
min: 0,
|
|
2266
|
+
max: 6
|
|
2267
|
+
},
|
|
2268
|
+
{
|
|
2269
|
+
name: "transfer_status",
|
|
2270
|
+
type: "integer",
|
|
2271
|
+
min: 0,
|
|
2272
|
+
max: 1
|
|
2273
|
+
}
|
|
2274
|
+
]
|
|
2275
|
+
};
|
|
2276
|
+
var rider_trip_default = model42;
|
|
2277
|
+
|
|
2278
|
+
// src/models/gtfs-ride/ridership.ts
|
|
2279
|
+
var model43 = {
|
|
2280
|
+
filenameBase: "ridership",
|
|
2281
|
+
filenameExtension: "txt",
|
|
2282
|
+
nonstandard: true,
|
|
2283
|
+
extension: "gtfs-ride",
|
|
2284
|
+
schema: [
|
|
2285
|
+
{
|
|
2286
|
+
name: "total_boardings",
|
|
2287
|
+
type: "integer",
|
|
2288
|
+
min: 0,
|
|
2289
|
+
required: true
|
|
2290
|
+
},
|
|
2291
|
+
{
|
|
2292
|
+
name: "total_alightings",
|
|
2293
|
+
type: "integer",
|
|
2294
|
+
min: 0,
|
|
2295
|
+
required: true
|
|
2296
|
+
},
|
|
2297
|
+
{
|
|
2298
|
+
name: "ridership_start_date",
|
|
2299
|
+
type: "integer",
|
|
2300
|
+
index: true
|
|
2301
|
+
},
|
|
2302
|
+
{
|
|
2303
|
+
name: "ridership_end_date",
|
|
2304
|
+
type: "integer",
|
|
2305
|
+
index: true
|
|
2306
|
+
},
|
|
2307
|
+
{
|
|
2308
|
+
name: "ridership_start_time",
|
|
2309
|
+
type: "text"
|
|
2310
|
+
},
|
|
2311
|
+
{
|
|
2312
|
+
name: "ridership_start_timestamp",
|
|
2313
|
+
type: "integer",
|
|
2314
|
+
index: true
|
|
2315
|
+
},
|
|
2316
|
+
{
|
|
2317
|
+
name: "ridership_end_time",
|
|
2318
|
+
type: "text"
|
|
2319
|
+
},
|
|
2320
|
+
{
|
|
2321
|
+
name: "ridership_end_timestamp",
|
|
2322
|
+
type: "integer",
|
|
2323
|
+
index: true
|
|
2324
|
+
},
|
|
2325
|
+
{
|
|
2326
|
+
name: "service_id",
|
|
2327
|
+
type: "text",
|
|
2328
|
+
index: true,
|
|
2329
|
+
prefix: true
|
|
2330
|
+
},
|
|
2331
|
+
{
|
|
2332
|
+
name: "monday",
|
|
2333
|
+
type: "integer",
|
|
2334
|
+
min: 0,
|
|
2335
|
+
max: 1
|
|
2336
|
+
},
|
|
2337
|
+
{
|
|
2338
|
+
name: "tuesday",
|
|
2339
|
+
type: "integer",
|
|
2340
|
+
min: 0,
|
|
2341
|
+
max: 1
|
|
2342
|
+
},
|
|
2343
|
+
{
|
|
2344
|
+
name: "wednesday",
|
|
2345
|
+
type: "integer",
|
|
2346
|
+
min: 0,
|
|
2347
|
+
max: 1
|
|
2348
|
+
},
|
|
2349
|
+
{
|
|
2350
|
+
name: "thursday",
|
|
2351
|
+
type: "integer",
|
|
2352
|
+
min: 0,
|
|
2353
|
+
max: 1
|
|
2354
|
+
},
|
|
2355
|
+
{
|
|
2356
|
+
name: "friday",
|
|
2357
|
+
type: "integer",
|
|
2358
|
+
min: 0,
|
|
2359
|
+
max: 1
|
|
2360
|
+
},
|
|
2361
|
+
{
|
|
2362
|
+
name: "saturday",
|
|
2363
|
+
type: "integer",
|
|
2364
|
+
min: 0,
|
|
2365
|
+
max: 1
|
|
2366
|
+
},
|
|
2367
|
+
{
|
|
2368
|
+
name: "sunday",
|
|
2369
|
+
type: "integer",
|
|
2370
|
+
min: 0,
|
|
2371
|
+
max: 1
|
|
2372
|
+
},
|
|
2373
|
+
{
|
|
2374
|
+
name: "agency_id",
|
|
2375
|
+
type: "text",
|
|
2376
|
+
index: true,
|
|
2377
|
+
prefix: true
|
|
2378
|
+
},
|
|
2379
|
+
{
|
|
2380
|
+
name: "route_id",
|
|
2381
|
+
type: "text",
|
|
2382
|
+
index: true,
|
|
2383
|
+
prefix: true
|
|
2384
|
+
},
|
|
2385
|
+
{
|
|
2386
|
+
name: "direction_id",
|
|
2387
|
+
type: "integer",
|
|
2388
|
+
min: 0,
|
|
2389
|
+
max: 1,
|
|
2390
|
+
index: true
|
|
2391
|
+
},
|
|
2392
|
+
{
|
|
2393
|
+
name: "trip_id",
|
|
2394
|
+
type: "text",
|
|
2395
|
+
prefix: true
|
|
2396
|
+
},
|
|
2397
|
+
{
|
|
2398
|
+
name: "stop_id",
|
|
2399
|
+
type: "text",
|
|
2400
|
+
prefix: true
|
|
2401
|
+
}
|
|
2402
|
+
]
|
|
2403
|
+
};
|
|
2404
|
+
var ridership_default = model43;
|
|
2405
|
+
|
|
2406
|
+
// src/models/gtfs-ride/trip-capacity.ts
|
|
2407
|
+
var model44 = {
|
|
2408
|
+
filenameBase: "trip_capacity",
|
|
2409
|
+
filenameExtension: "txt",
|
|
2410
|
+
nonstandard: true,
|
|
2411
|
+
extension: "gtfs-ride",
|
|
2412
|
+
schema: [
|
|
2413
|
+
{
|
|
2414
|
+
name: "agency_id",
|
|
2415
|
+
type: "text",
|
|
2416
|
+
index: true,
|
|
2417
|
+
prefix: true
|
|
2418
|
+
},
|
|
2419
|
+
{
|
|
2420
|
+
name: "trip_id",
|
|
2421
|
+
type: "text",
|
|
2422
|
+
index: true,
|
|
2423
|
+
prefix: true
|
|
2424
|
+
},
|
|
2425
|
+
{
|
|
2426
|
+
name: "service_date",
|
|
2427
|
+
type: "integer",
|
|
2428
|
+
index: true
|
|
2429
|
+
},
|
|
2430
|
+
{
|
|
2431
|
+
name: "vehicle_description",
|
|
2432
|
+
type: "text"
|
|
2433
|
+
},
|
|
2434
|
+
{
|
|
2435
|
+
name: "seated_capacity",
|
|
2436
|
+
type: "integer",
|
|
2437
|
+
min: 0
|
|
2438
|
+
},
|
|
2439
|
+
{
|
|
2440
|
+
name: "standing_capacity",
|
|
2441
|
+
type: "integer",
|
|
2442
|
+
min: 0
|
|
2443
|
+
},
|
|
2444
|
+
{
|
|
2445
|
+
name: "wheelchair_capacity",
|
|
2446
|
+
type: "integer",
|
|
2447
|
+
min: 0
|
|
2448
|
+
},
|
|
2449
|
+
{
|
|
2450
|
+
name: "bike_capacity",
|
|
2451
|
+
type: "integer",
|
|
2452
|
+
min: 0
|
|
2453
|
+
}
|
|
2454
|
+
]
|
|
2455
|
+
};
|
|
2456
|
+
var trip_capacity_default = model44;
|
|
2457
|
+
|
|
2458
|
+
// src/models/gtfs-ride/ride-feed-info.ts
|
|
2459
|
+
var model45 = {
|
|
2460
|
+
filenameBase: "ride_feed_info",
|
|
2461
|
+
filenameExtension: "txt",
|
|
2462
|
+
nonstandard: true,
|
|
2463
|
+
extension: "gtfs-ride",
|
|
2464
|
+
schema: [
|
|
2465
|
+
{
|
|
2466
|
+
name: "ride_files",
|
|
2467
|
+
type: "integer",
|
|
2468
|
+
min: 0,
|
|
2469
|
+
max: 6,
|
|
2470
|
+
required: true
|
|
2471
|
+
},
|
|
2472
|
+
{
|
|
2473
|
+
name: "ride_start_date",
|
|
2474
|
+
type: "integer",
|
|
2475
|
+
index: true
|
|
2476
|
+
},
|
|
2477
|
+
{
|
|
2478
|
+
name: "ride_end_date",
|
|
2479
|
+
type: "integer",
|
|
2480
|
+
index: true
|
|
2481
|
+
},
|
|
2482
|
+
{
|
|
2483
|
+
name: "gtfs_feed_date",
|
|
2484
|
+
type: "integer",
|
|
2485
|
+
index: true
|
|
2486
|
+
},
|
|
2487
|
+
{
|
|
2488
|
+
name: "default_currency_type",
|
|
2489
|
+
type: "text"
|
|
2490
|
+
},
|
|
2491
|
+
{
|
|
2492
|
+
name: "ride_feed_version",
|
|
2493
|
+
type: "text"
|
|
2494
|
+
}
|
|
2495
|
+
]
|
|
2496
|
+
};
|
|
2497
|
+
var ride_feed_info_default = model45;
|
|
2498
|
+
|
|
2499
|
+
// src/models/gtfs-realtime/trip-updates.ts
|
|
2500
|
+
var model46 = {
|
|
2501
|
+
filenameBase: "trip_updates",
|
|
2502
|
+
extension: "gtfs-realtime",
|
|
2503
|
+
schema: [
|
|
2504
|
+
{
|
|
2505
|
+
name: "update_id",
|
|
2506
|
+
type: "text",
|
|
2507
|
+
required: true,
|
|
2508
|
+
primary: true,
|
|
2509
|
+
index: true,
|
|
2510
|
+
source: "id"
|
|
2511
|
+
},
|
|
2512
|
+
{
|
|
2513
|
+
name: "vehicle_id",
|
|
2514
|
+
type: "text",
|
|
2515
|
+
index: true,
|
|
2516
|
+
source: "tripUpdate.vehicle.id",
|
|
2517
|
+
default: null
|
|
2518
|
+
},
|
|
2519
|
+
{
|
|
2520
|
+
name: "trip_id",
|
|
2521
|
+
type: "text",
|
|
2522
|
+
index: true,
|
|
2523
|
+
source: "tripUpdate.trip.tripId",
|
|
2524
|
+
default: null
|
|
2525
|
+
},
|
|
2526
|
+
{
|
|
2527
|
+
name: "trip_start_time",
|
|
2528
|
+
type: "text",
|
|
2529
|
+
source: "tripUpdate.trip.startTime",
|
|
2530
|
+
default: null
|
|
2531
|
+
},
|
|
2532
|
+
{
|
|
2533
|
+
name: "direction_id",
|
|
2534
|
+
type: "integer",
|
|
2535
|
+
source: "tripUpdate.trip.directionId",
|
|
2536
|
+
default: null
|
|
2537
|
+
},
|
|
2538
|
+
{
|
|
2539
|
+
name: "route_id",
|
|
2540
|
+
type: "text",
|
|
2541
|
+
index: true,
|
|
2542
|
+
source: "tripUpdate.trip.routeId",
|
|
2543
|
+
default: null
|
|
2544
|
+
},
|
|
2545
|
+
{
|
|
2546
|
+
name: "start_date",
|
|
2547
|
+
type: "text",
|
|
2548
|
+
source: "tripUpdate.trip.startDate",
|
|
2549
|
+
default: null
|
|
2550
|
+
},
|
|
2551
|
+
{
|
|
2552
|
+
name: "timestamp",
|
|
2553
|
+
type: "text",
|
|
2554
|
+
source: "tripUpdate.timestamp",
|
|
2555
|
+
default: null
|
|
2556
|
+
},
|
|
2557
|
+
{
|
|
2558
|
+
name: "schedule_relationship",
|
|
2559
|
+
type: "text",
|
|
2560
|
+
source: "tripUpdate.trip.scheduleRelationship",
|
|
2561
|
+
default: null
|
|
2562
|
+
},
|
|
2563
|
+
{
|
|
2564
|
+
name: "created_timestamp",
|
|
2565
|
+
type: "integer",
|
|
2566
|
+
required: true
|
|
2567
|
+
},
|
|
2568
|
+
{
|
|
2569
|
+
name: "expiration_timestamp",
|
|
2570
|
+
type: "integer",
|
|
2571
|
+
required: true
|
|
2572
|
+
}
|
|
2573
|
+
]
|
|
2574
|
+
};
|
|
2575
|
+
var trip_updates_default = model46;
|
|
2576
|
+
|
|
2577
|
+
// src/models/gtfs-realtime/stop-time-updates.ts
|
|
2578
|
+
var model47 = {
|
|
2579
|
+
filenameBase: "stop_time_updates",
|
|
2580
|
+
extension: "gtfs-realtime",
|
|
2581
|
+
schema: [
|
|
2582
|
+
{
|
|
2583
|
+
name: "trip_id",
|
|
2584
|
+
type: "text",
|
|
2585
|
+
index: true,
|
|
2586
|
+
source: "parent.tripUpdate.trip.tripId",
|
|
2587
|
+
default: null
|
|
2588
|
+
},
|
|
2589
|
+
{
|
|
2590
|
+
name: "trip_start_time",
|
|
2591
|
+
type: "text",
|
|
2592
|
+
source: "parent.tripUpdate.trip.startTime",
|
|
2593
|
+
default: null
|
|
2594
|
+
},
|
|
2595
|
+
{
|
|
2596
|
+
name: "direction_id",
|
|
2597
|
+
type: "integer",
|
|
2598
|
+
source: "parent.tripUpdate.trip.directionId",
|
|
2599
|
+
default: null
|
|
2600
|
+
},
|
|
2601
|
+
{
|
|
2602
|
+
name: "route_id",
|
|
2603
|
+
type: "text",
|
|
2604
|
+
index: true,
|
|
2605
|
+
source: "parent.tripUpdate.trip.routeId",
|
|
2606
|
+
default: null
|
|
2607
|
+
},
|
|
2608
|
+
{
|
|
2609
|
+
name: "stop_id",
|
|
2610
|
+
type: "text",
|
|
2611
|
+
index: true,
|
|
2612
|
+
source: "stopId",
|
|
2613
|
+
default: null
|
|
2614
|
+
},
|
|
2615
|
+
{
|
|
2616
|
+
name: "stop_sequence",
|
|
2617
|
+
type: "integer",
|
|
2618
|
+
source: "stopSequence",
|
|
2619
|
+
default: null
|
|
2620
|
+
},
|
|
2621
|
+
{
|
|
2622
|
+
name: "arrival_delay",
|
|
2623
|
+
type: "integer",
|
|
2624
|
+
source: "arrival.delay",
|
|
2625
|
+
default: null
|
|
2626
|
+
},
|
|
2627
|
+
{
|
|
2628
|
+
name: "departure_delay",
|
|
2629
|
+
type: "integer",
|
|
2630
|
+
source: "departure.delay",
|
|
2631
|
+
default: null
|
|
2632
|
+
},
|
|
2633
|
+
{
|
|
2634
|
+
name: "departure_timestamp",
|
|
2635
|
+
type: "text",
|
|
2636
|
+
source: "departure.time",
|
|
2637
|
+
default: null
|
|
2638
|
+
},
|
|
2639
|
+
{
|
|
2640
|
+
name: "arrival_timestamp",
|
|
2641
|
+
type: "text",
|
|
2642
|
+
source: "arrival.time",
|
|
2643
|
+
default: null
|
|
2644
|
+
},
|
|
2645
|
+
{
|
|
2646
|
+
name: "schedule_relationship",
|
|
2647
|
+
type: "text",
|
|
2648
|
+
source: "scheduleRelationship",
|
|
2649
|
+
default: null
|
|
2650
|
+
},
|
|
2651
|
+
{
|
|
2652
|
+
name: "created_timestamp",
|
|
2653
|
+
type: "integer",
|
|
2654
|
+
required: true
|
|
2655
|
+
},
|
|
2656
|
+
{
|
|
2657
|
+
name: "expiration_timestamp",
|
|
2658
|
+
type: "integer",
|
|
2659
|
+
required: true
|
|
2660
|
+
}
|
|
2661
|
+
]
|
|
2662
|
+
};
|
|
2663
|
+
var stop_time_updates_default = model47;
|
|
2664
|
+
|
|
2665
|
+
// src/models/gtfs-realtime/vehicle-positions.ts
|
|
2666
|
+
var model48 = {
|
|
2667
|
+
filenameBase: "vehicle_positions",
|
|
2668
|
+
extension: "gtfs-realtime",
|
|
2669
|
+
schema: [
|
|
2670
|
+
{
|
|
2671
|
+
name: "update_id",
|
|
2672
|
+
type: "text",
|
|
2673
|
+
required: true,
|
|
2674
|
+
primary: true,
|
|
2675
|
+
index: true,
|
|
2676
|
+
source: "id"
|
|
2677
|
+
},
|
|
2678
|
+
{
|
|
2679
|
+
name: "bearing",
|
|
2680
|
+
type: "real",
|
|
2681
|
+
source: "vehicle.position.bearing",
|
|
2682
|
+
default: null
|
|
2683
|
+
},
|
|
2684
|
+
{
|
|
2685
|
+
name: "latitude",
|
|
2686
|
+
type: "real",
|
|
2687
|
+
min: -90,
|
|
2688
|
+
max: 90,
|
|
2689
|
+
source: "vehicle.position.latitude",
|
|
2690
|
+
default: null
|
|
2691
|
+
},
|
|
2692
|
+
{
|
|
2693
|
+
name: "longitude",
|
|
2694
|
+
type: "real",
|
|
2695
|
+
source: "vehicle.position.longitude",
|
|
2696
|
+
min: -180,
|
|
2697
|
+
max: 180,
|
|
2698
|
+
default: null
|
|
2699
|
+
},
|
|
2700
|
+
{
|
|
2701
|
+
name: "speed",
|
|
2702
|
+
type: "real",
|
|
2703
|
+
min: 0,
|
|
2704
|
+
source: "vehicle.position.speed",
|
|
2705
|
+
default: null
|
|
2706
|
+
},
|
|
2707
|
+
{
|
|
2708
|
+
name: "current_stop_sequence",
|
|
2709
|
+
type: "integer",
|
|
2710
|
+
source: "vehicle.currentStopSequence",
|
|
2711
|
+
default: null
|
|
2712
|
+
},
|
|
2713
|
+
{
|
|
2714
|
+
name: "trip_id",
|
|
2715
|
+
type: "text",
|
|
2716
|
+
index: true,
|
|
2717
|
+
source: "vehicle.trip.tripId",
|
|
2718
|
+
default: null
|
|
2719
|
+
},
|
|
2720
|
+
{
|
|
2721
|
+
name: "trip_start_date",
|
|
2722
|
+
type: "text",
|
|
2723
|
+
index: true,
|
|
2724
|
+
source: "vehicle.trip.startDate",
|
|
2725
|
+
default: null
|
|
2726
|
+
},
|
|
2727
|
+
{
|
|
2728
|
+
name: "trip_start_time",
|
|
2729
|
+
type: "text",
|
|
2730
|
+
index: true,
|
|
2731
|
+
source: "vehicle.trip.startTime",
|
|
2732
|
+
default: null
|
|
2733
|
+
},
|
|
2734
|
+
{
|
|
2735
|
+
name: "congestion_level",
|
|
2736
|
+
type: "text",
|
|
2737
|
+
source: "vehicle.congestionLevel",
|
|
2738
|
+
default: null
|
|
2739
|
+
},
|
|
2740
|
+
{
|
|
2741
|
+
name: "occupancy_status",
|
|
2742
|
+
type: "text",
|
|
2743
|
+
source: "vehicle.occupancyStatus",
|
|
2744
|
+
default: null
|
|
2745
|
+
},
|
|
2746
|
+
{
|
|
2747
|
+
name: "occupancy_percentage",
|
|
2748
|
+
type: "integer",
|
|
2749
|
+
source: "vehicle.occupancyPercentage",
|
|
2750
|
+
default: null
|
|
2751
|
+
},
|
|
2752
|
+
{
|
|
2753
|
+
name: "vehicle_stop_status",
|
|
2754
|
+
type: "text",
|
|
2755
|
+
source: "vehicle.vehicleStopStatus",
|
|
2756
|
+
default: null
|
|
2757
|
+
},
|
|
2758
|
+
{
|
|
2759
|
+
name: "vehicle_id",
|
|
2760
|
+
type: "text",
|
|
2761
|
+
index: true,
|
|
2762
|
+
source: "vehicle.vehicle.id",
|
|
2763
|
+
default: null
|
|
2764
|
+
},
|
|
2765
|
+
{
|
|
2766
|
+
name: "vehicle_label",
|
|
2767
|
+
type: "text",
|
|
2768
|
+
source: "vehicle.vehicle.label",
|
|
2769
|
+
default: null
|
|
2770
|
+
},
|
|
2771
|
+
{
|
|
2772
|
+
name: "vehicle_license_plate",
|
|
2773
|
+
type: "text",
|
|
2774
|
+
source: "vehicle.vehicle.licensePlate",
|
|
2775
|
+
default: null
|
|
2776
|
+
},
|
|
2777
|
+
{
|
|
2778
|
+
name: "vehicle_wheelchair_accessible",
|
|
2779
|
+
type: "text",
|
|
2780
|
+
source: "vehicle.vehicle.wheelchairAccessible",
|
|
2781
|
+
default: null
|
|
2782
|
+
},
|
|
2783
|
+
{
|
|
2784
|
+
name: "timestamp",
|
|
2785
|
+
type: "text",
|
|
2786
|
+
source: "vehicle.timestamp",
|
|
2787
|
+
default: null
|
|
2788
|
+
},
|
|
2789
|
+
{
|
|
2790
|
+
name: "created_timestamp",
|
|
2791
|
+
type: "integer",
|
|
2792
|
+
required: true
|
|
2793
|
+
},
|
|
2794
|
+
{
|
|
2795
|
+
name: "expiration_timestamp",
|
|
2796
|
+
type: "integer",
|
|
2797
|
+
required: true
|
|
2798
|
+
}
|
|
2799
|
+
]
|
|
2800
|
+
};
|
|
2801
|
+
var vehicle_positions_default = model48;
|
|
2802
|
+
|
|
2803
|
+
// src/models/gtfs-realtime/service-alerts.ts
|
|
2804
|
+
var model49 = {
|
|
2805
|
+
filenameBase: "service_alerts",
|
|
2806
|
+
extension: "gtfs-realtime",
|
|
2807
|
+
schema: [
|
|
2808
|
+
{
|
|
2809
|
+
name: "id",
|
|
2810
|
+
type: "text",
|
|
2811
|
+
required: true,
|
|
2812
|
+
primary: true,
|
|
2813
|
+
index: true,
|
|
2814
|
+
source: "id"
|
|
2815
|
+
},
|
|
2816
|
+
{
|
|
2817
|
+
name: "cause",
|
|
2818
|
+
type: "integer",
|
|
2819
|
+
required: true,
|
|
2820
|
+
min: 0,
|
|
2821
|
+
source: "alert.cause",
|
|
2822
|
+
default: 0
|
|
2823
|
+
},
|
|
2824
|
+
{
|
|
2825
|
+
name: "start_time",
|
|
2826
|
+
type: "text",
|
|
2827
|
+
required: true,
|
|
2828
|
+
source: "alert.activePeriod[0].start",
|
|
2829
|
+
default: ""
|
|
2830
|
+
},
|
|
2831
|
+
{
|
|
2832
|
+
name: "end_time",
|
|
2833
|
+
type: "text",
|
|
2834
|
+
required: true,
|
|
2835
|
+
source: "alert.activePeriod[0].end",
|
|
2836
|
+
default: ""
|
|
2837
|
+
},
|
|
2838
|
+
{
|
|
2839
|
+
name: "headline",
|
|
2840
|
+
type: "text",
|
|
2841
|
+
required: true,
|
|
2842
|
+
source: "alert.headerText.translation[0].text",
|
|
2843
|
+
default: ""
|
|
2844
|
+
},
|
|
2845
|
+
{
|
|
2846
|
+
name: "description",
|
|
2847
|
+
type: "text",
|
|
2848
|
+
required: true,
|
|
2849
|
+
source: "alert.descriptionText.translation[0].text",
|
|
2850
|
+
default: ""
|
|
2851
|
+
},
|
|
2852
|
+
{
|
|
2853
|
+
name: "created_timestamp",
|
|
2854
|
+
type: "integer",
|
|
2855
|
+
required: true
|
|
2856
|
+
},
|
|
2857
|
+
{
|
|
2858
|
+
name: "expiration_timestamp",
|
|
2859
|
+
type: "integer",
|
|
2860
|
+
required: true
|
|
2861
|
+
}
|
|
2862
|
+
]
|
|
2863
|
+
};
|
|
2864
|
+
var service_alerts_default = model49;
|
|
2865
|
+
|
|
2866
|
+
// src/models/gtfs-realtime/service-alert-targets.ts
|
|
2867
|
+
var model50 = {
|
|
2868
|
+
filenameBase: "service_alert_targets",
|
|
2869
|
+
extension: "gtfs-realtime",
|
|
2870
|
+
schema: [
|
|
2871
|
+
{
|
|
2872
|
+
name: "alert_id",
|
|
2873
|
+
type: "text",
|
|
2874
|
+
required: true,
|
|
2875
|
+
primary: true,
|
|
2876
|
+
source: "parent.id"
|
|
2877
|
+
},
|
|
2878
|
+
{
|
|
2879
|
+
name: "stop_id",
|
|
2880
|
+
type: "text",
|
|
2881
|
+
index: true,
|
|
2882
|
+
source: "stopId",
|
|
2883
|
+
default: null
|
|
2884
|
+
},
|
|
2885
|
+
{
|
|
2886
|
+
name: "route_id",
|
|
2887
|
+
type: "text",
|
|
2888
|
+
index: true,
|
|
2889
|
+
source: "routeId",
|
|
2890
|
+
default: null
|
|
2891
|
+
},
|
|
2892
|
+
{
|
|
2893
|
+
name: "created_timestamp",
|
|
2894
|
+
type: "integer",
|
|
2895
|
+
required: true
|
|
2896
|
+
},
|
|
2897
|
+
{
|
|
2898
|
+
name: "expiration_timestamp",
|
|
2899
|
+
type: "integer",
|
|
2900
|
+
required: true
|
|
2901
|
+
}
|
|
2902
|
+
]
|
|
2903
|
+
};
|
|
2904
|
+
var service_alert_targets_default = model50;
|
|
2905
|
+
|
|
2906
|
+
// src/models/ods/deadhead-times.ts
|
|
2907
|
+
var model51 = {
|
|
2908
|
+
filenameBase: "deadhead_times",
|
|
2909
|
+
filenameExtension: "txt",
|
|
2910
|
+
nonstandard: true,
|
|
2911
|
+
extension: "ods",
|
|
2912
|
+
schema: [
|
|
2913
|
+
{
|
|
2914
|
+
name: "id",
|
|
2915
|
+
type: "integer",
|
|
2916
|
+
primary: true,
|
|
2917
|
+
prefix: true
|
|
2918
|
+
},
|
|
2919
|
+
{
|
|
2920
|
+
name: "deadhead_id",
|
|
2921
|
+
type: "text",
|
|
2922
|
+
required: true,
|
|
2923
|
+
index: true,
|
|
2924
|
+
prefix: true
|
|
2925
|
+
},
|
|
2926
|
+
{
|
|
2927
|
+
name: "arrival_time",
|
|
2928
|
+
type: "text",
|
|
2929
|
+
required: true
|
|
2930
|
+
},
|
|
2931
|
+
{
|
|
2932
|
+
name: "arrival_timestamp",
|
|
2933
|
+
type: "integer",
|
|
2934
|
+
index: true
|
|
2935
|
+
},
|
|
2936
|
+
{
|
|
2937
|
+
name: "departure_time",
|
|
2938
|
+
type: "text",
|
|
2939
|
+
required: true
|
|
2940
|
+
},
|
|
2941
|
+
{
|
|
2942
|
+
name: "departure_timestamp",
|
|
2943
|
+
type: "integer",
|
|
2944
|
+
index: true
|
|
2945
|
+
},
|
|
2946
|
+
{
|
|
2947
|
+
name: "ops_location_id",
|
|
2948
|
+
type: "text",
|
|
2949
|
+
prefix: true
|
|
2950
|
+
},
|
|
2951
|
+
{
|
|
2952
|
+
name: "stop_id",
|
|
2953
|
+
type: "text",
|
|
2954
|
+
prefix: true
|
|
2955
|
+
},
|
|
2956
|
+
{
|
|
2957
|
+
name: "location_sequence",
|
|
2958
|
+
type: "integer",
|
|
2959
|
+
required: true,
|
|
2960
|
+
min: 0,
|
|
2961
|
+
index: true
|
|
2962
|
+
},
|
|
2963
|
+
{
|
|
2964
|
+
name: "shape_dist_traveled",
|
|
2965
|
+
type: "real",
|
|
2966
|
+
min: 0
|
|
2967
|
+
}
|
|
2968
|
+
]
|
|
2969
|
+
};
|
|
2970
|
+
var deadhead_times_default = model51;
|
|
2971
|
+
|
|
2972
|
+
// src/models/ods/deadheads.ts
|
|
2973
|
+
var model52 = {
|
|
2974
|
+
filenameBase: "deadheads",
|
|
2975
|
+
filenameExtension: "txt",
|
|
2976
|
+
nonstandard: true,
|
|
2977
|
+
extension: "ods",
|
|
2978
|
+
schema: [
|
|
2979
|
+
{
|
|
2980
|
+
name: "deadhead_id",
|
|
2981
|
+
type: "text",
|
|
2982
|
+
primary: true,
|
|
2983
|
+
required: true,
|
|
2984
|
+
prefix: true
|
|
2985
|
+
},
|
|
2986
|
+
{
|
|
2987
|
+
name: "service_id",
|
|
2988
|
+
type: "text",
|
|
2989
|
+
required: true,
|
|
2990
|
+
prefix: true
|
|
2991
|
+
},
|
|
2992
|
+
{
|
|
2993
|
+
name: "block_id",
|
|
2994
|
+
type: "text",
|
|
2995
|
+
required: true,
|
|
2996
|
+
index: true,
|
|
2997
|
+
prefix: true
|
|
2998
|
+
},
|
|
2999
|
+
{
|
|
3000
|
+
name: "shape_id",
|
|
3001
|
+
type: "text",
|
|
3002
|
+
index: true,
|
|
3003
|
+
prefix: true
|
|
3004
|
+
},
|
|
3005
|
+
{
|
|
3006
|
+
name: "to_trip_id",
|
|
3007
|
+
type: "text",
|
|
3008
|
+
index: true,
|
|
3009
|
+
prefix: true
|
|
3010
|
+
},
|
|
3011
|
+
{
|
|
3012
|
+
name: "from_trip_id",
|
|
3013
|
+
type: "text",
|
|
3014
|
+
index: true,
|
|
3015
|
+
prefix: true
|
|
3016
|
+
},
|
|
3017
|
+
{
|
|
3018
|
+
name: "to_deadhead_id",
|
|
3019
|
+
type: "text",
|
|
3020
|
+
index: true,
|
|
3021
|
+
prefix: true
|
|
3022
|
+
},
|
|
3023
|
+
{
|
|
3024
|
+
name: "from_deadhead_id",
|
|
3025
|
+
type: "text",
|
|
3026
|
+
index: true,
|
|
3027
|
+
prefix: true
|
|
3028
|
+
}
|
|
3029
|
+
]
|
|
3030
|
+
};
|
|
3031
|
+
var deadheads_default = model52;
|
|
3032
|
+
|
|
3033
|
+
// src/models/ods/ops-locations.ts
|
|
3034
|
+
var model53 = {
|
|
3035
|
+
filenameBase: "ops_locations",
|
|
3036
|
+
filenameExtension: "txt",
|
|
3037
|
+
nonstandard: true,
|
|
3038
|
+
extension: "ods",
|
|
3039
|
+
schema: [
|
|
3040
|
+
{
|
|
3041
|
+
name: "ops_location_id",
|
|
3042
|
+
type: "text",
|
|
3043
|
+
primary: true,
|
|
3044
|
+
required: true,
|
|
3045
|
+
prefix: true
|
|
3046
|
+
},
|
|
3047
|
+
{
|
|
3048
|
+
name: "ops_location_code",
|
|
3049
|
+
type: "text"
|
|
3050
|
+
},
|
|
3051
|
+
{
|
|
3052
|
+
name: "ops_location_name",
|
|
3053
|
+
type: "text",
|
|
3054
|
+
required: true,
|
|
3055
|
+
nocase: true
|
|
3056
|
+
},
|
|
3057
|
+
{
|
|
3058
|
+
name: "ops_location_desc",
|
|
3059
|
+
type: "text",
|
|
3060
|
+
nocase: true
|
|
3061
|
+
},
|
|
3062
|
+
{
|
|
3063
|
+
name: "ops_location_lat",
|
|
3064
|
+
type: "real",
|
|
3065
|
+
required: true,
|
|
3066
|
+
min: -90,
|
|
3067
|
+
max: 90
|
|
3068
|
+
},
|
|
3069
|
+
{
|
|
3070
|
+
name: "ops_location_lon",
|
|
3071
|
+
type: "real",
|
|
3072
|
+
required: true,
|
|
3073
|
+
min: -180,
|
|
3074
|
+
max: 180
|
|
3075
|
+
}
|
|
3076
|
+
]
|
|
3077
|
+
};
|
|
3078
|
+
var ops_locations_default = model53;
|
|
3079
|
+
|
|
3080
|
+
// src/models/ods/run-events.ts
|
|
3081
|
+
var model54 = {
|
|
3082
|
+
filenameBase: "run_event",
|
|
3083
|
+
filenameExtension: "txt",
|
|
3084
|
+
nonstandard: true,
|
|
3085
|
+
extension: "ods",
|
|
3086
|
+
schema: [
|
|
3087
|
+
{
|
|
3088
|
+
name: "run_event_id",
|
|
3089
|
+
type: "text",
|
|
3090
|
+
primary: true,
|
|
3091
|
+
required: true,
|
|
3092
|
+
prefix: true
|
|
3093
|
+
},
|
|
3094
|
+
{
|
|
3095
|
+
name: "piece_id",
|
|
3096
|
+
type: "text",
|
|
3097
|
+
required: true,
|
|
3098
|
+
prefix: true
|
|
3099
|
+
},
|
|
3100
|
+
{
|
|
3101
|
+
name: "event_type",
|
|
3102
|
+
type: "integer",
|
|
3103
|
+
required: true,
|
|
3104
|
+
min: 0,
|
|
3105
|
+
index: true
|
|
3106
|
+
},
|
|
3107
|
+
{
|
|
3108
|
+
name: "event_name",
|
|
3109
|
+
type: "text",
|
|
3110
|
+
nocase: true
|
|
3111
|
+
},
|
|
3112
|
+
{
|
|
3113
|
+
name: "event_time",
|
|
3114
|
+
type: "text",
|
|
3115
|
+
required: true
|
|
3116
|
+
},
|
|
3117
|
+
{
|
|
3118
|
+
name: "event_duration",
|
|
3119
|
+
type: "integer",
|
|
3120
|
+
required: true,
|
|
3121
|
+
min: 0
|
|
3122
|
+
},
|
|
3123
|
+
{
|
|
3124
|
+
name: "event_from_location_type",
|
|
3125
|
+
type: "integer",
|
|
3126
|
+
min: 0,
|
|
3127
|
+
max: 1,
|
|
3128
|
+
index: true
|
|
3129
|
+
},
|
|
3130
|
+
{
|
|
3131
|
+
name: "event_from_location_id",
|
|
3132
|
+
type: "text",
|
|
3133
|
+
prefix: true
|
|
3134
|
+
},
|
|
3135
|
+
{
|
|
3136
|
+
name: "event_to_location_type",
|
|
3137
|
+
type: "integer",
|
|
3138
|
+
min: 0,
|
|
3139
|
+
max: 1,
|
|
3140
|
+
index: true
|
|
3141
|
+
},
|
|
3142
|
+
{
|
|
3143
|
+
name: "event_to_location_id",
|
|
3144
|
+
type: "text",
|
|
3145
|
+
prefix: true
|
|
3146
|
+
}
|
|
3147
|
+
]
|
|
3148
|
+
};
|
|
3149
|
+
var run_events_default = model54;
|
|
3150
|
+
|
|
3151
|
+
// src/models/ods/runs-pieces.ts
|
|
3152
|
+
var model55 = {
|
|
3153
|
+
filenameBase: "runs_pieces",
|
|
3154
|
+
filenameExtension: "txt",
|
|
3155
|
+
nonstandard: true,
|
|
3156
|
+
extension: "ods",
|
|
3157
|
+
schema: [
|
|
3158
|
+
{
|
|
3159
|
+
name: "run_id",
|
|
3160
|
+
type: "text",
|
|
3161
|
+
required: true
|
|
3162
|
+
},
|
|
3163
|
+
{
|
|
3164
|
+
name: "piece_id",
|
|
3165
|
+
type: "text",
|
|
3166
|
+
primary: true,
|
|
3167
|
+
required: true
|
|
3168
|
+
},
|
|
3169
|
+
{
|
|
3170
|
+
name: "start_type",
|
|
3171
|
+
type: "integer",
|
|
3172
|
+
required: true,
|
|
3173
|
+
min: 0,
|
|
3174
|
+
max: 2,
|
|
3175
|
+
index: true
|
|
3176
|
+
},
|
|
3177
|
+
{
|
|
3178
|
+
name: "start_trip_id",
|
|
3179
|
+
type: "text",
|
|
3180
|
+
required: true,
|
|
3181
|
+
index: true
|
|
3182
|
+
},
|
|
3183
|
+
{
|
|
3184
|
+
name: "start_trip_position",
|
|
3185
|
+
type: "integer",
|
|
3186
|
+
min: 0
|
|
3187
|
+
},
|
|
3188
|
+
{
|
|
3189
|
+
name: "end_type",
|
|
3190
|
+
type: "integer",
|
|
3191
|
+
required: true,
|
|
3192
|
+
min: 0,
|
|
3193
|
+
max: 2,
|
|
3194
|
+
index: true
|
|
3195
|
+
},
|
|
3196
|
+
{
|
|
3197
|
+
name: "end_trip_id",
|
|
3198
|
+
type: "text",
|
|
3199
|
+
required: true,
|
|
3200
|
+
index: true
|
|
3201
|
+
},
|
|
3202
|
+
{
|
|
3203
|
+
name: "end_trip_position",
|
|
3204
|
+
type: "integer",
|
|
3205
|
+
min: 0
|
|
3206
|
+
}
|
|
3207
|
+
]
|
|
3208
|
+
};
|
|
3209
|
+
var runs_pieces_default = model55;
|
|
3210
|
+
|
|
3211
|
+
// src/models/models.ts
|
|
3212
|
+
var models = [
|
|
3213
|
+
agency_default,
|
|
3214
|
+
areas_default,
|
|
3215
|
+
attributions_default,
|
|
3216
|
+
booking_rules_default,
|
|
3217
|
+
calendar_dates_default,
|
|
3218
|
+
calendar_default,
|
|
3219
|
+
fare_attributes_default,
|
|
3220
|
+
fare_leg_rules_default,
|
|
3221
|
+
fare_media_default,
|
|
3222
|
+
fare_products_default,
|
|
3223
|
+
fare_rules_default,
|
|
3224
|
+
fare_transfer_rules_default,
|
|
3225
|
+
feed_info_default,
|
|
3226
|
+
frequencies_default,
|
|
3227
|
+
levels_default,
|
|
3228
|
+
location_groups_default,
|
|
3229
|
+
location_group_stops_default,
|
|
3230
|
+
locations_default,
|
|
3231
|
+
networks_default,
|
|
3232
|
+
pathways_default,
|
|
3233
|
+
route_networks_default,
|
|
3234
|
+
routes_default,
|
|
3235
|
+
shapes_default,
|
|
3236
|
+
stop_areas_default,
|
|
3237
|
+
stop_times_default,
|
|
3238
|
+
stops_default,
|
|
3239
|
+
timeframes_default,
|
|
3240
|
+
transfers_default,
|
|
3241
|
+
translations_default,
|
|
3242
|
+
trips_default,
|
|
3243
|
+
timetables_default,
|
|
3244
|
+
timetable_pages_default,
|
|
3245
|
+
timetable_stop_order_default,
|
|
3246
|
+
timetable_notes_default,
|
|
3247
|
+
timetable_notes_references_default,
|
|
3248
|
+
trips_dated_vehicle_journey_default,
|
|
3249
|
+
calendar_attributes_default,
|
|
3250
|
+
directions_default,
|
|
3251
|
+
route_attributes_default,
|
|
3252
|
+
stop_attributes_default,
|
|
3253
|
+
board_alight_default,
|
|
3254
|
+
ride_feed_info_default,
|
|
3255
|
+
rider_trip_default,
|
|
3256
|
+
ridership_default,
|
|
3257
|
+
trip_capacity_default,
|
|
3258
|
+
trip_updates_default,
|
|
3259
|
+
stop_time_updates_default,
|
|
3260
|
+
vehicle_positions_default,
|
|
3261
|
+
service_alerts_default,
|
|
3262
|
+
service_alert_targets_default,
|
|
3263
|
+
deadhead_times_default,
|
|
3264
|
+
deadheads_default,
|
|
3265
|
+
ops_locations_default,
|
|
3266
|
+
run_events_default,
|
|
3267
|
+
runs_pieces_default
|
|
3268
|
+
];
|
|
3269
|
+
var models_default = models;
|
|
3270
|
+
|
|
3271
|
+
// src/lib/db.ts
|
|
3272
|
+
import Database from "better-sqlite3";
|
|
3273
|
+
import untildify2 from "untildify";
|
|
3274
|
+
|
|
3275
|
+
// src/lib/utils.ts
|
|
3276
|
+
import sqlString from "sqlstring-sqlite";
|
|
3277
|
+
import Long from "long";
|
|
3278
|
+
function setDefaultConfig(initialConfig) {
|
|
3279
|
+
const defaults = {
|
|
3280
|
+
sqlitePath: ":memory:",
|
|
3281
|
+
ignoreDuplicates: false,
|
|
3282
|
+
gtfsRealtimeExpirationSeconds: 0
|
|
3283
|
+
};
|
|
3284
|
+
return {
|
|
3285
|
+
...defaults,
|
|
3286
|
+
...initialConfig
|
|
3287
|
+
};
|
|
3288
|
+
}
|
|
3289
|
+
|
|
3290
|
+
// src/lib/db.ts
|
|
3291
|
+
var dbs = {};
|
|
3292
|
+
function setupDb(sqlitePath) {
|
|
3293
|
+
const db = new Database(untildify2(sqlitePath));
|
|
3294
|
+
db.pragma("journal_mode = OFF");
|
|
3295
|
+
db.pragma("synchronous = OFF");
|
|
3296
|
+
db.pragma("temp_store = MEMORY");
|
|
3297
|
+
dbs[sqlitePath] = db;
|
|
3298
|
+
return db;
|
|
3299
|
+
}
|
|
3300
|
+
function openDb(config = null) {
|
|
3301
|
+
if (config) {
|
|
3302
|
+
const { sqlitePath, db } = setDefaultConfig(config);
|
|
3303
|
+
if (db) {
|
|
3304
|
+
return db;
|
|
3305
|
+
}
|
|
3306
|
+
if (dbs[sqlitePath]) {
|
|
3307
|
+
return dbs[sqlitePath];
|
|
3308
|
+
}
|
|
3309
|
+
return setupDb(sqlitePath);
|
|
3310
|
+
}
|
|
3311
|
+
if (Object.keys(dbs).length === 1) {
|
|
3312
|
+
const filename = Object.keys(dbs)[0];
|
|
3313
|
+
return dbs[filename];
|
|
3314
|
+
}
|
|
3315
|
+
if (Object.keys(dbs).length > 1) {
|
|
3316
|
+
throw new Error(
|
|
3317
|
+
"Multiple databases open, please specify which one to use."
|
|
3318
|
+
);
|
|
3319
|
+
}
|
|
3320
|
+
throw new Error("Unable to find database connection.");
|
|
3321
|
+
}
|
|
3322
|
+
|
|
3323
|
+
// src/lib/geojson-utils.ts
|
|
3324
|
+
import {
|
|
3325
|
+
cloneDeep,
|
|
3326
|
+
filter,
|
|
3327
|
+
groupBy,
|
|
3328
|
+
last,
|
|
3329
|
+
omit as omit2,
|
|
3330
|
+
sortBy,
|
|
3331
|
+
omitBy
|
|
3332
|
+
} from "lodash-es";
|
|
3333
|
+
import { feature, featureCollection } from "@turf/helpers";
|
|
3334
|
+
|
|
3335
|
+
// src/lib/export.ts
|
|
3336
|
+
import path2 from "node:path";
|
|
3337
|
+
import { writeFile } from "node:fs/promises";
|
|
3338
|
+
import { without, compact } from "lodash-es";
|
|
3339
|
+
import pluralize2 from "pluralize";
|
|
3340
|
+
import { stringify } from "csv-stringify";
|
|
3341
|
+
import sqlString3 from "sqlstring-sqlite";
|
|
3342
|
+
import mapSeries2 from "promise-map-series";
|
|
3343
|
+
import untildify4 from "untildify";
|
|
3344
|
+
var getAgencies = (db, config) => {
|
|
3345
|
+
try {
|
|
3346
|
+
return db.prepare("SELECT agency_name FROM agency;").all();
|
|
3347
|
+
} catch (error) {
|
|
3348
|
+
if (config.sqlitePath === ":memory:") {
|
|
3349
|
+
throw new Error(
|
|
3350
|
+
'No agencies found in SQLite. You are using an in-memory database - if running this from command line be sure to specify a value for `sqlitePath` in config.json other than ":memory:".'
|
|
3351
|
+
);
|
|
3352
|
+
}
|
|
3353
|
+
throw new Error(
|
|
3354
|
+
"No agencies found in SQLite. Be sure to first import data into SQLite using `gtfs-import` or `importGtfs(config);`"
|
|
3355
|
+
);
|
|
3356
|
+
}
|
|
3357
|
+
};
|
|
3358
|
+
var exportGtfs = async (initialConfig) => {
|
|
3359
|
+
const config = setDefaultConfig(initialConfig);
|
|
3360
|
+
const log2 = log(config);
|
|
3361
|
+
const logWarning2 = logWarning(config);
|
|
3362
|
+
const db = openDb(config);
|
|
3363
|
+
const agencies = getAgencies(db, config);
|
|
3364
|
+
const agencyCount = agencies.length;
|
|
3365
|
+
if (agencyCount === 0) {
|
|
3366
|
+
throw new Error(
|
|
3367
|
+
"No agencies found in SQLite. Be sure to first import data into SQLite using `gtfs-import` or `importGtfs(config);`"
|
|
3368
|
+
);
|
|
3369
|
+
} else if (agencyCount > 1) {
|
|
3370
|
+
logWarning2(
|
|
3371
|
+
"More than one agency is defined in config.json. Export will merge all into one GTFS file."
|
|
3372
|
+
);
|
|
3373
|
+
}
|
|
3374
|
+
log2(
|
|
3375
|
+
`Starting GTFS export for ${pluralize2(
|
|
3376
|
+
"agency",
|
|
3377
|
+
agencyCount,
|
|
3378
|
+
true
|
|
3379
|
+
)} using SQLite database at ${config.sqlitePath}`
|
|
3380
|
+
);
|
|
3381
|
+
const folderName = generateFolderName(agencies[0].agency_name);
|
|
3382
|
+
const defaultExportPath = path2.join(process.cwd(), "gtfs-export", folderName);
|
|
3383
|
+
const exportPath = untildify4(config.exportPath || defaultExportPath);
|
|
3384
|
+
await prepDirectory(exportPath);
|
|
3385
|
+
const modelsToExport = models_default.filter(
|
|
3386
|
+
(model56) => model56.extension !== "gtfs-realtime"
|
|
3387
|
+
);
|
|
3388
|
+
const exportedFiles = await mapSeries2(
|
|
3389
|
+
modelsToExport,
|
|
3390
|
+
async (model56) => {
|
|
3391
|
+
const filePath = path2.join(
|
|
3392
|
+
exportPath,
|
|
3393
|
+
`${model56.filenameBase}.${model56.filenameExtension}`
|
|
3394
|
+
);
|
|
3395
|
+
const tableName = sqlString3.escapeId(model56.filenameBase);
|
|
3396
|
+
const lines = db.prepare(`SELECT * FROM ${tableName};`).all();
|
|
3397
|
+
if (!lines || lines.length === 0) {
|
|
3398
|
+
if (!model56.nonstandard) {
|
|
3399
|
+
log2(
|
|
3400
|
+
`Skipping (no data) - ${model56.filenameBase}.${model56.filenameExtension}\r`
|
|
3401
|
+
);
|
|
3402
|
+
}
|
|
3403
|
+
return;
|
|
3404
|
+
}
|
|
3405
|
+
if (model56.filenameExtension === "txt") {
|
|
3406
|
+
const excludeColumns = [
|
|
3407
|
+
"id",
|
|
3408
|
+
"arrival_timestamp",
|
|
3409
|
+
"departure_timestamp",
|
|
3410
|
+
"start_timestamp",
|
|
3411
|
+
"end_timestamp",
|
|
3412
|
+
"service_arrival_timestamp",
|
|
3413
|
+
"service_departure_timestamp",
|
|
3414
|
+
"boarding_timestamp",
|
|
3415
|
+
"alighting_timestamp",
|
|
3416
|
+
"ridership_start_timestamp",
|
|
3417
|
+
"ridership_end_timestamp"
|
|
3418
|
+
];
|
|
3419
|
+
if (model56.filenameBase === "routes") {
|
|
3420
|
+
const routesWithAgencyId = db.prepare(
|
|
3421
|
+
"SELECT agency_id FROM routes WHERE agency_id IS NOT NULL;"
|
|
3422
|
+
).all();
|
|
3423
|
+
if (!routesWithAgencyId || routesWithAgencyId.length === 0) {
|
|
3424
|
+
excludeColumns.push("agency_id");
|
|
3425
|
+
}
|
|
3426
|
+
}
|
|
3427
|
+
const columns = without(
|
|
3428
|
+
model56.schema.map((column) => column.name),
|
|
3429
|
+
...excludeColumns
|
|
3430
|
+
);
|
|
3431
|
+
const fileText = await stringify(lines, { columns, header: true });
|
|
3432
|
+
await writeFile(filePath, fileText);
|
|
3433
|
+
} else if (model56.filenameExtension === "geojson") {
|
|
3434
|
+
const fileText = lines?.[0].geojson ?? "";
|
|
3435
|
+
await writeFile(filePath, fileText);
|
|
3436
|
+
} else {
|
|
3437
|
+
throw new Error(
|
|
3438
|
+
`Unexpected filename extension: ${model56.filenameExtension}`
|
|
3439
|
+
);
|
|
3440
|
+
}
|
|
3441
|
+
log2(`Exporting - ${model56.filenameBase}.${model56.filenameExtension}\r`);
|
|
3442
|
+
return `${model56.filenameBase}.${model56.filenameExtension}`;
|
|
3443
|
+
}
|
|
3444
|
+
);
|
|
3445
|
+
if (compact(exportedFiles).length === 0) {
|
|
3446
|
+
log2("No GTFS data exported. Be sure to first import data into SQLite.");
|
|
3447
|
+
return;
|
|
3448
|
+
}
|
|
3449
|
+
log2(`Completed GTFS export to ${exportPath}`);
|
|
3450
|
+
log2(`Completed GTFS export for ${pluralize2("agency", agencyCount, true)}
|
|
3451
|
+
`);
|
|
3452
|
+
};
|
|
3453
|
+
|
|
3454
|
+
// src/lib/advancedQuery.ts
|
|
3455
|
+
import sqlString4 from "sqlstring-sqlite";
|
|
3456
|
+
|
|
3457
|
+
// src/lib/gtfs/agencies.ts
|
|
3458
|
+
import sqlString5 from "sqlstring-sqlite";
|
|
3459
|
+
|
|
3460
|
+
// src/lib/gtfs/areas.ts
|
|
3461
|
+
import sqlString6 from "sqlstring-sqlite";
|
|
3462
|
+
|
|
3463
|
+
// src/lib/gtfs/attributions.ts
|
|
3464
|
+
import sqlString7 from "sqlstring-sqlite";
|
|
3465
|
+
|
|
3466
|
+
// src/lib/gtfs/booking-rules.ts
|
|
3467
|
+
import sqlString8 from "sqlstring-sqlite";
|
|
3468
|
+
|
|
3469
|
+
// src/lib/gtfs/calendar-dates.ts
|
|
3470
|
+
import sqlString9 from "sqlstring-sqlite";
|
|
3471
|
+
|
|
3472
|
+
// src/lib/gtfs/calendars.ts
|
|
3473
|
+
import sqlString10 from "sqlstring-sqlite";
|
|
3474
|
+
|
|
3475
|
+
// src/lib/gtfs/fare-attributes.ts
|
|
3476
|
+
import sqlString11 from "sqlstring-sqlite";
|
|
3477
|
+
|
|
3478
|
+
// src/lib/gtfs/fare-leg-rules.ts
|
|
3479
|
+
import sqlString12 from "sqlstring-sqlite";
|
|
3480
|
+
|
|
3481
|
+
// src/lib/gtfs/fare-media.ts
|
|
3482
|
+
import sqlString13 from "sqlstring-sqlite";
|
|
3483
|
+
|
|
3484
|
+
// src/lib/gtfs/fare-products.ts
|
|
3485
|
+
import sqlString14 from "sqlstring-sqlite";
|
|
3486
|
+
|
|
3487
|
+
// src/lib/gtfs/fare-rules.ts
|
|
3488
|
+
import sqlString15 from "sqlstring-sqlite";
|
|
3489
|
+
|
|
3490
|
+
// src/lib/gtfs/fare-transfer-rules.ts
|
|
3491
|
+
import sqlString16 from "sqlstring-sqlite";
|
|
3492
|
+
|
|
3493
|
+
// src/lib/gtfs/feed-info.ts
|
|
3494
|
+
import sqlString17 from "sqlstring-sqlite";
|
|
3495
|
+
|
|
3496
|
+
// src/lib/gtfs/frequencies.ts
|
|
3497
|
+
import sqlString18 from "sqlstring-sqlite";
|
|
3498
|
+
|
|
3499
|
+
// src/lib/gtfs/levels.ts
|
|
3500
|
+
import sqlString19 from "sqlstring-sqlite";
|
|
3501
|
+
|
|
3502
|
+
// src/lib/gtfs/location-groups.ts
|
|
3503
|
+
import sqlString20 from "sqlstring-sqlite";
|
|
3504
|
+
|
|
3505
|
+
// src/lib/gtfs/location-group-stops.ts
|
|
3506
|
+
import sqlString21 from "sqlstring-sqlite";
|
|
3507
|
+
|
|
3508
|
+
// src/lib/gtfs/locations.ts
|
|
3509
|
+
import sqlString22 from "sqlstring-sqlite";
|
|
3510
|
+
|
|
3511
|
+
// src/lib/gtfs/networks.ts
|
|
3512
|
+
import sqlString23 from "sqlstring-sqlite";
|
|
3513
|
+
|
|
3514
|
+
// src/lib/gtfs/pathways.ts
|
|
3515
|
+
import sqlString24 from "sqlstring-sqlite";
|
|
3516
|
+
|
|
3517
|
+
// src/lib/gtfs/route-networks.ts
|
|
3518
|
+
import sqlString25 from "sqlstring-sqlite";
|
|
3519
|
+
|
|
3520
|
+
// src/lib/gtfs/routes.ts
|
|
3521
|
+
import { omit as omit3, pick } from "lodash-es";
|
|
3522
|
+
import sqlString26 from "sqlstring-sqlite";
|
|
3523
|
+
|
|
3524
|
+
// src/lib/gtfs/shapes.ts
|
|
3525
|
+
import { omit as omit4, pick as pick2 } from "lodash-es";
|
|
3526
|
+
import sqlString28 from "sqlstring-sqlite";
|
|
3527
|
+
import { featureCollection as featureCollection2 } from "@turf/helpers";
|
|
3528
|
+
|
|
3529
|
+
// src/lib/gtfs-plus/route-attributes.ts
|
|
3530
|
+
import sqlString27 from "sqlstring-sqlite";
|
|
3531
|
+
|
|
3532
|
+
// src/lib/gtfs/stop-areas.ts
|
|
3533
|
+
import sqlString29 from "sqlstring-sqlite";
|
|
3534
|
+
|
|
3535
|
+
// src/lib/gtfs/stops.ts
|
|
3536
|
+
import { omit as omit5, orderBy, pick as pick3 } from "lodash-es";
|
|
3537
|
+
import sqlString31 from "sqlstring-sqlite";
|
|
3538
|
+
|
|
3539
|
+
// src/lib/gtfs-plus/stop-attributes.ts
|
|
3540
|
+
import sqlString30 from "sqlstring-sqlite";
|
|
3541
|
+
|
|
3542
|
+
// src/lib/gtfs/stop-times.ts
|
|
3543
|
+
import sqlString32 from "sqlstring-sqlite";
|
|
3544
|
+
|
|
3545
|
+
// src/lib/gtfs/timeframes.ts
|
|
3546
|
+
import sqlString33 from "sqlstring-sqlite";
|
|
3547
|
+
|
|
3548
|
+
// src/lib/gtfs/transfers.ts
|
|
3549
|
+
import sqlString34 from "sqlstring-sqlite";
|
|
3550
|
+
|
|
3551
|
+
// src/lib/gtfs/translations.ts
|
|
3552
|
+
import sqlString35 from "sqlstring-sqlite";
|
|
3553
|
+
|
|
3554
|
+
// src/lib/gtfs/trips.ts
|
|
3555
|
+
import sqlString36 from "sqlstring-sqlite";
|
|
3556
|
+
|
|
3557
|
+
// src/lib/gtfs-plus/calendar-attributes.ts
|
|
3558
|
+
import sqlString37 from "sqlstring-sqlite";
|
|
3559
|
+
|
|
3560
|
+
// src/lib/gtfs-plus/directions.ts
|
|
3561
|
+
import sqlString38 from "sqlstring-sqlite";
|
|
3562
|
+
|
|
3563
|
+
// src/lib/non-standard/timetables.ts
|
|
3564
|
+
import sqlString39 from "sqlstring-sqlite";
|
|
3565
|
+
|
|
3566
|
+
// src/lib/non-standard/timetable-stop-order.ts
|
|
3567
|
+
import sqlString40 from "sqlstring-sqlite";
|
|
3568
|
+
|
|
3569
|
+
// src/lib/non-standard/timetable-pages.ts
|
|
3570
|
+
import sqlString41 from "sqlstring-sqlite";
|
|
3571
|
+
|
|
3572
|
+
// src/lib/non-standard/timetable-notes.ts
|
|
3573
|
+
import sqlString42 from "sqlstring-sqlite";
|
|
3574
|
+
|
|
3575
|
+
// src/lib/non-standard/timetable-notes-references.ts
|
|
3576
|
+
import sqlString43 from "sqlstring-sqlite";
|
|
3577
|
+
|
|
3578
|
+
// src/lib/non-standard/trips-dated-vehicle-journey.ts
|
|
3579
|
+
import sqlString44 from "sqlstring-sqlite";
|
|
3580
|
+
|
|
3581
|
+
// src/lib/gtfs-ride/board-alights.ts
|
|
3582
|
+
import sqlString45 from "sqlstring-sqlite";
|
|
3583
|
+
|
|
3584
|
+
// src/lib/gtfs-ride/ride-feed-infos.ts
|
|
3585
|
+
import sqlString46 from "sqlstring-sqlite";
|
|
3586
|
+
|
|
3587
|
+
// src/lib/gtfs-ride/rider-trips.ts
|
|
3588
|
+
import sqlString47 from "sqlstring-sqlite";
|
|
3589
|
+
|
|
3590
|
+
// src/lib/gtfs-ride/riderships.ts
|
|
3591
|
+
import sqlString48 from "sqlstring-sqlite";
|
|
3592
|
+
|
|
3593
|
+
// src/lib/gtfs-ride/trip-capacities.ts
|
|
3594
|
+
import sqlString49 from "sqlstring-sqlite";
|
|
3595
|
+
|
|
3596
|
+
// src/lib/gtfs-realtime/stop-time-updates.ts
|
|
3597
|
+
import sqlString50 from "sqlstring-sqlite";
|
|
3598
|
+
|
|
3599
|
+
// src/lib/gtfs-realtime/trip-updates.ts
|
|
3600
|
+
import sqlString51 from "sqlstring-sqlite";
|
|
3601
|
+
|
|
3602
|
+
// src/lib/gtfs-realtime/vehicle-positions.ts
|
|
3603
|
+
import sqlString52 from "sqlstring-sqlite";
|
|
3604
|
+
|
|
3605
|
+
// src/lib/gtfs-realtime/service-alerts.ts
|
|
3606
|
+
import sqlString53 from "sqlstring-sqlite";
|
|
3607
|
+
|
|
3608
|
+
// src/lib/ods/deadheads.ts
|
|
3609
|
+
import sqlString54 from "sqlstring-sqlite";
|
|
3610
|
+
|
|
3611
|
+
// src/lib/ods/deadhead-times.ts
|
|
3612
|
+
import sqlString55 from "sqlstring-sqlite";
|
|
3613
|
+
|
|
3614
|
+
// src/lib/ods/ops-locations.ts
|
|
3615
|
+
import sqlString56 from "sqlstring-sqlite";
|
|
3616
|
+
|
|
3617
|
+
// src/lib/ods/run-events.ts
|
|
3618
|
+
import sqlString57 from "sqlstring-sqlite";
|
|
3619
|
+
|
|
3620
|
+
// src/lib/ods/runs-pieces.ts
|
|
3621
|
+
import sqlString58 from "sqlstring-sqlite";
|
|
3622
|
+
|
|
3623
|
+
// src/bin/gtfs-export.ts
|
|
3624
|
+
var pe = new PrettyError();
|
|
3625
|
+
var argv = yargs(hideBin(process.argv)).usage("Usage: $0 --configPath ./config.json").help().option("c", {
|
|
3626
|
+
alias: "configPath",
|
|
3627
|
+
describe: "Path to config file",
|
|
3628
|
+
type: "string"
|
|
3629
|
+
}).option("sqlitePath", {
|
|
3630
|
+
describe: "Path to SQLite database",
|
|
3631
|
+
type: "string"
|
|
3632
|
+
}).parseSync();
|
|
3633
|
+
var handleError = (error = "Unknown Error") => {
|
|
3634
|
+
process.stdout.write(`
|
|
3635
|
+
${formatError(error)}
|
|
3636
|
+
`);
|
|
3637
|
+
console.error(pe.render(error));
|
|
3638
|
+
process.exit(1);
|
|
3639
|
+
};
|
|
3640
|
+
var setupExport = async () => {
|
|
3641
|
+
const config = await getConfig(argv);
|
|
3642
|
+
await exportGtfs(config);
|
|
3643
|
+
process.exit();
|
|
3644
|
+
};
|
|
3645
|
+
setupExport().catch(handleError);
|
|
3646
|
+
//# sourceMappingURL=gtfs-export.js.map
|