public-transport / db-hafas

JavaScript client for the Deutsche Bahn HAFAS API.
https://github.com/public-transport/db-hafas
ISC License
75 stars 5 forks source link

AdminCodes on national express trains | AdminCodes für ICEs #28

Closed flixxgamez closed 2 years ago

flixxgamez commented 2 years ago

🇩🇪 » Wenn ein Journey ein ICE beinhaltet, besitzt dieser Zug einen AdminCode. DIeser kann unter depature > line > adminCode gefunden werden. In meinem Beispiel ist der AdminCode '80___' für den ICE 502. Nach meiner Anfrage fährt dieser über Berlin Hbf und endet in Hamburg-Altona. Was bringt mir dieser Code und wofür kann dieser genutzt werden.

🇬🇧 » When a journey contains a National Express (ICE) I get a admincode for the train from departure > line > adminCode. In my case the adminCode is '80___' for the ICE 502. In my request the train goes via Berlin Central to Hamburg-Altona. What are use cases for the code?

{ origin: { type: 'stop', id: '8011160', name: 'Berlin Hbf', location: { type: 'location', id: '8011160', latitude: 52.524924, longitude: 13.369629 }, products: { nationalExpress: true, national: true, regionalExp: true, regional: true, suburban: true, bus: true, ferry: false, subway: true, tram: true, taxi: false } }, destination: { type: 'stop', id: '8002549', name: 'Hamburg Hbf', location: { type: 'location', id: '8002549', latitude: 53.553533, longitude: 10.00636 }, products: { nationalExpress: true, national: true, regionalExp: true, regional: true, suburban: true, bus: true, ferry: false, subway: true, tram: false, taxi: false } }, departure: '2021-12-22T21:56:00+01:00', plannedDeparture: '2021-12-22T21:38:00+01:00', departureDelay: 1080, arrival: '2021-12-22T23:48:00+01:00', plannedArrival: '2021-12-22T23:33:00+01:00', arrivalDelay: 900, reachable: true, tripId: '1|1079723|0|81|22122021', line: { type: 'line', id: 'ice-502', fahrtNr: '502', name: 'ICE 502', public: true, adminCode: '80____', productName: 'ICE', mode: 'train', product: 'nationalExpress', operator: { type: 'operator', id: 'db-fernverkehr-ag', name: 'DB Fernverkehr AG' } }, direction: 'Hamburg-Altona', currentLocation: { type: 'location', latitude: 52.497651, longitude: 13.372785 }, arrivalPlatform: '5', plannedArrivalPlatform: '5', departurePlatform: '14', plannedDeparturePlatform: '14', loadFactor: 'low-to-medium' }

derhuerst commented 2 years ago

🇬🇧 » When a journey contains a National Express (ICE) I get a admincode for the train from departure > line > adminCode. In my case the adminCode is '80___' for the ICE 502. In my request the train goes via Berlin Central to Hamburg-Altona. What are use cases for the code?

I'm not aware of any use cases, but maybe there are. The adminCode field is present because db-hafas's underlying library hafas-client exposes all fields that exist in the response that it knows about.

Consider it not to be there for now. 😄

Does that answer your question?

derhuerst commented 2 years ago

I'm going to close this Issue. Please re-open it if you have further questions related to this topic, and open a new Issue if you have other questions.