Snips

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.

GeoPosition

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;
}
index++;
}

return level;
}

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

VMS Finally

The VMS (Variable Message Sign) data is finally up and working. I had to filter the data heavily to avoid sign overload. Basically what is shown is every ‘unique’ message for each road and lane. This is to avoid displaying the same message all the way up and down the motorway.

Some of the icons for the BBC data now reflect their ‘type’. Interesting to note the majority of the data is roadworks. Whether these are the same as the QMISS data I haven’t checked.

The site has been moved to my ISP’s new cgi server. This was fairly painless. I don’t know when they will yank the old machine out but I am hoping to have moved this blog as well by then.

You will notice the new scale control on the bottom left corner as well. Neat.

Future Developments

There has been little changes to the site since last week because I have been working furiously to try and map the QMISS Midas speed sensor data on the the map. This _still_ isn’t in a useful state but I have developed the filtering code which should let me finally plot the VMS motorway sign settings.

I am unhappy with the regional menu implementation and i have decided that the user should be presented with some sort of data when they enter the page initally. This will take the form of the most recent 50 entries or something like that. Anything but a blank map. The user can then choose regional traffic, regional transport from the pull down menu of datasets.

I have been kicking myself since seeing this. Why didn’t I find these when I went searching for traffic cams? There are some cameras in Belfast but they are unusable in this context. Nicely done anyway.

Regional Data Update

I have rushed through the collection and processing of the regional traffic and public transport data partly because I thought it might prove useful and also because I am going away this weekend and will not have time to put any work into it. Alas the upshot is that there appears to be a bug in the code which generates the regional data master lists. Looking at it last night I had a feeling that the total traffic message count didn’t tally with what the panel displayed but it was late and I was tired. The data is updated hourly so you might see you favourite region come and go accordingly. At least it’s is better that nothing which is basically what was displayed before.

The design for navigating the regional data can only be described as ‘clunky’. Interesting how the inclusion of a ‘back’ button utterly destroys the AJAX notion of the web page as an application. It looks terrible and is a pain to use but was worth trying out as it has made me think more about what is really needed.

I might get a chance to do a quick fix before I leave this evening if I can spot what’s wrong with my increasingly sprawling Python code.

Frozen Events

Looks like the bbc have discontinued or altered the updating mechanism of the traffic and transport tpeg xml feeds. This is why there are still events hanging around from Jun 30th on the map. I guess I will have to do what I have been meaning to for ages and process the data on a region by region basis. These regional feeds seem to be kept up to date.

Have been playing around with GPolyline from the Google Maps API. Something may yet come of this.

Site Update to new API

Site has been updated to use new Google Map API. There are a few things which don’t seem to work very well but I guess it’s early days. My attempt to set the zoom level from the span of points is a bit rubbish but it works well enough for a first stab. The other thing you might notice is that resizing the browser view doesn’t resize the map to fit into it’s IFrame. This is annoying in that you can then click on events which are not drawn inside the map window anymore.

Anyway, annoyances aside the satellite view option is good fun and you might get a laugh (as I have mentioned previously) from my attempts to match camera icons to the roads.

I still can’t get the damn thing to fit inside IE and the side panel occasionaly doesn’t seem to load correctly.