Skip to content

Commit

Permalink
readme: adapt to latest data (DHIDs/IFOPTs) 📝
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Sep 20, 2024
1 parent ca9d0cd commit 82596df
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ The [npm package](https://npmjs.com/vbb-stations) contains [*Friendly Public Tra
[
{
type: 'station',
id: '900000009101',
id: 'de:11000:900009101',
name: 'U Amrumer Str.',
location: {
type: 'location',
latitude: 52.542202,
longitude: 13.349534
},
weight: 3563
weight: 2474,
}
]
```
Expand All @@ -40,38 +40,38 @@ You can filter all stations by `id` or any property ([`lodash.get`](https://loda
```js
const stations = require('vbb-stations')

console.log(stations('900000009101')) // query a single station
console.log(stations('de:11000:900009101')) // query a single station
console.log(stations({ // filter by property
weight: 3563,
weight: 2474,
'location.latitude': 52.542202
}))
```

`full.json` contains all stops of each station and unshortened names.

```js
require('vbb-stations/full.json')['900000009101']
require('vbb-stations/full.json')['de:11000:900009101']
```

One entry looks like this:

```js
{
type: 'station',
id: '900000009101',
id: 'de:11000:900009101',
name: 'U Amrumer Str. (Berlin)',
location: {
type: 'location',
latitude: 52.542202,
longitude: 13.349534
},
weight: 3284.25,
weight: 2474,
stops: [
{
type: 'stop',
id: '070101000865',
id: 'de:11000:900009101::1',
name: 'U Amrumer Str. (Berlin)',
station: '900000009101',
station: 'de:11000:900009101',
location: {
type: 'location',
latitude: 52.542202,
Expand All @@ -81,9 +81,9 @@ One entry looks like this:
//
{
type: 'stop',
id: '070201092402',
id: 'de:11000:900009101::2',
name: 'U Amrumer Str. (Berlin)',
station: '900000009101',
station: 'de:11000:900009101',
location: {
type: 'location',
latitude: 52.542202,
Expand All @@ -97,7 +97,7 @@ One entry looks like this:
`names.json` contains only shortened names.

```js
require('vbb-stations/names.json')['900000009101'] // U Amrumer Str.
require('vbb-stations/names.json')['de:11000:900009101'] // U Amrumer Str.
```


Expand All @@ -107,7 +107,7 @@ require('vbb-stations/names.json')['900000009101'] // U Amrumer Str.

`pattern` can be one of the following:

- a station ID, like `900000009101`
- a station ID, like `de:11000:900009101`
- `'all'`
- an object like `{weight: 42, name: 'Alt Pinnow'}`, with each property being mandatory

Expand Down

0 comments on commit 82596df

Please sign in to comment.