1. First Mapumental-powered property travel time maps go live

    We’re delighted to announce that leading London estate agent Foxtons has become the first property player to use Mapumental maps on its website. Visitors to Foxtons.co.uk will now see that every property listed includes a travel time map, highlighted in Foxtons’ brand colours.

    Foxtons, whose website just won an award for Best Interface Design at the 2011 International Business Awards, were quick to see the value of travel time maps for house-hunters. Thousands of listings now display a simple, beautiful, map showing how long a commute to work or visit to friends will take on public transport – vital pieces of information to consider when looking for a new home.

    The property sector is not the only area of business that stands to benefit from Mapumental’s ground-breaking mapping technology. Mapumental is already talking to major players in the travel industry and recruitment sectors.  Virtually any business that needs to show users how much time it takes to travel to or from a given spot will find these maps very valuable.

    One of Mapumental’s core strengths is its  flexibility when it comes to volume – it can provide anything from a single map at a great price to tens of thousands at a significant volume discount.

    The service utilises travel-time mapping technology developed by mySociety, drawing journey data from the NPTDR dataset. The same data also drives mySociety’s newest project FixMyTransport.com, which launched just last week, and covers all modes of public transport within GB.

    For the maps service, our algorithm calculates journey times from any given point (postcode or latitude and longitude) to every other point in Great Britain. These journey times are displayed as a heatmap, on a background from OpenStreetMap.

    Foxtons has made use of the new Mapumental API which enables clients to define the maps’ appearance precisely according to their company preferences. Parameters for choice include:

    • maximum travel time
    • number of time bands to show
    • colour scheme
    • the direction of travel (to or from the chosen location)
    • target arrival or departure time
    • other information (such as title and legend) that goes on the map.

    The image is then automatically created and can be published on a website and/or included in printed materials. Website owners can publish the maps themselves, or we can create bespoke integration solutions for them..

    To find out more about how Mapumental might work for you, please drop us a line.

    Here are some samples of our maps:

    Travel times from a residential development in Sevenoaks, departing at 7am

    Travel times from St Pancras Reneissance Hotel, departing at 8am

    Travel times to reach Cardiff University by 10am

  2. FixMyTransport: the praise button

    Bus Stop by Yi-tao 'Timo' Lee used with thanks under the Creative Commons licence

    Just like the famous Yellow Pages ad, FixMyTransport is not only there for the nasty things in life.

    Quite late in FixMyTransport’s development, we realised that praise is a form of feedback and that this channel ought to be open to our users, too – that’s why on every page for a stop or a route, you’ll see a stonking great button inviting you to ‘say something nice’ – here’s an example: a station manager giving the type of good service that gladdens the heart.

    There’s also a little love for Pulborough station, nice words for Brighton’s well-informed station staff, an example of a very accommodating bus driver, and a comment that makes me want to take the 37 bus to Clapham Junction right now.

    We haven’t really stressed this side of FixMyTransport, so we’re really glad to see people finding it for themselves and putting it to good use. If you encounter particularly excellent service on your next journey, and you want to spread the love too, just remember the big blue button. We’re sure the operators will be very glad to hear from you.

  3. FixMyTransport: Day 1

    FixMyTransport launches

    So. Yesterday we officially launched FixMyTransport, a site that has been in ‘quiet beta’ for a few weeks. Not such a big event, you might think – after all, the site has been open for public use; the only difference was that we were announcing it.

    I think we’ve all been gratifyingly taken aback by just how much use the site has seen in the last 24 hours. Thanks to mentions in some of the mainstream press, but equally because of a veritable outpouring of tweets and retweets, word spread quickly. We experienced a 550% rise in visitor numbers (the servers took it in their stride, we are glad to say). Over the course of the day, the number of reports on the site doubled, with more than 70 totally new campaigns being created and many more problems being sent to operators. With each report came more tweets, more blog posts and more users signing up to campaigns.

    We’re seeing the idea we worked on become a reality, and that’s both exciting and full of surprises. We knew what we would use such a site for, but we had no idea which issues would most motivate our users (at the latest reckoning, it’s poor air conditioning, delays, and, above all, a lack of decent information).

    If you haven’t had a chance to see what FixMyTransport is all about yet, take a look at some of these examples:

    Many of these examples see users (not just the operators, but ordinary people) who know a lot more than we do about public transport in this country weighing in with useful insights, which is fantastic.

    Don’t forget you can search your local region for reports. If you find one you agree with, lending your support is as easy as clicking a single button, and then spreading the word with a tweet, a Facebook status or however you see fit.

    Excuse the puns – they are hard to avoid – but we have the sense that we’re at the beginning of a very exciting journey here. And we’re sure we’re going to enjoy the ride. Thanks to everyone who’s come on board so far.

  4. FixMyTransport launches – mySociety’s biggest project since 2008

    Everyone at mySociety is quite bubbling with excitement at the news that we’re today officially launching FixMyTransport.com , mySociety’s first new core charitable website since WhatDoTheyKnow launched in 2008. We’ve never before launched a site that took so much work to build, or that contained so much data.

    What is it for?

    FixMyTransport has two goals – one in your face, and the other more subtle.

    The first goal, as the site’s name suggests, is to help people get common public transport problems resolved. We’re talking broken ticket machines, gates that should be open and stations without stair-free access. We’ll help by dramatically lowering the barrier to working out who’s responsible, and getting a problem report sent to them – a task that would have been impossible without the help of volunteers who gathered a huge number of operator email addresses for us. Consequently the service works everywhere in Great Britain, our database has over 300,000 stops and routes for train, tube, tram, bus, coach and ferry.

    The second goal – the subtle one – is to see if it is possible to use the internet to coax non-activist, non-political people into their first taste of micro-activism. Whilst the site intentionally doesn’t contain any language about campaigning or democracy, we encourage and provide tools to facilitate the gathering of supporters, the emailing of local media, the posting of photos of problems, and the general application of pressure where it is needed. We also make problem reports and correspondence between operators and users public, which we have frequently seen create positive pressure when used on sister sites FixMyStreet and WhatDoTheyKnow.

    Who made it?

    FixMyTransport was largely built by one remarkable coder – Louise Crow, who started as a volunteer and who is now one of our longest serving core developers. She spent 18 months coding the site almost entirely by herself, wrestling with truly tortuous data problems and collaborating with Birmingham’s fantastic SuperCool design to make it look lovely (you should hire them, they’re great).  She also tolerated my ‘aspirational scattergun’ school of project management with remarkable good humour. She really is the king of transport coding.

    Credit must also go to mySociety core dev Dave Whiteland, who made the Facebook integration work, despite not having an account himself!

    Why is it dedicated to Angie Martin?

    Angie Martin was a mySociety coder for an all-too-brief period before she succumbed to cancer at a devastatingly early age. We’re dedicating this site to her in remembrance of a great, self taught perl monger who should still be here.

    We’ll be posting further blog posts about the development process, the data challenges, and the overall project philosophy. In the mean time, please keep arms and legs inside the carriage – FixMyTransport is just about to depart.

  5. Mobile operators altering (and breaking) web content

    We had a complaint that FixMyStreet maps weren’t displaying on someone’s computer. We hadn’t had any other complaints, and we quickly narrowed it down to the fact that the person was on the internet using a tethered T-Mobile phone.

    T-Mobile (and Orange, and quite possibly others) are injecting JavaScript and altering content served over their networks. Their reason for doing this, according to their websites (T-Mobile, Orange), is to compress images and video sent to your browser, so as to speed up your browsing. Seeing it in action, they also inline some CSS and JavaScript, though not all, and remove comments from external files.

    However, their implementation breaks things. In this particular instance, the T-Mobile JavaScript comment stripper appears to be searching for “/*” and “*/” and removing everything inbetween. This might work in most cases; however in the jQuery library, we find a string containing “*/*”, and later down the file, another string containing “*/*”. T-Mobile remove everything between the things it thinks are comment markers, even though they’re actually contained within strings, causing the jQuery library to be invalid JavaScript and stopping anything using jQuery from running.

    Their decision to inline lots of the CSS also seems a bit odd – sure, on a mobile this might be quicker, but even ignoring tethering nowadays plenty of mobiles have caches too and having the CSS download once and be cached would seem better than adding weight to every page download. But I’m sure they’ve studied their decision there, and it doesn’t make any difference to the actual browsing, as opposed to the comment removal.

    To turn off this feature on your mobile phone or broadband, visit accelerator.t-mobile.co.uk or accelerator.orange.co.uk on your connection and pick the relevant option – if anyone knows of similar on other networks, do leave updates in the comments.

    From a FixMyStreet point of view – whilst FixMyStreet functions just fine without JavaScript, I had made the (perhaps incorrect) decision to put the map inside a <noscript> element, to prevent a flash of map-oddity as the JavaScript map overlaid the non-JS one. However, this meant in this circumstance the map did not work, as JavaScript was enabled, but jQuery was unable to be loaded. I haven’t decided whether to change this behaviour yet; obviously it would help people in this situation as the map would still display and function as it does for all those without JavaScript, but for those with JavaScript it does look a bit jarring as the page loads. Any suggestions on a better approach welcome :)

  6. August pub meet

    The Counting House, Cornhill, London

    Thanks everyone who’s turned up so far for a drink and a chat at our monthly pub meets. The next one is on Wednesday the 17th, again at the Counting House pub. You are invited!

    If you’d like to tweet about the night, or put photos on Instagram or Flickr, you can use the hashtag #mysocial.

    7.30, Wednesday 17th August at the Counting House
    50 Cornhill
    London
    EC3V 3PD

    Map here. The nearest Underground stations are Monument and Bank.

  7. What we learned from ePetitions

    New Government e-petitions site

    Back in November 2006 we launched Number 10’s petitions website. We were pretty proud of the usability-centred site we built – we can still lay a pretty good claim to it being one of the biggest democracy sites (measured in terms of people transacting) that the world’s ever seen.

    Over 12 million signatures had been added to petitions by the time the site was switched off after the 2010 general election. We were particularly proud of developing a system that was highly load-tolerant: we once survived over 20,000 people signing within a single hour, all whilst running on a pair of cheap little servers. That performance on so little hardware was down to the raw brilliance represented by a coding team made up of Francis Irving, Matthew Somerville, and the late, great Chris Lightfoot.

    We’re also pleased that the popularity of the site led to the irresistible rise of the belief that the public should be able to petition the government via the internet. So even though our site was mothballed, Parliament and DirectGov have taken over the idea, and the commitment has been upped a notch, from ‘we’ll send a reply’ to ‘we’ll talk about it’. To be clear, we are not, nor have ever been a community interested in replacing representative democracy with direct democracy, but anything that can squeeze any drop of change from Parliament is worth a small celebration.

    What’s most pleasing, though, is that we’ve been able to take the open source code built for Number 10, improve and expand upon it to develop a hosted petitions service for local councils around the country, or the rest of the world. And this is where we found the most important lesson for us: local petitions can be awesome, and despite the much smaller numbers of signatories involved, we’ve been more widely and frequently impressed by local petitions and responses than at the more glamorous national level. We’re particular fans of Hounslow Borough Council who have given positive and detailed feedback on all sorts of genuine local issues, as well as working hard to let local residents know that the service exists.

    Just recently we launched a site to make it really easy to find local council petition websites, because there are hundreds hidden away (we built some; most are supplied by other vendors). If we could see anything result from today’s huge explosion of interest in online petitions, it would be that people might start to look local, and explore what petitions in their community could mean.

  8. New, simple MP vote analyses on TheyWorkForYou

    "12am time to vote" by European Parliament on Flickr. Used with thanks under the Creative Commons licence. Click through to see the photo on Flickr.

    If you’ve visited our parliamentary site TheyWorkForYou.com, you’ll have noticed that on each MP’s page there is a short summary of his or her voting record on various key issues.

    These issues have always been carefully chosen to give a simple but neutral top-line view of each MP’s voting activity. Judging by Twitter, they’re a fairly popular part of the site, too.

    There’s way, way more tedious complexity behind producing these little summaries than you might think, and due to a lack of appropriately skilled people in our team over the last year we had let our vote analyses get a bit behind the times. If you’re really interested you can read about why authoring these things in such a scrupulously balanced way is so time consuming here.

    We’re posting today to tell you that we have recruited a pair of excellent new part-time voting analysts, David and Ambreen, and they have recently produced the first of a new generation of voting summaries.

    The first shows how each MP has voted on increasing the rate of VAT, and second on the recent changes to university tuition fees. We have also increased the number of votes which feed into the EU integration policy to bring it more up to date.

    To see this new data, just pop along to TheyWorkForYou’s home page, stick in your postcode, and check out your own MPs’ page. Then, if you want to be made aware as soon as we’ve published the next analyses, please follow our new TheyWorkForYou Twitter account.

    Lastly, I just want to say thank you to the vote analysts Ambreen and David, to senior developer Matthew and to uber-volunteer Richard Taylor for kicking this vital part of TheyWorkForYou back into top gear.

    Image by European Parliament.

  9. Further adventures in conviviality

    The Counting House, Cornhill, London

    Last month’s pubmeet was fun, but it was rather crowded, so we’re moving venues. This month, our chosen pub is the Counting House, which is cavernous as well as rather beautiful. Please do join us for a drink, to ask questions or suggest new ideas – or just for a chat.

    If you’d like to tweet about the night, or put photos on Instagram or Flickr, you can use the hashtag #mysocial to make sure that others find ‘em.

    7.30, Wednesday 20th July at the Counting House
    50 Cornhill
    London
    EC3V 3PD

    Map here. The nearest Underground stations are Monument and Bank.

  10. Technical look at the new FixMyStreet maps

    This post explains how various aspects of the new FixMyStreet maps work, including how we supply our own OS StreetView tile server and how the maps work without JavaScript.

    Progressive enhancement

    During our work on FiksGataMi (the Norwegian version of FixMyStreet) with NUUG, we factored out the map code (for the Perlmongers among you, it’s now using Module::Pluggable to pick the required map) as FiksGataMi was going to be using OpenStreetMap, and we had plans to improve our own mapping too. Moving to OpenLayers rather than continuing to use our own slippy map JavaScript dating from 2006 was an obvious decision for FiksGataMi (and then FixMyStreet), but FixMyStreet maps have always been usable without JavaScript, utilising the ancient HTML technology of image maps to provide the same functionality, and we wanted to maintain that level of universality with OpenLayers. Thankfully, this isn’t hard to do – simply outputting the relevant tiles and pins as part of the HTML, allowing latitude/longitude/zoom to be passed as query parameters, and a bit of maths to convert image map tile clicks to the actual latitude/longitude selected. So if you’re on a slow connection, or for whatever reason don’t get the OpenLayers JavaScript in some way, the maps on FixMyStreet should still work fine. I’m not really aware of many people who use OpenLayers that do this (or indeed any JavaScript mapping API), and I hope to encourage more to do so by this example.

    Zooming

    We investigated many different maps, and as I wrote in my previous blog post, we decided upon a combination of OS StreetView and Bing Maps’ OS layer as the best solution for the site. The specific OpenLayers code for this (which you can see in map-bing-ol.js is not complicated (as long as you don’t leave in superfluous commas breaking the site in IE6!) – overriding the getURL function and returning appropriate tile URLs based upon the zoom level. OpenLayers 2.11 (due out soon) will make using Bing tiles even easier, with its own seamless handling of them, as opposed to my slight bodge with regard to attribution (I’m displaying all the relevant copyright statements, rather than just the one for the appropriate location and zoom level which the new OpenLayers will do for you). I also had to tweak bits of the OpenLayers map initialisation so that I could restrict the zoom levels of the reporting map, something which again I believe is made easier in 2.11.

    OpenStreetMap

    Having pluggable maps makes it easy to change them if necessary – and it also means that for those who wish to use it, we can provide an OpenStreetMap version of FixMyStreet. This works by noticing the hostname and overriding the map class being asked for; everything necessary to the map handling is contained within the module, so the rest of the site can just carry on without realising anything is different.

    OS StreetView tile server

    Things started to get a bit tricky when it came to being ready for production. In development, I had been using http://os.openstreetmap.org/ (a service hosted on OpenStreetMap’s development server) as my StreetView tile server, but I did not feel that I could use it for the live site – OpenStreetMap rightly make no reliability claims for it, it has a few rendering issues, and we would probably be having quite a bit of traffic which was not really fair to pass on to the service. I wanted my own version that I had control over, but then had a sinking feeling that I’d have to wait a month for something to process all the OS TIFF files (each one a 5km square) into millions and millions of PNG tiles. But after many diversions and dead ends, and with thanks to a variety of helpful web pages and people (Andrew Larcombe’s guide [dead link removed] to his similar install was helpful), I came up with the following working on-demand set-up, with no pre-seeding necessary, which I’m documenting in case it might be useful to someone else.

    Requests come in to our tile server at tilma.mysociety.org, in standard OSM/Google tile URL format (e.g. http://tilma.mysociety.org/sv/16/32422/21504.png. Apache passes them on to TileCache, which is set up to cache as GoogleDisk (ie. in the same format as the URLs) and to pass on queries as WMS internally to MapServer using this layer:

    [sv]
    type=WMS
    url=path/to/mapserv.fcgi?map=os.map&
    layers=streetview
    tms_type=google
    spherical_mercator=true

    MapServer is set up with a Shapefile (generated by gdaltindex) pointing at the OS source TIFF and TFW files, meaning it can map tile requests to the relevant bits of the TIFF files quickly and return the correct tile (view MapServer’s configuration – our tileserver is so old, this is still in CVS). The OUTPUTFORMAT section at the top is to make sure the tiles returned are anti-aliased (at one point, I thought I had a choice between waiting for tiles to be prerendered anti-aliased, or going live with working but jaggedy tiles – thankfully I persevered until it all worked :) ).

    Other benefits of OpenLayers

    As you drag the map around, you want the pins to update – the original OpenLayers code I wrote used the Markers layer to display the pins, which has the benefit of being simple, but doesn’t fit in with the more advanced OpenLayers concepts. Once this was switched to a Vector layer, it now has access to the BBOX strategy, which just needs a URL that can take in a bounding box and return the relevant data. I created a subclass of OpenLayers.Format.JSON, so that the server can return data for the left hand text columns, as well as the relevant pins for the map itself.

    Lastly, using OpenLayers made adding KML overlays for wards trivial and made those pages of the site much nicer. The code for displaying an area from MaPit is as follows:

        if ( fixmystreet.area ) {
            var area = new OpenLayers.Layer.Vector("KML", {
                strategies: [ new OpenLayers.Strategy.Fixed() ],
                protocol: new OpenLayers.Protocol.HTTP({
                    url: "/mapit/area/" + fixmystreet.area + ".kml?simplify_tolerance=0.0001",
                    format: new OpenLayers.Format.KML()
                })
            });
            fixmystreet.map.addLayer(area);
            area.events.register('loadend', null, function(a,b,c) {
                var bounds = area.getDataExtent();
                if (bounds) { fixmystreet.map.zoomToExtent( bounds ); }
            });
        }

    Note that also shows a new feature of MaPit – being able to ask for a simplified KML file, which will be smaller and quicker (though of course less accurate) than the full boundary.