Closed WalterWolf49 closed 7 years ago
Is this the same issue as reported in https://github.com/OpendataCH/Transport/issues/122?
Yes it's the same issue... Is it not possible to get the full train number for both the stationboard and the connections?
If you can send me the requests (full URL) for both /stationboard and /connections which return the S 30 8047 I can have a detailed look.
Okay, so this is the information we get back:
<JourneyAttributeList>
<JourneyAttribute from="0" to="10">
<Attribute type="NAME">
<AttributeVariant type="NORMAL">
<Text>S 30</Text>
</AttributeVariant>
</Attribute>
</JourneyAttribute>
<JourneyAttribute from="0" to="10">
<Attribute type="OPERATOR">
<AttributeVariant type="NORMAL">
<Text>THURBO</Text>
</AttributeVariant>
</Attribute>
</JourneyAttribute>
<JourneyAttribute from="0" to="10">
<Attribute type="NUMBER">
<AttributeVariant type="NORMAL">
<Text>30</Text>
</AttributeVariant>
</Attribute>
</JourneyAttribute>
</JourneyAttributeList>
<JourneyAttributeList>
<JourneyAttribute from="0" to="10">
<Attribute type="NAME">
<AttributeVariant type="NORMAL">
<Text>S 30 8055</Text>
</AttributeVariant>
</Attribute>
</JourneyAttribute>
<JourneyAttribute from="0" to="10">
<Attribute type="OPERATOR">
<AttributeVariant type="SHORT">
<Text>THU</Text>
</AttributeVariant>
<AttributeVariant type="NORMAL">
<Text>THURBO</Text>
</AttributeVariant>
<AttributeVariant type="LONG">
<Text>THURBO</Text>
</AttributeVariant>
</Attribute>
</JourneyAttribute>
<JourneyAttribute from="0" to="10">
<Attribute type="NUMBER">
<AttributeVariant type="NORMAL">
<Text>8055</Text>
</AttributeVariant>
</Attribute>
</JourneyAttribute>
</JourneyAttributeList>
So we can improve the operator field by checking the variant type and I will create a pull request for that but unfortunately the name and number are not consistent at SBB so it would require parsing additional fields to get it right - contributions are welcome here.
Okay, having a correct operator is a nice improvement. Thanks for that. The biggest improvement would be to have consistent numbers, maybe that can be added in the future.
Okay, I've merged the operator pull request.
I've just improved the parsing of the number by using the LINE
attribute.
@WalterWolf49 can you confirm this is now as expected?
@fabian I've checked it and it does look as expected! Thanks for adding this!
Just so you don't get bored, another improvement would be to have the train number in addition to the line number :) If it's possible... But for now I'm happy with the line number.
The stationboard api returns train informations like operator : "THURBO", name : "S 30" and number : "30". The connections api returns different informations for the same train e.g: operator : "THU", name : "S 30 8047" and number : "8047"