Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # vbb-stations 🚏
  2. A **collection of all stations of the [Berlin Brandenburg public transport service (VBB)](http://www.vbb.de/)**, computed from [open](https://daten.berlin.de/datensaetze/vbb-fahrplandaten-gtfs) [GTFS](https://developers.google.com/transit/gtfs/) [data](https://vbb-gtfs.jannisr.de/).
  3. [![npm version](https://img.shields.io/npm/v/vbb-stations.svg)](https://www.npmjs.com/package/vbb-stations)
  4. [![build status](https://img.shields.io/travis/derhuerst/vbb-stations.svg)](https://travis-ci.org/derhuerst/vbb-stations)
  5. ![ISC-licensed](https://img.shields.io/github/license/derhuerst/vbb-stations.svg)
  6. [![support me via GitHub Sponsors](https://img.shields.io/badge/support%20me-donate-fa7664.svg)](https://github.com/sponsors/derhuerst)
  7. [![chat with me on Twitter](https://img.shields.io/badge/chat%20with%20me-on%20Twitter-1da1f2.svg)](https://twitter.com/derhuerst)
  8. ## Installing
  9. ```shell
  10. npm install vbb-stations
  11. ```
  12. ## Usage
  13. The [npm package](https://npmjs.com/vbb-stations) contains [*Friendly Public Transport Format* 1.2.1](https://github.com/public-transport/friendly-public-transport-format/blob/1.2.1/spec/readme.md) `station`s and `stop`s. `weight` is the sum of all arrivals & departures at a station, weighted by mode of transport.
  14. ```js
  15. [
  16. {
  17. type: 'station',
  18. id: '900000009101',
  19. name: 'U Amrumer Str.',
  20. location: {
  21. type: 'location',
  22. latitude: 52.542202,
  23. longitude: 13.349534
  24. },
  25. weight: 3563
  26. }
  27. ]
  28. ```
  29. You can filter all stations by `id` or any property ([`lodash.get`](https://lodash.com/docs/#get) will be used).
  30. ```js
  31. const stations = require('vbb-stations')
  32. console.log(stations('900000009101')) // query a single station
  33. console.log(stations({ // filter by property
  34. weight: 3563,
  35. 'location.latitude': 52.542202
  36. }))
  37. ```
  38. `full.json` contains all stops of each station and unshortened names.
  39. ```js
  40. require('vbb-stations/full.json')['900000009101']
  41. ```
  42. One entry looks like this:
  43. ```js
  44. {
  45. type: 'station',
  46. id: '900000009101',
  47. name: 'U Amrumer Str. (Berlin)',
  48. location: {
  49. type: 'location',
  50. latitude: 52.542202,
  51. longitude: 13.349534
  52. },
  53. weight: 3284.25,
  54. stops: [
  55. {
  56. type: 'stop',
  57. id: '070101000865',
  58. name: 'U Amrumer Str. (Berlin)',
  59. station: '900000009101',
  60. location: {
  61. type: 'location',
  62. latitude: 52.542202,
  63. longitude: 13.349534
  64. }
  65. },
  66. // …
  67. {
  68. type: 'stop',
  69. id: '070201092402',
  70. name: 'U Amrumer Str. (Berlin)',
  71. station: '900000009101',
  72. location: {
  73. type: 'location',
  74. latitude: 52.542202,
  75. longitude: 13.349534
  76. }
  77. }
  78. ]
  79. }
  80. ```
  81. `names.json` contains only shortened names.
  82. ```js
  83. require('vbb-stations/names.json')['900000009101'] // U Amrumer Str.
  84. ```
  85. ## API
  86. `stations([pattern])`
  87. `pattern` can be one of the following:
  88. - a station ID, like `900000009101`
  89. - `'all'`
  90. - an object like `{weight: 42, name: 'Alt Pinnow'}`, with each property being mandatory
  91. ## Contributing
  92. If you **have a question**, **found a bug** or want to **propose a feature**, have a look at [the issues page](https://github.com/derhuerst/vbb-stations/issues).