a a a

Ühistranspordi info

Ühistranspordi info
Tallinna ja Harjumaa ühistranspordi peatuste numbrid ja nimekiri, asukohad ja sõiduplaanid

Real-time departure times (example: for three stops named Kalev as displayed on http://m.transport.tallinn.ee/#stop/07401-1,07402-1,07403-1 ) are available from address:
http://m.transport.tallinn.ee/siri-stop-departures.php?stopid=1079,1080,1081

 

Example of real-time departures data in Tallinn:

Request:

http://transport.tallinn.ee/siri-stop-departures.php?stopid=1079,1080,1081&time=1390219197288

The time parameter is used only to make URL unique for each request and so prevent browser from caching the request results. Otherwise the browser may return cached old results when you ask departures for the same stop later.

 

You may use any value for time parameter that is unique, e.g. date and time with seconds or UNIX time (seconds from 1970-01-01).

Result:

Transport,RouteNum,ExpectedTimeInSeconds,ScheduleTimeInSeconds

stop,1079

bus,36,50580,50580,Viru

bus,5,51013,51013,Metsakooli

bus,18,51174,51174,Viru keskus

bus,32,51240,51240,Kopli

bus,36,51240,51240,Viru

bus,5,51733,51733,Metsakooli

bus,36,51960,51960,Viru

...

 

Note: SiriID values from http://transport.tallinn.ee/data/stops.txt should be used to specify stops for that request.


Short description of data format used in stops.txt and routes.txt files

The file http://transport.tallinn.ee/data/stops.txt contains the data about all stops.
First row indicates column names
ID;Lat;Lng;Stops;Name;Info;Street;Area;City and version of program.
Note, that we might add additional fields in the future, so use column
names to find position of field you need.

Each line in the file has data fields for one stop: stopID, siriID, GPS coordinates Latitude and Longitude multiplied by 10000, stop name, ids of closest stops for walking, remark, street, area, fare zone, city.
Field values that are equal to values in previous line are removed to reduce file size. So you have to refill the values when processing the file.

The routes.txt file contains the data about all routes and timetables of each route. First row in the file indicates field names. Then one row has fields for route data, the next row has encoded timetable of that route. E.g. lines 3, 5, 7, ... in the file contain routes timetables in encoded format.
Route field values that are equal to values of previous route are removed to reduce file size.

Decoding route timetable:
,, indicates end of row in the timetable. Values in first row are start times of trips (columns) in minutes, values in second row are dates, values in third row are weekdays, values in all next rows are driving times in minutes to next stop in the trip. Use the page http://transport.tallinn.ee/decode.html to test the decoding of values into timetable. Look at the source code of this page. The decoding function is named explodeTimes(encoded_data)

GTFS, ZIP
täna

Tagasi nimekirja

Kõik õigused kaitstud © 2018 Tallinn