forked from jvalue/made-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
pipeline GtfsPipeline { | ||
|
||
GTFSSampleFeedExtractor -> ZipArchiveInterpreter; | ||
|
||
ZipArchiveInterpreter | ||
-> StopsFilePicker | ||
-> StopsTextFileInterpreter | ||
-> StopsCSVInterpreter | ||
-> StopsColumnDeleter | ||
-> StopsTableInterpreter | ||
-> StopsLoader; | ||
|
||
block GTFSSampleFeedExtractor oftype HttpExtractor { | ||
url: "https://gtfs.rhoenenergie-bus.de/GTFS.zip"; | ||
} | ||
|
||
block ZipArchiveInterpreter oftype ArchiveInterpreter { | ||
archiveType: "zip"; | ||
} | ||
|
||
block StopsFilePicker oftype FilePicker { | ||
path: "/stops.txt"; | ||
} | ||
|
||
block StopsTextFileInterpreter oftype TextFileInterpreter { encoding: "latin2"; } | ||
block StopsCSVInterpreter oftype CSVInterpreter { } | ||
|
||
block StopsColumnDeleter oftype ColumnDeleter { delete: [column B, column D, column H, column I, column J, column K, column L]; } | ||
|
||
block StopsTableInterpreter oftype TableInterpreter { | ||
header: true; | ||
columns:[ | ||
"stop_id" oftype integer, | ||
"stop_name" oftype text, | ||
"stop_lat" oftype coordinatetype, | ||
"stop_lon" oftype coordinatetype, | ||
"zone_id" oftype zonetype | ||
]; | ||
} | ||
|
||
constraint GeographicCoordinate oftype RangeConstraint { lowerBound: -90; lowerBoundInclusive: true; upperBound: 90; upperBoundInclusive: true;} | ||
valuetype coordinatetype oftype decimal { constraints: [ GeographicCoordinate ]; } | ||
|
||
constraint allowedzone oftype AllowlistConstraint { allowlist: ['2001']; } | ||
valuetype zonetype oftype integer { constraints: [ allowedzone ]; } | ||
|
||
block StopsLoader oftype SQLiteLoader { | ||
table: "stops"; | ||
file: "./gtfs.sqlite"; | ||
} | ||
|
||
} |