Detta inlägg är gammalt och kan innehålla inaktuell information.

agency_stops.txt to agency mapping

How does one map the stops in the "extra" set to regional stops? For example in the GTFS Sverige 2 file stops.txt we have this line


Searching for 740068263 in agency_stops.txt we get


A searching for 64397 in the SL (275) GTFS Regional data yields nothing, but we do have


Which appears to be the "same" stop. So it seems there are two prefixes


and three suffixes


How does this fit together? What do the prefixes and suffixes mean?


  • Hi Alexander,

    These mappings are not mappings between GTFS Sverige 2 and GTFS regional feeds, but mappings between GTFS Sverige 2 and local data.

    In your example, the mapping indicated that SL uses the number 64397 in its own internal systems.

    As you already noticed, this number is also a part of the stop id in GTFS Regional. This is a coincidence, and parsing these GTFS ids is at your own risk, since you then no longer adhere to the spec, but start parsing a random string. Your mileage might vary across operators, even though we try to keep these ids uniform.

    With that said, the GTFS regional file contains one stop area and two stop points belonging to that stop area, as can be seen in the defined stop_type (1 for stop area, 0 for stop point). The stop area is the larger area, while stop points are platforms where you can embark/disembark the vehicle (a typical area along a road will have one stop point at each side of the road).

    I do believe that this local number is mentioned explicitly in our NeTEx data, so that could be a solution if you want to link the GTFS Sverige 2 stops with high quality NeTEx/GTFS regional stops.

    This example is for SJ, but it applies to all operators:

    <StopPlace version="20201208" id="SE:100:StopPlace:9021074000001000">
    <Name>Stockholm Centralstation</Name>
    <ShortName>Sthlm Central</ShortName>

    This privateCode should match the local number present in the GTFS Sverige 2 extra file, so you can map those stops directly.

    Bert på Trafiklab

Kommentera eller skriv ett nytt inlägg

Ditt namn och inlägg kan ses av alla. Din e-post visas aldrig publikt.