Trafiklab Meet-up 20160211: GTFS Johan Nilsson

29
Johan Nilsson Freelancer [email protected]

Transcript of Trafiklab Meet-up 20160211: GTFS Johan Nilsson

Page 1: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

Johan Nilsson

• Freelancer

[email protected]

Page 2: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

STHLM Travelingwww.sthlmtraveling.se

Page 3: Trafiklab Meet-up 20160211: GTFS Johan Nilsson
Page 4: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

GTFS

Page 5: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

Varför• Flexibilitet

• Multi Modal

• Egen drift

• Offline

• Inte bara SL

Page 6: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

Vad är GTFS?eller vad GTFS inte är

Page 7: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

• Ett färdigt API

• En reseplanerare

• Realtid

• Avvikelser

• Vägnät

Page 8: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

https://kundo.se/org/trafiklabse/d/stopp-som-inte-ar-pa-busslinje-finns-kvar-i-gtfs/

Page 9: Trafiklab Meet-up 20160211: GTFS Johan Nilsson
Page 10: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

agency.txt agency_id,agency_name,agency_url,agency_timezone,agency_lang 999,Samtrafiken,http://www.resrobot.se/,Europe/Stockholm,sv !calendar.txt service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date 000001,0,0,0,0,0,0,0,20160112,20161210 !calendar_dates.txt service_id,date,exception_type 000001,20160117,1 !feed_info.txt feed_publisher_name,feed_publisher_url,feed_lang,feed_version Samtrafiken i Sverige AB,http://www.samtrafiken.se,sv,2016-01-12 !routes.txt route_id,agency_id,route_short_name,route_long_name,route_type,route_url 1,277,,Flygbussarna,700,http://www.resrobot.se/ !stop_times.txt trip_id,arrival_time,departure_time,stop_id,stop_sequence,pickup_type,drop_off_type 1,4:05:00,4:05:00,740004046,1,0,1 !stops.txt stop_id,stop_name,stop_lat,stop_lon,location_type 100000831,Tornio linja-autoasema,65.841736,24.143401,0 !transfers.txt from_stop_id,to_stop_id,transfer_type,min_transfer_time,from_trip_id,to_trip_id 740000001,740000622,2,1200,, !trips.txt route_id,service_id,trip_id,trip_headsign,trip_short_name 1,000001,1,Arlanda terminal 2-3 buss,

Page 11: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

Uppdateras ~en gång per dygn

Page 12: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

Tillägg• Ej med i standarden

• Lösningar för specifika tillämpningar som t.ex Google Maps

• Nya fält

• Nya värden till existerande fält

• Tillkommer oftast efter diskussion på gtfs-changes

Page 13: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

GTFS-realtime

• Trip updates

• Service alerts

• Vehicle positions

Page 14: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

route-to-route och trip-to-trip transfersMöjlighet att specificera bytestid för hållplatspar.

Page 15: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

transfers.txtfrom_stop_id to_stop_id transfer_type min_transfer_time

740020101 740020101 2 420

stops.txtstop_id stop_name stop_lat stop_lon location_type

740020101 Slussen T-bana 59.319541 18.072464 0

Page 16: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

stops.txtstop_id stop_name stop_lat stop_lon location_type

740000060 Falköping Centralstation 58.176083 13.553986 0

trips.txtroute_id service_id trip_id trip_headsign trip_short_name

4430 2420 236176 Skövde Centralstation

4430 2205 245558 Göteborg Centralstation

transfers.txtfrom_stop_id to_stop_id transfer_type min_transfer_time from_trip_id to_trip_id

740000060 740000060 2 0 236176 245558

Page 17: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

Reseplanerare?

Page 18: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

GTFS

Gång, cykel & vägnät (OSM)

Höjddata (Lantmäteriet)

Entréer (OSM)

Störningsinformation (Trafiklab)

Utökad GTFS

Page 19: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

GTFS

Gång, cykel & vägnät (OSM)

Höjddata (Lantmäteriet)

Entréer (OSM)

Störningsinformation

Utökad GTFS

Page 20: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

Störningsinformation

• Hämtas från SL, Trafiklab

• Matchas till GTFS

• Exponeras som GTFS-realtime

{ "entity": [{ "alert": { "active_period": [{ "end": 1462078800, "start": 1412785800 }], "description_text": { "translation": [{ "text": "H\u00e5llplats Magasinsv\u00e4gen \u00e4r flyttad till Dalv\u00e4gen" }] }, "effect": 9, "header_text": { "translation": [{ "text": "H\u00e5llplats Magasinsv\u00e4gen flyttad" }] }, "informed_entity": [{ "agency_id": "275", "route_id": "275_502_BLT", "route_type": 3, "stop_id": "7464062" }] }, "id": "41" }], "header": { "gtfs_realtime_version": "1.0", "incrementality": 0, "timestamp": 1455106353 } }

Page 21: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

GTFS

Gång, cykel & vägnät

Höjddata

Entréer (OSM)

Störningsinformation

Utökad GTFS

Page 22: Trafiklab Meet-up 20160211: GTFS Johan Nilsson
Page 23: Trafiklab Meet-up 20160211: GTFS Johan Nilsson
Page 24: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

GTFS

Gång, cykel & vägnät

Höjddata

Entréer (OSM)

Störningsinformation

Utökad GTFS

Page 25: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

Gång, cykel & vägnät

• Basdata från OSM

• Höjddata från Lantmäteriet

• Kombineras till en graf som kan ge svar på restid, instruktioner osv.

Page 26: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

GTFS)

Gång, cykel & vägnät

Höjddata

Entréer

Störningsinformation

Utökad GTFS

Page 27: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

Entréer

• Mappas i OSM

• Hämtas från OSM

• Översätts till GTFS hållplats id

• Översätts till SL site id

Page 28: Trafiklab Meet-up 20160211: GTFS Johan Nilsson

GTFS

Gång, cykel & vägnät

Höjddata

Entréer

Störningsinformation

Utökad GTFS