Skip to content

Instantly share code, notes, and snippets.

We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 20 columns, instead of 5 in line 4.
producer,feed,fetch_time,entity_id,trip_id,route_id,start_timestamp,direction_id,schedule_relationship,current_status,current_stop_id,current_stop_sequence,vp_timestamp,vehicle_id,vehicle_label,consist_length,consist,bearing,latitude,longitude
WMATA Rail,VP,2024-10-19 13:54:45.876978 +00:00,88,6427582_20016,GREEN,2024-10-19 13:54:41.000000 +00:00,1,DUPLICATED,STOPPED_AT,PF_E10_C,1,2024-10-19 13:54:40.000000 +00:00,192,546,6,"{2000,2001,2038,2039,2059,2058}",215,39.01106,-76.91114
WMATA Rail,VP,2024-10-19 13:55:46.064352 +00:00,89,6427582_20016,GREEN,2024-10-19 13:55:43.000000 +00:00,1,DUPLICATED,STOPPED_AT,PF_E10_C,1,2024-10-19 13:55:43.000000 +00:00,192,546,6,"{2000,2001,2038,2039,2059,2058}",215,39.01106,-76.91114
WMATA Rail,VP,2024-10-19 13:56:15.901471 +00:00,66,6427582_20016,GREEN,2024-10-19 13:53:00.000000 +00:00,1,SCHEDULED,IN_TRANSIT_TO,PF_E10_C,1,2024-10-19 13:56:13.000000 +00:00,192,544,6,"{2000,2001,2038,2039,2059,2058}",215,39.01106,-76.91114
WMATA Rail,VP,2024-10-19 13:56:45.993203 +00:00,67,6427
Timetable Code Timetable Name Trackernet Code Trackernet Name ATCO Code NaPTAN Name
ACT Acton Town ACT Acton Town 9400ZZLUACT Acton Town Underground Station
ACW Acton Works
AGR Arnos Grove (& Sidings) AGR Arnos Grove 9400ZZLUASG Arnos Grove Underground Station
ALC Aldgate (to/from Tower Hill) ALD Aldgate 9400ZZLUALD Aldgate Underground Station
ALD Aldgate (to/from Liverpool Street) ALD Aldgate 9400ZZLUALD Aldgate Underground Station
ALE Aldgate East ALE Aldgate East 9400ZZLUADE Aldgate East Underground Station
ALP Alperton ALP Alperton 9400ZZLUALP Alperton Underground Station
AME Amersham AME Amersham 9400ZZLUAMS Amersham Underground Station
ANG Angel ANG Angel 9400ZZLUAGL Angel Underground Station
function visibleTilesLoaded(viewer) {
var layer = viewer.scene().layer();
var geometry = layer.geometry();
var visibleTilesForLevel = function(level) {
return geometry.visibleTiles(viewer.view(), level);
};
var tileHasTexture = function(tile) {
var tile = layer.textureStore().query(tile);
@kurtraschke
kurtraschke / sleep.ps1
Last active March 2, 2016 02:48
PowerShell script to summarize a Windows PC's sleep history
$filter = @{LogName='System';
ProviderName='Microsoft-Windows-Power-Troubleshooter';
ID=1}
$namespaces = @{"event"="http://schemas.microsoft.com/win/2004/08/events/event"}
Get-WinEvent -FilterHashtable $filter | % {
$obj = New-Object PSObject
[xml]$_.ToXml() | Select-Xml -Namespace $namespaces "/event:Event/event:EventData/event:Data" | % {
Tue Jun 30 19:59:55 2015 :$GPZDA,235955.00,30,06,2015,00,00*68
Tue Jun 30 19:59:56 2015 :$GPZDA,235956.00,30,06,2015,00,00*6B
Tue Jun 30 19:59:57 2015 :$GPZDA,235957.00,30,06,2015,00,00*6A
Tue Jun 30 19:59:58 2015 :$GPZDA,235958.00,30,06,2015,00,00*65
Tue Jun 30 19:59:59 2015 :$GPZDA,235959.00,30,06,2015,00,00*64
Tue Jun 30 19:59:59 2015 :$GPZDA,235960.00,30,06,2015,00,00*6E
Tue Jun 30 20:00:00 2015 :$GPZDA,000000.00,01,07,2015,00,00*66
Tue Jun 30 20:00:01 2015 :$GPZDA,000001.00,01,07,2015,00,00*67
Tue Jun 30 20:00:02 2015 :$GPZDA,000002.00,01,07,2015,00,00*64
Tue Jun 30 20:00:03 2015 :$GPZDA,000003.00,01,07,2015,00,00*65
Sort sort = new Sort(_spatialStrategy.makeDistanceValueSource(shape.getCenter()).getSortField(false)).rewrite(_searcher);
@kurtraschke
kurtraschke / README.md
Last active August 29, 2015 14:00
GTFS-realtime test harness for frequency-based trips

GTFS-realtime test harness for frequency-based trips

Introduction

This is a Python-based test harness which can be used to simulate a GTFS-realtime feed with trips on a frequency-based route. Specifically, it simulates arrivals on the AirBART route (obtain BART GTFS here), at the AirBART_OAK stop. For convenience, the script simulates two vehicles, which are perpetually three and seven minutes away, respectively.

Setup

{
"currentTime": 1391381290937,
"text": "OK",
"data": {
"instanceDetails": [
{
"contactEmail": "onebusaway@kurt-p7-1539",
"instanceName": "OneBusAway on kurt-p7-1539",
"twitterUrl": "",
"language": "en-US",
@kurtraschke
kurtraschke / cap.xjb
Created November 11, 2013 01:47
JAXB bindings file for CAP schema to produce enums from anonymous types.
<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
jaxb:version="1.0">
<jaxb:bindings schemaLocation="CAP-v1.2.xsd" node="/xsd:schema">
<jaxb:bindings node="//xsd:element[@name='status']">
<jaxb:bindings node="./xsd:simpleType">
<jaxb:typesafeEnumClass name="StatusType" />
Recently (as in, over the past few months) the WMATA BusPosition feed has been behaving anomalously.
There are three observed problems:
1. The feed doesn't include the entire fleet - during the weekday rush hour we'd expect to see close to 900 buses, but this morning the feed returned fewer than 250 vehicles.
2. Bus positions return the wrong trip, or are lagging badly. Look at this example:
<BusPosition>
<DateTime>2013-08-16T07:32:01</DateTime>