ingestor-metrolink
Version:
Simple script to get Metrolink tram station locations from the NaPTAN national transport dataset.
29 lines (20 loc) • 847 B
Markdown
Simple script to get Metrolink tram station locations from the NaPTAN national transport dataset.
Station locations are stored in greater-manchester-transport.xml, script just extracts Metrolink data only.
Pass an outpath file path and optionally pass an input to read from. If no input is passed then it will read from a default data set.
Output should always be a JSON file and input should always be an XML file of the shape returned from `naptan.app.dft.gov.uk/DataRequest/Naptan.ashx?format=xml&LA=180`
```js
const ingestor = require('metrolink-ingestor')
ingestor('path/to/my-output.json') // uses default data
ingestor('path/to/my-output.json', 'greater-manchester-transport.xml') // uses greater-manchester-transport.xml
```
Development:
```bash
npm t
```
Prod:
```bash
npm start
```