8.14.0 • Published 1 year ago

vbb-stations v8.14.0

Weekly downloads
400
License
ISC
Repository
github
Last release
1 year ago

vbb-stations 🚏

A collection of all stations of the Berlin Brandenburg public transport service (VBB), computed from open GTFS data.

npm version ISC-licensed support me via GitHub Sponsors chat with me on Twitter

Installing

npm install vbb-stations

Usage

The npm package contains Friendly Public Transport Format 1.2.1 stations and stops. weight is the sum of all arrivals & departures at a station, weighted by mode of transport.

[
	{
		type: 'station',
		id: 'de:11000:900009101',
		name: 'U Amrumer Str.',
		location: {
			type: 'location',
			latitude: 52.542202,
			longitude: 13.349534
		},
		weight: 2474,
	}
]

You can filter all stations by id or any property (lodash.get will be used).

const stations = require('vbb-stations')

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

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

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

One entry looks like this:

{
	type: 'station',
	id: 'de:11000:900009101',
	name: 'U Amrumer Str. (Berlin)',
	location: {
		type: 'location',
		latitude: 52.542202,
		longitude: 13.349534
	},
	weight: 2474,
	stops: [
		{
			type: 'stop',
			id: 'de:11000:900009101::1',
			name: 'U Amrumer Str. (Berlin)',
			station: 'de:11000:900009101',
			location: {
				type: 'location',
				latitude: 52.542202,
				longitude: 13.349534
			}
		},
		// …
		{
			type: 'stop',
			id: 'de:11000:900009101::2',
			name: 'U Amrumer Str. (Berlin)',
			station: 'de:11000:900009101',
			location: {
				type: 'location',
				latitude: 52.542202,
				longitude: 13.349534
			}
		}
	]
}

names.json contains only shortened names.

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

API

stations([pattern])

pattern can be one of the following:

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

Contributing

If you have a question, found a bug or want to propose a feature, have a look at the issues page.

8.13.0

1 year ago

8.14.0

1 year ago

8.11.0

2 years ago

8.10.0

2 years ago

8.12.0

2 years ago

8.9.0

2 years ago

8.8.0

2 years ago

8.7.0

2 years ago

8.6.0

2 years ago

8.4.0

2 years ago

8.5.0

2 years ago

8.3.0

3 years ago

8.3.1

3 years ago

8.1.0

4 years ago

8.2.0

4 years ago

8.0.0

4 years ago

7.3.2

4 years ago

7.3.1

5 years ago

7.3.0

6 years ago

7.2.0

6 years ago

7.1.0

6 years ago

7.0.0

6 years ago

6.11.0

6 years ago

6.10.0

7 years ago

6.9.0

7 years ago

6.8.0

7 years ago

6.7.0

7 years ago

6.6.0

8 years ago

6.5.0

8 years ago

6.4.1

8 years ago

6.4.0

8 years ago

6.3.0

8 years ago

6.2.1

8 years ago

6.2.0

8 years ago

6.1.0

8 years ago

6.0.0

8 years ago

5.9.0

8 years ago

5.8.0

8 years ago

5.7.0

8 years ago

5.6.0

8 years ago

5.5.0

8 years ago

5.4.0

9 years ago

5.3.0

9 years ago

5.2.0

9 years ago

5.1.0

9 years ago

5.0.0

9 years ago

4.1.0

9 years ago

4.0.0

9 years ago

3.3.0

9 years ago

3.2.0

9 years ago

3.1.0

9 years ago

3.0.1

9 years ago

3.0.0

9 years ago

2.1.0

10 years ago

2.0.0

10 years ago

1.0.0

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago