Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page describes the adjustments, additions and changes that have been made to the NeTEx traffic data that Samtrafiken will deliver to a limited number of timetable data consumers such as SJ. Some of the changes have also been introduced in Samtrafiken’s regular NeTEx exports.

...

When sending NeTEx sales data to Samtrafiken then only a subset of these additions should be used. For sending data to Samtrafiken, please refer to the documentation here: Samtrafiken NeTEx import and for special adjustments here: Special cases for sending sales data to Samtrafiken.

Stops file - _stops.xml - StopPlace

The <StopPlace> element has been extended with additional <KeyValue> elements in order to provide information concerning: interchanges, "Rikshållplats"-numbers and whether a stop is sellable or not.

...

Each of these values is interpreted as:

FromProducer:ToProducer:FromProductTransportMode:ToProductTransportMode:MinimumInterchangeTime

The value is taken from Samtrafiken's BRM-system, similar to what you can see here: https://brm.samtrafiken.se/showtimes?pta=-1&station=g%C3%B6teborg+centralstation.
The producer numbers in “FromProducer” and “ToProducer” refer to the producer responsible for sales, and prices and which is displayed to the public. This is the value “salesAuthorityNumber” on a Line (used to be called färdmedelsproducent in Petra).

...

Example values: CST for Stockholms Central Station, ÖSV,ÖSVI for Östersund Västra.

...

Stops file - _

...

stops.xml

...

The <Authority> element now has the <PrivateCode> element specified. This is the producer number used for traffic data, interchanges, line files etc.

- GroupOfStopPlaces

Addition 2024-10-08

We have now added <GroupOfStopPlaces> elements to the stops-file. There are currently around 380 GroupOfStopPlaces in the file. They are created and maintained by the Traffic-data team at Samtrafiken.

The <GroupOfStopPlaces> element has been extended with two KeyValue> elements in order to provide information concerning the "Rikshållplats"-number and whether the GroupOfStopPlaces should be used in a sellable context or not.

A GroupOfStopPlaces that is marked as sellable would normally contain at least 2 sellable stops.

N.B: All of the referred stops in a sellable GroupOfStopPlaces do not have to be marked as sellable. Each stop has its own sellable-flag to determine if that particular stop is sellable.

The “Rikshållplats”-number of a GroupOfStopPlaces can be used just like the “Rikshållplats”-number from a StopPlace when sending a trip search request to the Hafas journey planner.

Below is an example, of the GroupOfStopPlaces “STOCKHOLM”.

Code Block
breakoutModewide
        <groupsOfStopPlaces>
            <GroupOfStopPlaces version="231007" id="SE:030:GroupOfStopPlaces:9091074000098000">
                <ValidBetween>
                    <FromDate>2023-10-07T00:00:00</FromDate>
                </ValidBetween>
                <keyList>
                    <KeyValue>
                        <Key>sellable</Key>
                        <Value>true</Value>
                    </KeyValue>
                    <KeyValue>
                        <Key>rikshallplatsNummer</Key>
                        <Value>740098000</Value>
                    </KeyValue>
                </keyList>
                <Name>STOCKHOLM</Name>
                <ShortName>STOCKHOLM</ShortName>
                <PrivateCode>98000</PrivateCode>
                <members>
                    <StopPlaceRef ref="SE:030:StopPlace:9021074000001000" version="231007"/>
                    <StopPlaceRef ref="SE:030:StopPlace:9021074000622000" version="231007"/>
                    <StopPlaceRef ref="SE:030:StopPlace:9021074001617000" version="231007"/>
                    <StopPlaceRef ref="SE:030:StopPlace:9021074004383000" version="231007"/>
                    <StopPlaceRef ref="SE:030:StopPlace:9021074012144000" version="231007"/>
                    <StopPlaceRef ref="SE:030:StopPlace:9021074020749000" version="231007"/>
                    <StopPlaceRef ref="SE:030:StopPlace:9021074023844000" version="231007"/>
                    <StopPlaceRef ref="SE:030:StopPlace:9021074024382000" version="231007"/>
                    <StopPlaceRef ref="SE:030:StopPlace:9021074035997000" version="231007"/>
                </members>
                <Centroid>
                    <Location srsName="WGS84">
                        <Longitude>18.058155</Longitude>
                        <Latitude>59.330139</Latitude>
                    </Location>
                </Centroid>
            </GroupOfStopPlaces>
        </groupsOfStopPlaces>

General data - _shared.xml

The <Authority> element now has the <PrivateCode> element specified. This is the producer number used for traffic data, interchanges, line files etc.

Below is an example, the authority “Öresundståg”.

...

A new CountyBorderCrossing extension element has been added inside the TimetabledPassingTime element.
The element is located inside an <Extensions> tag, which is the way that allows new elements to be introduced into the NeTEx data. See the description of <Extensions> here: https://enturas.atlassian.net/wiki/spaces/PUBLIC/pages/728727624/framework#DataManagedObject

The CountyBorderCrossing element is inserted at the point where a after that stop, the journey crosses the county-border and enters into a new county.

Below is a shortened example of this :where a train goes from Boxholm in Östergötland to Tranås in Jönköping.

Code Block
breakoutModefull-width
<passingTimes>
    <TimetabledPassingTime version="any" id="SE:030:TimetabledPassingTime:313100000004740965">
        <StopPointInJourneyPatternRef ref="SE:030:StopPointInJourneyPattern:313100000000016403_313100000000370622" version="any"/>
        <DepartureTime>17:39:00</DepartureTime>
    </TimetabledPassingTime>
    <TimetabledPassingTime version="any" id="SE:030:TimetabledPassingTime:313100000004740969">
        <StopPointInJourneyPatternRef ref="SE:030:StopPointInJourneyPattern:313100000000016403_313100000000370626" version="any"/>
        <ArrivalTime>18:23:00</ArrivalTime>
        <DepartureTime>18:29:00</DepartureTime>
    </TimetabledPassingTime>
    <TimetabledPassingTime version="any" id="SE:030:TimetabledPassingTime:313100000004740970">
        <Extensions>
            <ns4:countyBorderCrossings>
                <ns4:CountyBorderCrossing>
                    <ns4:fromCounty>5</ns4:fromCounty>
                    <ns4:toCounty>6</ns4:toCounty>
                    <ns4:longitude>14.984382</ns4:longitude>
                    <ns4:latitude>58.149419</ns4:latitude>
                    <ns4:type>route</ns4:type>
                </ns4:CountyBorderCrossing>
            </ns4:countyBorderCrossings>
        </Extensions>
        <StopPointInJourneyPatternRef ref="SE:030:StopPointInJourneyPattern:313100000000016403_313100000000370627" version="any"/>
        <ArrivalTime>18:37:00</ArrivalTime>
        <DepartureTime>18:37:00</DepartureTime>
    </TimetabledPassingTime>
    <TimetabledPassingTime version="any" id="SE:030:TimetabledPassingTime:313100000004740971">
        <StopPointInJourneyPatternRef ref="SE:030:StopPointInJourneyPattern:313100000000016403_313100000000370628" version="any"/>
        <ArrivalTime>18:48:00</ArrivalTime>
    </TimetabledPassingTime>
</passingTimes>

...

  • 276 - Skånetrafiken

  • 430 - Pågatåg

  • 258 - Blekingetrafiken

  • 253 - Östgötatrafiken

  • 608 - Östgötapendeln

The county numbers used are the ones defined by SCB for all 21 counties in Sweden. See the complete list here: https://www.scb.se/hitta-statistik/regional-statistik-och-kartor/regionala-indelningar/lan-och-kommuner/lan-och-kommuner-i-kodnummerordning/

Changed producers file - changes.csv

...