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

740068263,Skogshill,60.003969,18.787991,

Searching for 740068263 in agency_stops.txt we get

275,740068263,64397

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

9021001064397000,Skogshill,60.003972,18.788009,1,,
9022001064397001,Skogshill,60.003985,18.788028,0,9021001064397000,
9022001064397002,Skogshill,60.003959,18.787990,0,9021001064397000,

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

90210010
90220010

and three suffixes

000
001
002

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

Kommentarer

  • 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>
    <PrivateCode>1</PrivateCode>

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

    Regards,
    Bert
    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.