Compare commits

...

63 Commits

Author SHA1 Message Date
Fred Boniface 93726137aa auto-20240722-150645 (#14)
Generate Release / validate_and_release (push) Successful in 15s Details
Co-authored-by: owlbot <owlbot@owlboard.info>
Reviewed-on: #14
2024-07-24 13:06:21 +01:00
Fred Boniface 71a5647146 auto-20240712-112351 (#13)
Generate Release / validate_and_release (push) Successful in 21s Details
Reviewed-on: #13
2024-07-12 11:33:46 +01:00
owlbot 0562c3bcb3 Sort & Merge PIS Files 2024-07-12 10:31:03 +00:00
Fred Boniface 96aa5ef9c0 Reviewed changes
Generate Release / validate_and_release (push) Successful in 36s Details
2024-07-12 11:30:29 +01:00
Fred Boniface 77125dfda0 From owlbot diagram-parser
Generate Release / validate_and_release (push) Failing after 3m10s Details
2024-07-12 11:25:15 +01:00
Fred Boniface 8e14964e43 Remove autoPR from automation as it is not working
Generate Release / validate_and_release (push) Successful in 16s Details
2024-07-06 11:38:56 +01:00
Fred Boniface 3f6b728ebc Remove auto file 2024-07-06 11:38:21 +01:00
Fred Boniface ed619461e5 Merge new codes into main file.
Generate Release / validate_and_release (push) Successful in 36s Details
2024-07-06 11:36:53 +01:00
Fred Boniface e26c2ed7a0 auto-20240706-113231 (#12)
Generate Release / validate_and_release (push) Successful in 20s Details
Reviewed-on: #12
2024-07-06 11:34:47 +01:00
owlbot ea4ec2e34f Sort & Merge PIS Files 2024-07-06 10:32:16 +00:00
Fred Boniface 6ba95bb5b4 Update pis/auto-20240706-145015.yaml
Generate Release / validate_and_release (push) Failing after 35s Details
2024-07-06 11:31:24 +01:00
Fred Boniface c7e21c80fe Add pis/auto-20240706-145015 2024-07-06 11:25:00 +01:00
Fred Boniface caa07f840c Update knowledgebase data
Generate Release / validate_and_release (push) Successful in 13s Details
2024-07-01 16:26:25 +01:00
Fred Boniface 0d7763c58d Fix coordinates
Generate Release / validate_and_release (push) Successful in 10s Details
2024-06-29 21:21:17 +01:00
Fred Boniface c743347d28 Update knowledgebase additional stations
Generate Release / validate_and_release (push) Successful in 13s Details
2024-06-29 21:15:39 +01:00
Fred Boniface 62bade5653 Add additional locations to supplement Knowledgebase data - INCOMPLETE
Generate Release / validate_and_release (push) Successful in 16s Details
2024-06-28 21:21:06 +01:00
Fred Boniface 6f9a71abe7 auto-20240502-120200 (#10)
Generate Release / validate_and_release (push) Successful in 14s Details
Reviewed-on: #10
2024-05-02 12:21:02 +01:00
owlbot cd681c1218 Sort & Merge PIS Files 2024-05-02 11:10:34 +00:00
Fred Boniface fe44163de9 Review
Generate Release / validate_and_release (push) Failing after 36s Details
2024-05-02 12:10:04 +01:00
Fred Boniface 7a7f488e03 From owlbot diagram-parser
Generate Release / validate_and_release (push) Failing after 17s Details
2024-05-02 12:02:58 +01:00
owlbot 114c827c13 Sort & Merge PIS Files
Generate Release / validate_and_release (push) Successful in 9s Details
2024-04-24 12:41:15 +00:00
Fred Boniface 5263c7115b From owlbot diagram-parser
Generate Release / validate_and_release (push) Successful in 28s Details
2024-04-24 13:40:50 +01:00
owlbot 35c27842b1 Sort & Merge PIS Files
Generate Release / validate_and_release (push) Successful in 11s Details
2024-04-19 14:15:41 +00:00
Fred Boniface 686107015c Verify remaining codes
Generate Release / validate_and_release (push) Successful in 24s Details
Comments added to explain how verification was completed
2024-04-19 15:15:27 +01:00
Fred Boniface def693696a Update pis/dg_parser_20240419-144511.yaml
Generate Release / validate_and_release (push) Failing after 13s Details
Comments added to describe verification methods
2024-04-19 15:03:26 +01:00
Fred Boniface 759ae2b745 Update pis/dg_parser_20240419-144511.yaml
Generate Release / validate_and_release (push) Failing after 12s Details
2024-04-19 15:01:47 +01:00
Fred Boniface b502f88c29 From owlbot diagram-parser
Generate Release / validate_and_release (push) Failing after 58s Details
2024-04-19 14:46:16 +01:00
owlbot 2da2b66f47 Sort & Merge PIS Files
Generate Release / validate_and_release (push) Successful in 16s Details
2024-04-04 09:58:13 +00:00
Fred Boniface 8a1f233ec7 From owlbot diagram-parser
Generate Release / validate_and_release (push) Successful in 43s Details
2024-04-04 10:57:41 +01:00
Fred Boniface 3b0104bbed Fix incorrect code
Generate Release / validate_and_release (push) Successful in 15s Details
2024-04-02 20:55:18 +01:00
owlbot 29b28575c5 Sort & Merge PIS Files
Generate Release / validate_and_release (push) Successful in 15s Details
2024-04-02 13:28:46 +00:00
Fred Boniface 2a8be0917e Verified Uncertain Codes
Generate Release / validate_and_release (push) Successful in 38s Details
Both 0365 and 6177 confirmed using their known starting locations.
2024-04-02 14:28:23 +01:00
Fred Boniface 932535ebfa From owlbot diagram-parser
Generate Release / validate_and_release (push) Failing after 15s Details
2024-04-02 14:19:46 +01:00
owlbot f961b153ca Sort & Merge PIS Files
Generate Release / validate_and_release (push) Successful in 15s Details
2024-04-02 13:14:35 +00:00
Fred Boniface 23eb06ee42 From owlbot diagram-parser
Generate Release / validate_and_release (push) Successful in 47s Details
2024-04-02 14:13:54 +01:00
owlbot 14e3c26ea2 Sort & Merge PIS Files
Generate Release / validate_and_release (push) Successful in 20s Details
2024-03-31 18:32:37 +00:00
Fred Boniface 4de496f9f4 Remove code 8006 due to uncertainty of stops. This code relates to the sleeper service.
Generate Release / validate_and_release (push) Successful in 2m49s Details
2024-03-31 19:29:26 +01:00
Fred Boniface f720359395 Remove errornous codes:
- "0365" was listed as BRI-SVB.
  - "5224" was missing stops at SRD & LWH
  - "5461" was listed terminating WSB instead of FRO
  - "5465" Reported as missing TOC.  Not handled in this file and will require further investigations.
2024-03-31 19:28:34 +01:00
Fred Boniface 96a84d9c0e From owlbot diagram-parser
Generate Release / validate_and_release (push) Failing after 54s Details
2024-03-26 10:45:15 +00:00
Fred Boniface 1418843ecb Fix incorrect CRS (RGD>RDG)
Generate Release / validate_and_release (push) Successful in 13s Details
2024-03-20 12:39:34 +00:00
owlbot df31632f0a Sort & Merge PIS Files
Generate Release / validate_and_release (push) Successful in 17s Details
2024-03-20 08:19:27 +00:00
Fred Boniface 10e6e9b508 Verified Uncertain Codes
Generate Release / validate_and_release (push) Successful in 30s Details
Verified 1683 & 0352.
Validation method: personal knowledge.

Signed-off-by: Fred Boniface <fred@fjla.uk>
2024-03-20 08:19:04 +00:00
Fred Boniface 55a7290971 From owlbot diagram-parser
Generate Release / validate_and_release (push) Failing after 57s Details
2024-03-20 08:15:31 +00:00
Fred Boniface 521761a620 Update merge script to remove entries with empty stops arrays
Generate Release / validate_and_release (push) Successful in 23s Details
2024-03-14 12:13:51 +00:00
owlbot d7c0e0fb02 Sort & Merge PIS Files
Generate Release / validate_and_release (push) Successful in 26s Details
2024-03-14 12:00:10 +00:00
Fred Boniface d3fdcef3f5 From owlbot diagram-parser
Generate Release / validate_and_release (push) Successful in 2m12s Details
2024-03-14 11:58:25 +00:00
Fred Boniface aff89c02c5 AutoPR Reenablement
Generate Release / validate_and_release (push) Successful in 13s Details
2024-03-08 13:42:33 +00:00
Fred Boniface 5e206270f2 Adjust commit message etc
Generate Release / validate_and_release (push) Successful in 14s Details
2024-03-08 13:39:36 +00:00
fred.boniface bdacc9dff3 Apply automatic changes 2024-03-08 13:32:02 +00:00
Fred Boniface f4e5c33a4f Commit changes
Generate Release / validate_and_release (push) Successful in 17s Details
2024-03-08 13:31:37 +00:00
Fred Boniface fbefe15de8 Add error handling
Generate Release / validate_and_release (push) Successful in 14s Details
2024-03-08 13:16:25 +00:00
Fred Boniface 4fbbf30fbd Remove old files
Generate Release / validate_and_release (push) Successful in 13s Details
2024-03-08 13:14:22 +00:00
Fred Boniface 5d826099f2 Trying
Generate Release / validate_and_release (push) Successful in 15s Details
2024-03-08 13:05:33 +00:00
Fred Boniface f411368e80 Adjust merge-yaml script to output owlboard style yaml 2024-03-08 13:03:06 +00:00
OwlBot cf52b236cf Verified Uncertain Codes
Generate Release / validate_and_release (push) Successful in 14s Details
Verified: 1708, 1674 via Diagram checks.
2024-03-08 12:47:31 +00:00
OwlBot b1ea379c8c Codes verified
Generate Release / validate_and_release (push) Failing after 14s Details
Verified: 0346, 0250, 0245 via PIS Code PDF.
2024-03-08 12:45:12 +00:00
OwlBot 671d2b3fd1 Remove blank codes
Generate Release / validate_and_release (push) Failing after 13s Details
2024-03-08 12:42:11 +00:00
Fred Boniface 7e358dc657 From owlbot diagram-parser
Generate Release / validate_and_release (push) Failing after 28s Details
2024-03-08 12:36:17 +00:00
Fred Boniface b10df9b578 Add YAML merge script
Generate Release / validate_and_release (push) Successful in 18s Details
2024-03-08 12:22:56 +00:00
Fred Boniface 776f4ec5f5 Verified Uncertain Codes
Generate Release / validate_and_release (push) Successful in 18s Details
Code 1183: Verified via PIS Code Document
Code 0493: Verified via PIS Code Document
2024-03-01 12:49:58 +00:00
Fred Boniface ccbe5ca12e Remove blank codes
Generate Release / validate_and_release (push) Failing after 17s Details
These codes stem from services which are either ECS - no public stops which means no code (sometimes these are errornously given codes on the diagram), or are cancelled in the timetable - stops cannot be confirmed.

Signed-off-by: Fred Boniface <fred@fjla.uk>
2024-03-01 12:46:10 +00:00
Fred Boniface 76c57e523e From owlbot diagram-parser
Generate Release / validate_and_release (push) Failing after 3m22s Details
2024-03-01 11:08:03 +00:00
Fred Boniface 7070b4d3cb Remove files from release
Generate Release / validate_and_release (push) Successful in 13s Details
2024-02-22 16:56:51 +00:00
7 changed files with 3661 additions and 2579 deletions

View File

@ -5,17 +5,30 @@ on:
push:
branches:
- auto-*
- workflow_update
jobs:
validate_and_release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out Repo code
uses: actions/checkout@v3
- name: Validate YAML
uses: https://github.com/GrantBirki/json-yaml-validate@v2.6.1
- run: echo "This automation is not yet doing anything. It will generate a PR"
## Adjust so that the release is posted by OwlBot
- name: Install Dependencies
run: npm i
- name: Merge to gw.yaml
run: node ./scripts/merge-yaml.js
- name: Commit Changes
uses: https://github.com/stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Sort & Merge PIS Files
commit_user_name: owlbot
commit_user_email: owlbot@owlboard.info
commit_author: owlbot <owlbot@owlboard.info>

View File

@ -26,13 +26,7 @@ jobs:
env:
NODE_OPTIONS: '--experimental-fetch'
with:
body: Addition of more automatically parsed PIS Codes
body: Automatic release after changes
tag_name: ${{ steps.timestamp.outputs.date }}
name: ${{ steps.timestamp.outputs.date }}
token: ${{ secrets.OWLBOT_KEY }}
files: |
./pis/gw.yaml
./reasonCodes/reasoncodes.json
## Adjust so that the release is posted by OwlBot

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
node_modules
package-lock.json

View File

@ -0,0 +1,449 @@
<?xml version="1.0", encoding="utf-8"?>
<!-- Contains stations which are included in LDBSVWS but not in
knowledgebase, such as ferry terminals with departure data
but no train services.
The data here is formatted such that it can be appended to
knowledgebase stations data while it is being parsed.
The combined output can be used to validate requests to
LDBSVWS (or the public version) to reduce API requests
that will return no data
Only a subset of the information included in the knowledgebase
is included for these locations
-->
<StationList>
<Station>
<CrsCode>YMH</CrsCode>
<Name>Yarmouth (Isle of Wight)</Name>
<SixteenCharacterName>YARMOUTH IOW</SixteenCharacterName>
<Longitude>-1.500656</Longitude>
<Latitude>50.706512</Latitude>
</Station>
<Station>
<CrsCode>RTY</CrsCode>
<Name>Rothesay, Bute (Ferry/Bus)</Name>
<SixteenCharacterName>Rothesay Bute</SixteenCharacterName>
<Longitude>-5.054006</Longitude>
<Latitude>55.838897</Latitude>
</Station>
<Station>
<CrsCode>BFA</CrsCode>
<Name>Belfast Port</Name>
<SixteenCharacterName>BELFAST PORT</SixteenCharacterName>
<Longitude>-5.889967</Longitude>
<Latitude>54.628623</Latitude>
</Station>
<Station>
<CrsCode>CRP</CrsCode>
<Name>Cairnryan Port</Name>
<SixteenCharacterName>Cairnryan Port</SixteenCharacterName>
<Longitude>-5.036245</Longitude>
<Latitude>54.985075</Latitude>
</Station>
<Station>
<CrsCode>DPS</CrsCode>
<Name>Dublin Port (Stena)</Name>
<SixteenCharacterName>Dublin Stena</SixteenCharacterName>
<Longitude>-6.196574</Longitude>
<Latitude>53.344992</Latitude>
</Station>
<Station>
<CrsCode>DFP</CrsCode>
<Name>Dublin Ferryport</Name>
<SixteenCharacterName></SixteenCharacterName>
<Longitude>-6.196574</Longitude>
<Latitude>53.344992</Latitude>
</Station>
<Station>
<CrsCode>HTR</CrsCode>
<Name>Heathrow Central (Bus)</Name>
<SixteenCharacterName>Heathrow Central</SixteenCharacterName>
<Longitude>-0.452915</Longitude>
<Latitude>51.471207</Latitude>
</Station>
<Station>
<CrsCode>PMG</CrsCode>
<Name>Porthmadog (FR)</Name>
<SixteenCharacterName>Porthmadog FR</SixteenCharacterName>
<Longitude>-4.126746</Longitude>
<Latitude>52.923882</Latitude>
</Station>
<Station>
<CrsCode>LSM</CrsCode>
<Name>Isle of Lismore</Name>
<SixteenCharacterName>Isle of Lismore</SixteenCharacterName>
<Longitude>-5.491786</Longitude>
<Latitude>56.511869</Latitude>
</Station>
<Station>
<CrsCode>BDC</CrsCode>
<Name>Brodick (Arran)</Name>
<SixteenCharacterName>Brodick Arran</SixteenCharacterName>
<Longitude>-5.136372</Longitude>
<Latitude>55.577074</Latitude>
</Station>
<Station>
<CrsCode>RSB</CrsCode>
<Name>Rosslare Harbour</Name>
<SixteenCharacterName>Rosslare Harbour</SixteenCharacterName>
<Longitude>-6.338626</Longitude>
<Latitude>52.255216</Latitude>
</Station>
<Station>
<CrsCode>SCB</CrsCode>
<Name>Scrabster Harbour</Name>
<SixteenCharacterName>Scrabster</SixteenCharacterName>
<Longitude>-3.544390</Longitude>
<Latitude>58.611545</Latitude>
</Station>
<Station>
<CrsCode>CTB</CrsCode>
<Name>Castlebay (Barra)</Name>
<SixteenCharacterName>Castlebay Bus</SixteenCharacterName>
<Longitude>-7.488614</Longitude>
<Latitude>56.954392</Latitude>
</Station>
<Station>
<CrsCode>ULP</CrsCode>
<Name>Ullapool</Name>
<SixteenCharacterName>Ullapool</SixteenCharacterName>
<Longitude>-5.160333</Longitude>
<Latitude>57.895064</Latitude>
</Station>
<Station>
<CrsCode>SOY</CrsCode>
<Name>Stornoway (Lewis)</Name>
<SixteenCharacterName>Stornoway</SixteenCharacterName>
<Longitude>-6.387503</Longitude>
<Latitude>58.206323</Latitude>
</Station>
<Station>
<CrsCode>CRU</CrsCode>
<Name>Craignure (Mull)</Name>
<SixteenCharacterName>Craignure</SixteenCharacterName>
<Longitude>-5.704677</Longitude>
<Latitude>56.471517</Latitude>
</Station>
<Station>
<CrsCode>CUL</CrsCode>
<Name>Great Cumbrae (Island)</Name>
<SixteenCharacterName>Cumbrae</SixteenCharacterName>
<Longitude>-4.897916</Longitude>
<Latitude>55.786682</Latitude>
</Station>
<Station>
<CrsCode>KCG</CrsCode>
<Name>Kilcreggan Pier</Name>
<SixteenCharacterName>Kilcreggan</SixteenCharacterName>
<Longitude>-4.819737</Longitude>
<Latitude>55.984028</Latitude>
</Station>
<Station>
<CrsCode>HVH</CrsCode>
<Name>Hoek van Holland</Name>
<SixteenCharacterName></SixteenCharacterName>
<Longitude>4.129120</Longitude>
<Latitude>51.974027</Latitude>
</Station>
<Station>
<CrsCode>DUO</CrsCode>
<Name>Dunoon Pier</Name>
<SixteenCharacterName>Dunoon</SixteenCharacterName>
<Longitude>-4.921664</Longitude>
<Latitude>55.945575</Latitude>
</Station>
<Station>
<CrsCode>LCB</CrsCode>
<Name>Lochboisdale (South Uist)</Name>
<SixteenCharacterName>Lochboisdale</SixteenCharacterName>
<Longitude>-7.303972</Longitude>
<Latitude>57.152210</Latitude>
</Station>
<Station>
<CrsCode>UIG</CrsCode>
<Name>Uig (Isle of Skye)</Name>
<SixteenCharacterName>Uig, Skye</SixteenCharacterName>
<Longitude>-6.371742</Longitude>
<Latitude>57.585249</Latitude>
</Station>
<Station>
<CrsCode>TBT</CrsCode>
<Name>Tarbert (Isle of Lewis)</Name>
<SixteenCharacterName>Tarbert, Lewis</SixteenCharacterName>
<Longitude>-6.799399</Longitude>
<Latitude>57.897030</Latitude>
</Station>
<Station>
<CrsCode>LCH</CrsCode>
<Name>Lochmaddy (North Uist)</Name>
<SixteenCharacterName>Lochmaddy</SixteenCharacterName>
<Longitude>-7.157484</Longitude>
<Latitude>57.596520</Latitude>
</Station>
<Station>
<CrsCode>LVS</CrsCode>
<Name>Liverpool Landing Stage</Name>
<SixteenCharacterName>Livpool Land Stg</SixteenCharacterName>
<Longitude>-2.998774</Longitude>
<Latitude>53.406600</Latitude>
</Station>
<Station>
<CrsCode>KWK</CrsCode>
<Name>Keswick Bus Station</Name>
<SixteenCharacterName>Keswick Bus Stn</SixteenCharacterName>
<Longitude>-3.141946</Longitude>
<Latitude>54.601462</Latitude>
</Station>
<Station>
<CrsCode>DGS</CrsCode>
<Name>Douglas (Isle of Man)</Name>
<SixteenCharacterName>Douglas IOM</SixteenCharacterName>
<Longitude>-4.471736</Longitude>
<Latitude>54.147904</Latitude>
</Station>
<Station>
<CrsCode>DEB</CrsCode>
<Name>Dereham Bus (Market Place)</Name>
<SixteenCharacterName>Dereham Bus</SixteenCharacterName>
<Longitude>-0.940602</Longitude>
<Latitude>52.681599</Latitude>
</Station>
<Station>
<CrsCode>EMA</CrsCode>
<Name>East Midlands Airport (Bus)</Name>
<SixteenCharacterName>E Midlands Aprt.</SixteenCharacterName>
<Longitude>-1.330462</Longitude>
<Latitude>52.825718</Latitude>
</Station>
<Station>
<CrsCode>SGQ</CrsCode>
<Name>Stone (Granville Square, Bus)</Name>
<SixteenCharacterName>Granville Square</SixteenCharacterName>
<Longitude>-2.148309</Longitude>
<Latitude>52.903549</Latitude>
</Station>
<Station>
<CrsCode>LUB</CrsCode>
<Name>Luton Airport (Bus)</Name>
<SixteenCharacterName>Luton Airport</SixteenCharacterName>
<Longitude>-0.375259</Longitude>
<Latitude>51.879070</Latitude>
</Station>
<Station>
<CrsCode>EDA</CrsCode>
<Name>Edinburgh Airport (Bus)</Name>
<SixteenCharacterName>Edinburgh Airpt</SixteenCharacterName>
<Longitude>-3.358012</Longitude>
<Latitude>55.947523</Latitude>
</Station>
<Station>
<CrsCode>SAI</CrsCode>
<Name>Sheffield Arena (Tram)</Name>
<SixteenCharacterName>Sheffield Arena</SixteenCharacterName>
<Longitude>-1.420300</Longitude>
<Latitude>53.398331</Latitude>
</Station>
<Station>
<CrsCode>XCF</CrsCode>
<Name>Cardiff Airport (Bus)</Name>
<SixteenCharacterName>Cardiff Airport</SixteenCharacterName>
<Longitude>-3.339034</Longitude>
<Latitude>51.398851</Latitude>
</Station>
<Station>
<CrsCode>XAA</CrsCode>
<Name>Galashiels Bus Station</Name>
<SixteenCharacterName>Galashiels Bus</SixteenCharacterName>
<Longitude>-2.805677</Longitude>
<Latitude>55.617594</Latitude>
</Station>
<Station>
<CrsCode>FRH</CrsCode>
<Name>Calais Frethun</Name>
<SixteenCharacterName>Calais Frethun</SixteenCharacterName>
<Longitude>1.821091</Longitude>
<Latitude>50.921963</Latitude>
</Station>
<Station>
<CrsCode>PBN</CrsCode>
<Name>Paris Gare du Nord</Name>
<SixteenCharacterName>Paris Nord</SixteenCharacterName>
<Longitude>2.355725</Longitude>
<Latitude>48.880557</Latitude>
</Station>
<Station>
<CrsCode>AMS</CrsCode>
<Name>Amsterdam Centraal</Name>
<SixteenCharacterName>Amsterdan Ctl</SixteenCharacterName>
<Longitude>4.900461</Longitude>
<Latitude>52.378672</Latitude>
</Station>
<Station>
<CrsCode>BXS</CrsCode>
<Name>Brussels Midi</Name>
<SixteenCharacterName>Brussels Midi</SixteenCharacterName>
<Longitude>4.336522</Longitude>
<Latitude>50.835096</Latitude>
</Station>
<Station>
<CrsCode>SGE</CrsCode>
<Name>Swanage (Swanage Rly)</Name>
<SixteenCharacterName>SWANAGE</SixteenCharacterName>
<Longitude>-1.960048</Longitude>
<Latitude>50.609976</Latitude>
</Station>
<Station>
<CrsCode>HAR</CrsCode>
<Name>Harmans Cross (Swanage Rly)</Name>
<SixteenCharacterName>Harmans Cross</SixteenCharacterName>
<Longitude>-2.027277</Longitude>
<Latitude>50.619897</Latitude>
</Station>
<Station>
<CrsCode>CFC</CrsCode>
<Name>Corfe Castle (Swanage Rly)</Name>
<SixteenCharacterName>Corfe Castle</SixteenCharacterName>
<Longitude>-2.054689</Longitude>
<Latitude>50.638107</Latitude>
</Station>
<Station>
<CrsCode>NOD</CrsCode>
<Name>Norden (Swanage Rly)</Name>
<SixteenCharacterName>Norden</SixteenCharacterName>
<Longitude>-2.062072</Longitude>
<Latitude>50.644630</Latitude>
</Station>
<Station>
<CrsCode>HEH</CrsCode>
<Name>Herston Halt (Swanage Rly)</Name>
<SixteenCharacterName>Herston Halt</SixteenCharacterName>
<Longitude>-1.980250</Longitude>
<Latitude>50.613084</Latitude>
</Station>
<Station>
<CrsCode>MHD</CrsCode>
<Name>Minehead (WSR/Bus)</Name>
<SixteenCharacterName>Minehead</SixteenCharacterName>
<Longitude>-3.469013</Longitude>
<Latitude>51.206834</Latitude>
</Station>
<Station>
<CrsCode>XDY</CrsCode>
<Name>Dunster (Bus)</Name>
<SixteenCharacterName>Dunster</SixteenCharacterName>
<Longitude>-3.444564</Longitude>
<Latitude>51.182943</Latitude>
</Station>
<Station>
<CrsCode>WCT</CrsCode>
<Name>Watchet (WSR/Bus)</Name>
<SixteenCharacterName>Watchet</SixteenCharacterName>
<Longitude>-3.329689</Longitude>
<Latitude>51.180929</Latitude>
</Station>
<Station>
<CrsCode>BIB</CrsCode>
<Name>Bishops Lydeard (WSR)</Name>
<SixteenCharacterName>Bishops Lydeard</SixteenCharacterName>
<Longitude>-3.193899</Longitude>
<Latitude>51.053827</Latitude>
</Station>
<Station>
<CrsCode>XLU</CrsCode>
<Name>Bishops Lydeard (Bus)</Name>
<SixteenCharacterName>Bishop Lyd (BUS)</SixteenCharacterName>
<Longitude>-3.187749</Longitude>
<Latitude>51.056697</Latitude>
</Station>
<Station>
<CrsCode>YVB</CrsCode>
<Name>Yeovil Bus Station</Name>
<SixteenCharacterName>Yeovil (BUS)</SixteenCharacterName>
<Longitude>-2.627254</Longitude>
<Latitude>50.942009</Latitude>
</Station>
<Station>
<CrsCode>FLZ</CrsCode>
<Name>Flamingo Land (Bus)</Name>
<SixteenCharacterName>Flamingo Land</SixteenCharacterName>
<Longitude>-0.808575</Longitude>
<Latitude>54.208536</Latitude>
</Station>
<Station>
<CrsCode>XBR</CrsCode>
<Name>Midsomer Norton (Bus)</Name>
<SixteenCharacterName>Midsomer Norton</SixteenCharacterName>
<Longitude>-2.482952</Longitude>
<Latitude>51.285678</Latitude>
</Station>
<Station>
<CrsCode>XEQ</CrsCode>
<Name>Radstock (Bus)</Name>
<SixteenCharacterName>Radstock</SixteenCharacterName>
<Longitude>-2.447870</Longitude>
<Latitude>51.291644</Latitude>
</Station>
<Station>
<CrsCode>XKW</CrsCode>
<Name>Blackwood Bus Station</Name>
<SixteenCharacterName>Blackwood</SixteenCharacterName>
<Longitude>-3.195482</Longitude>
<Latitude>51.665032</Latitude>
</Station>
</StationList>

14
package.json Normal file
View File

@ -0,0 +1,14 @@
{
"name": "merge-yaml",
"version": "1.0.0",
"description": "Contains OwlBoard provided data. Queried programatically by the OwlBoard dbmanager application to be loaded into the database.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"yaml": "^2.4.1"
}
}

File diff suppressed because it is too large Load Diff

65
scripts/merge-yaml.js Normal file
View File

@ -0,0 +1,65 @@
const fs = require('fs')
const yaml = require('yaml')
const directoryPath = './pis/'
function sortAndMergeYAMLFiles() {
try {
const files = fs.readdirSync(directoryPath);
let mergedData = [];
files.forEach(file => {
const data = fs.readFileSync(directoryPath + file, 'utf-8');
const parsedData = yaml.parse(data)
if (parsedData && typeof parsedData === 'object' && parsedData.pis) {
mergedData.push(...parsedData.pis)
} else {
if (Array.isArray(parsedData)) {
mergedData.push(...parsedData);
} else {
console.error("Incorrect YAML")
}
}
});
mergedData.sort((a, b) => {
const codeA = parseInt(a.code);
const codeB = parseInt(b.code);
return codeA - codeB
})
const mergedYaml = yaml.stringify(mergedData);
// Construct the output string
let outputString = "pis:\n";
mergedData.forEach(item => {
if (item.stops.length > 0) {
outputString += ` - code: "${item.code}"\n`;
outputString += ` stops: [${item.stops.map(stop => `${stop}`).join(',')}]\n`;
}
});
try {
fs.writeFileSync('./pis/gw.yaml', outputString);
console.log("Overwritten gw.pis")
} catch (err) {
console.error("Error writing gw.pis", err)
}
files.forEach(file => {
if (file.startsWith('dg_parser')) {
fs.unlinkSync(directoryPath + file);
console.log(`Deleted file: ${file}`);
}
});
} catch(err) {
console.error('Error merging YAML:', err)
}
}
sortAndMergeYAMLFiles();