-
Notifications
You must be signed in to change notification settings - Fork 13
HRT Transit Feed Data Dictionary
hrtrtf.txt is a posted dump of the TrapezeITS Transit Master SpySocket.log file.
This documents the fields being served up at: ftp://216.54.15.3/Anrd/hrtrtf.txt
Time,Date,Vehicle,Lat/Lon,Location Valid/Invalid,Adherence,Adherence Valid/Invalid[,Route,Direction,Stop]
17:55:04,02/23,1801,368582254/-763032499,V,-5,V
17:55:05,02/23,4021,368646357/-762826028,V,0,I
17:55:05,02/23,1707,367919520/-760810356,V,-1,V
17:55:05,02/23,2036,370735567/-764265641,V,-2,V
17:55:05,02/23,1809,369057127/-761784001,V,3,V
17:55:06,02/23,4026,368535552/-761931440,V,-5,V,25,2,1302
- The file is posted once per minute.
- The feed contains two types of records: location and time point crossing.
- Location has seven (7) fields: Time, Date, Vehicle, Lat/Lon, Location Valid/Invalid, Adherence, Adherence Valid/Invalid
- Time point crossing has ten (10) fields. The first seven fields are the same as location. The three additional fields are: Route, Direction, and Stop.
- The last line of the file may be incomplete. This is because the SpySocket.log file is locked open by the Transit Master Client.
- Time
- The time in HH:MM:SS format, GMT-5 time zone, of each record
- Example:
13:26:07
- Date
- The date in MM/DD format of each record
- Example:
06/20
- Vehicle
- The 4-digit identifier of the bus
- Example:
2050
- Lat/Lon
- The un-formatted location of the bus. This value must be reformatted. Given the size of our area you can assume the decimal belongs 7 digits from the right.
- Example:
370300875/-763627785
- Location Valid/Invalid
- Occasionally buses are not visible to GPS when they report. This field indicates whether or not the reported location is correct.
- Adherence
- Indicates whether the bus is on time, early, or late in minutes
- Example:
-1
(the bus is 1 minute behind schedule) - Example:
0
(the bus is on time) - Example:
2
(the bus is 2 minutes ahead of schedule)
- Adherence Valid/Invalid
- Occasionally the on board unit cannot obtain the scheduling data due to interrupted communications. This field indicates whether or not the reported adherence is correct.
- Route
- The unique identifier of the route on which the vehicle is traveling. Values match routes reported through GTFS
- Direction
- Tells whether the bus inbound or outbound relative to a garage.
- Example:
1
(outbound) - Example:
2
(inbound)
- Stop
- Standard GTFS stop ID.
- FAQ
- Q: Why are some of the rows different?
- A: We are constrained by what the the SpySocket.log can provide. In order to get all the information we need we log two data sets: location and time point crossing.
HRVA Civic Hackfest Kickoff - March 2, 2012
Against all odds, Hampton Roads Transit went out of its way to publish real time bus data on the web for public use. Our challenge is to create mobile and web apps that answer the questions “where’s my bus?” and “when will my bus be here?” using this data. HRT publishes other useful information for riders that is not optimized for the web or mobile phones. Ever try to look at a route map on a smart phone? Forget about using a text & voice only phone. Let’s change the status quo. By improving access to and usability of HRT’s data we can make the transit system work better for everyone; riders, administrators, and taxpayers. Win. Win. Win.
HRT uses TrapezeITS TransitMaster version 25. There is a client app called Client Monitor. Client Monitor has a feature to write out its data to a log file called SpySocket.log. We enabled logging and chose the location and time point crossing reports to log. That log file is transformed in order comma separate, and to normalize internal route & vehicle identifiers. The log is written every minute. The transformer runs when the file changes. The transformed file is posted to a public FTP site as a text file. A bug in the Client Monitor software prevents us from capping the maximum size of the SpySocket.log. For this reason we have to monitor the file's size and occasionally shut down the process to clear out the data.