TPEG Parser Update

I have finally this evening got the tpeg DOM parser working correctly. This has taken an inordinately long time to figure out mostly due to the limitations of the minidom python module. I have had to resort to the inelegant solution of parsing the XML entity file first and then doing a string replace on the contents of the target file to get things like ‘severity’ resolved.

There is no point submitting this to the BBC backstage site unless I include some real examples so I am now working on this. I have put together a simple RSS 2.o example and I think I should put some sort of html table thing together as well. This should form enough examples for anyone with enough Python skills to ‘roll their own’.

My hope is that others might use this to embed the BBC traffic data into their own projects.


A second person on stumbleupon has mentioned that gTraffic doesn’t work on Firefox. I am starting to get worried. What is it that they are seeing? It works perfectly for me!

Going to fix IE colour problem today, I promise.

Microsoft Local Live

I see Microsoft have finally got their act together and added the UK street and road info to their map control.

I had a look at Microsoft Earth when it was launched and was quite impressed (especially since they were playing catch up to Google). I am toying with the idea of developing a gTraffic site which lets you switch between the two map types.

The yahoo map here is also mighty impressive.


The QMISS VMS xml feed is down. Let’s hope it’s back up tomorrow.

Still looking into a radical redesign of the site. If anyone has any ideas then I would love to hear them. Email me at


Barry Hunter over at the Google API discussion list has pointed that my conversion routine is not wholly accurate. I am only converting OSGB “grid refs” not the full OSGB36 to latitude and longitude.

If I ever get time I will use the OS spreadsheet calcs to implement a full conversion.

I thought I might get a mention at the Open Tech conference since I use the bbc travel feed info but no such luck.


I have posted up a link (look under the ‘Pages’ heading) to a javascript class I have written called GeoPosition. This will convert coordinates between OSGR and WGS84 formats. WGS84 is the format google maps uses to plot points.

Here you are.

Code fix – The function calculateZoomLevel will now set the zoom level correctly to the bounding box of the dataset points. Thanks DaveP.

function calculateZoomLevel(spanLng, spanLat)
var level = _zoomLevelsX.length-1;
var found = false;
var index = 0;

while (!found && index<_zoomlevelsx .length) { if (_zoomLevelsX[index]>spanLng && _zoomLevelsY[index]>spanLat)
level = index;
found = true;

return level;

The zoomLevelsX and Y arrays hold the span values for each of the zoom levels.