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

SL internal ids

SL Travel Planner API works with internal ids/ external ids.. The GTFS files that we receive from SL- they don't seem to have these ids. Is there any way to get those ids from their GTFS Regional data?

Kommentarer

  • Hi,

    There is no officially supported way to connect the GTFS Regional files to the SL APIs. A mapping between SLs local ids and GTFS Sverige 2 national ids exists (https://api.trafiklab.se/v2/samtrafiken/gtfs/extra/agency_stops_275.txt) but this mapping is not compatible with the GTFS Regional feeds.

    SL's GTFS Regional data comes directly from SL, so the names, coordinates should be an exact match with SLs stops and lines API, that way you could match SLs internal ids with GTFS Regional data.

    Alternatively, our NeTEx regional data does contain the internal id for each operator under privateCode. I included a snippet so you can match this with the internal IDs.

    <StopPlace version="20120623" id="SE:001:StopPlace:9021001070004000">
    <ValidBetween>
    <FromDate>2012-06-23T00:00:00</FromDate>
    </ValidBetween>
    <Name>Alhagsvägen</Name>
    <ShortName>Alhagsvägen</ShortName>
    <PrivateCode>70004</PrivateCode>
    <Centroid>
    <Location>
    <Longitude>17.851566</Longitude>
    <Latitude>59.234952</Latitude>
    </Location>
    </Centroid>
    <OrganisationRef ref="SE:001:Authority:9010001000000000"/>
    <TransportMode>bus</TransportMode>
    <StopPlaceType>busStation</StopPlaceType>
    <Weighting>interchangeAllowed</Weighting>
    <quays>
    <Quay version="20140603" id="SE:001:Quay:9022001070004001">
    <ValidBetween>
    <FromDate>2014-06-03T00:00:00</FromDate>
    </ValidBetween>
    <Name>Alhagsvägen</Name>
    <ShortName>Alhagsvägen</ShortName>
    <PrivateCode>1</PrivateCode>
    <Centroid>
    <Location>
    <Longitude>17.851514</Longitude>
    <Latitude>59.235106</Latitude>
    </Location>
    </Centroid>
    </Quay>
    <Quay version="20140603" id="SE:001:Quay:9022001070004002">
    <ValidBetween>
    <FromDate>2014-06-03T00:00:00</FromDate>
    </ValidBetween>
    <Name>Alhagsvägen</Name>
    <ShortName>Alhagsvägen</ShortName>
    <PrivateCode>2</PrivateCode>
    <Centroid>
    <Location>
    <Longitude>17.851618</Longitude>
    <Latitude>59.234799</Latitude>
    </Location>
    </Centroid>
    </Quay>
    </quays>
    </StopPlace>

    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.