Sunday, November 13, 2016

How far to the nearest bus stop?

One question that occurred to me when I attended the Rebooting the City Deal meeting was how dense the coverage of a public transport system needs to be to make it useful.

I've seen several statements along the lines of x% of Cambridge being within a 7-minute (or whatever) walk to a bus stop. But what is a reasonable walking distance?

I don't know, but I have a little data. OK, 2 data points. Where I live I have a choice of 2 bus stops. One is about 300m away, or 4 minutes. The other is about 500m with a slightly tricky crossing, or about 7 minutes. I would have no issues using the closer stop on a regular basis; the more distant one I'm not terribly happy with.

So, if we want to encourage large-scale use of public transport, I would say we want to aim for something close to the 300m mark. How does this relate to the actual distribution of distances in Cambridge?

I looked at OpenStreetMap. They have all the buildings, and bus stops. And it's open, so I can get at the data.

The good folks at BBBike make a bunch of exports of OSM data available. This includes the city of Cambridge, which is naturally convenient. I grabbed the main osm file.

It's in XML format, which is a little unfortunate. I then used osmfilter to reduce the data to more manageable proportions.

First, I want the locations of all the bus stops. Just the nodes, no relations or ways or dependencies. The bus stops have highway=bus_stop so the following filter command should do it:

./osmfilter Cambridge.osm --keep="highway=bus_stop" --drop-ways --drop-relations --ignore-dependencies

Getting the list of places (where place is somewhere a user may use as a starting point or destination) was a bit trickier. In the end I made the assumption that everywhere of interest would have a postcode. It's not quite true, but I'm just interested in the distribution here so it will do as a first approximation. That gives me a filter command like:

./osmfilter Cambridge.osm --keep="addr:postcode=" --drop-ways --drop-relations --ignore-dependencies

The format of the XML is quite simple, it splits things up nicely onto separate lines. This makes it very easy to use basic Unix tools like grep and awk to pick out the lines that have latitude and longitude on them which gives me lists of coordinates.

I then put together a very cheap and cheerful Java program to read the files of coordinates and calculate the distances between all of them, using a simple equirectangular approximation as described here. The first run of ~10000 places and ~1000 bus stops took less than half a second to print the distance to the nearest bus stop, so I wasn't going to optimize it any further.

The most immediate question can then be answered - what is the distribution of distances to the nearest bus stop? A quick hack using the dist prefab in ploticus and I get the following graph:

That's number of places against distance in meters, 10m bins.

This is really quite interesting. It shows that most places in Cambridge are within a few hundred metres of a bus stop. In fact, almost all are within my acceptable distance.

In reality, it's not quite as good as that. The first thing to correct for is that these are distances as the crow flies. Actual walking distance would be a little further - it's probably reasonable to multiply by 1.4-1.5 to allow for corners, curves, and crossings. Even then the bulk of Cambridge is still inside that 300m range.

The other problem, and it's a much bigger problem, is that this measures the distance to a bus stop, not to a bus service. A significant number of the bus stops in the data are no longer in use. Short of hand-editing those out I'm not sure how to approach this.

Furthermore, of those bus stops that are in service, you have to make allowances for the timetable. If there's only one bus an hour (some bus stops are one or two a day) then you have to make some allowance for that. One simple approach would be to calculate the time to next bus, which would be the walking time plus half the time between buses. (I'm prepared to use the peak frequency here. In reality people would time their setting out to align with the timetable rather than it being random, although the less frequent a service the earlier you aim to arrive to make sure you don't miss a bus. It's complicated.)

It would be nice to show the distances on a map, which would give you a much better visualization of where in Cambridge has good or bad access to a bus service. But that's only really worth doing if you have better data.

At the present time only a couple of dozen bus stops in the OSM dataset are annotated with the necessary information to allow more detailed analysis. It would be nice to get more accurate metadata (and to have the stops in the right places). There's a local Meetup group, but it's not terribly active. Still, the whole point of OpenStreetMap is that it's freely editable by anyone.

Friday, November 11, 2016

Reading the tea leaves

2016 has been a year of surprises, to many.

A UK referendum for Brexit was followed by a recent  victory for Donald Trump in the US Presidential Election.

I'm not a great fan of either result, but don't find either surprising.

In the case of the EU referendum, there was a huge problem with the Remain campaign. Essentially, it failed to give people a good reason why they would want to stay in the EU. Part of this is that the EU has actually lost its way - it really doesn't stand for anything. There isn't a European ideal, a European vision, to enthuse and motivate people. Some of this is that European governments are in fact sovereign and won't relinquish control of the big issues, leaving Europe to poke at little things around the edges, a complete inversion of where responsibilities should lie.

Meanwhile, the Leave campaign was coming out with reason after reason why we should get out. The cost of membership. The unelected bureaucrats. Unfettered immigration. Lack of sovereignty. That these were lies or misleading doesn't matter - the Leave campaign kept on making the points.

So, given a general sense of underwhelming disinterest in the Remain campaign, and general dissatisfaction with the state of the EU, is it surprising that people wanting a change voted to Leave regardless of the consequences? Or that people who wanted to Remain couldn't be bothered?

(I see a similar thread in the US presidential election. People are fed up of their current lot in life, one candidate promises to change everything and the other is a safe pair of hands who's not going to rock the boat.)

I've mentioned before that the madness with Brexit is that it isn't for anything. While technically a vote to leave, it gives us no lead or direction on where we should head to. And a non-binding result at that.

It looks like the current government response is akin to burning the house down because some of the residents don't like the wallpaper, then standing on the street outside working out where we're going to live next.

Invoking Article 50 and planning to leave, without having a single clue on what we're going to do afterwards is madness. Lunacy. Stupidity.

And yet the government is actually refusing to give any details of its future plans, It's even attempting to bypass Parliament.

One cannot see this happening without thinking that the only reason they have for keeping their ideas secret is that they actually don't have a clue. This isn't keeping you cards close to your chest, the Brexit emperor is buck naked so they're making sure nobody gets a look.

What should have happened, then?

First, I believe you have to take the referendum result as meaning that there is a great deal of distrust and resentment towards the EU. You cannot simply brush off the result as a win for stupid, there are genuine issues at play here.

(I know, I'm less than enamoured with the institutions of the EU myself. I'm very much pro-europe, but I'm not convinced that the EC or the ECJ are - rather that they're self-serving to feather their own nests and expand their own petty empires, not that the mandarins in Whitehall are any different.)

Lacking a clear direction for what the alternative state should be, there should have been the immediate establishment of some sort of body, a commission or whatever, to evaluate the options, their strengths and weaknesses, and report back. Shouldn't have taken too long, many newspapers produced summaries, Part of the investigation would have to be an enumeration of the issues raised - whether it be spending, sovereignty, immigration, or petty bureaucracy - and score the effect of different paths forward against those issues. Which would have to include the fact that leaving the EU could actually make the problems we're blaming the EU even worse. For example, the level of compromise involved in a Soft Brexit could be such that it would be better not to leave in the first place.

Then the government - sorry, Parliament - would be able to have an open and honest debate about the desired outcome. Maybe even a second referendum, hopefully one this time which actually had actionable outcomes as the choices.

Monday, November 07, 2016

The stupidity of "Soft Brexit"

One of the characteristics of the EU referendum was the "we can have our cake and eat it" promises from the Leave campaign. That we would be able to get all the benefits of being in the EU while avoiding the obligations and responsibilities that go with those benefits.

Post-referendum, the notion of Soft Brexit follows the same illogical path. Having your cake and being able to eat it has returned.

Essentially, what I'm referring to as a Soft Brexit is any deal that retains Britain's access to the European single market.

This appears to be Nick Clegg's stance, at any rate.

And we just had Jeremy Corbyn demand guarantees that we be kept in the single market before agreeing to support the government.

(Which is utter nonsense. You don't get guarantees, period. You can't require a British PM to guarantee something that only the EU negotiators have the power to do.)

It's pretty clear that the consequences of any Soft Brexit option would be that we would have to accept free movement of labour, and most likely accept that we would have to pay some sort of associate membership charge. The result of this is that we would have no real change compared to the current state, but would have no say in how the EU is run, no say in the condition it imposes us, or any mechanism (like our current veto) to prevent the EU from making decisions that run counter to our interests.

Far from being able to have our cake and eat it, Soft Brexit would result in us having less control of our own affairs thane we do as members of the EU. Pretty much any of the desired aims of those in the Leave camp would be better met by remaining in the EU than by taking the half-in and half-out approach of a Soft Brexit.

Friday, November 04, 2016

A few days in Prague

I'm sure that when you're getting married, you don't think too much about the long term consequences of the date you choose for the wedding. I know that when we chose a date back in 1986 it was largely around when people and places were available. We didn't think that late October would mean that our anniversary would always be (a) autumnal, verging on wintry, and (b) coincident with the school half-term, pushing prices up significantly.

But anyway, this year we went to Prague for a few days.

We flew Ryanair from Stansted. It's just down the road, so we drove down (at 4am) and used the meet and greet parking. Drive up, hand over your keys, walk into the terminal, and your car is waiting when you get back. That's the theory and, when it works, it's perfect. This time it worked eventually, but after we had spent 15 minutes queueing on the entry road, 5 minutes trying to talk to someone over the dratted machine at the entrance, and another 5 minutes waiting for them to raise the barrier.

We grabbed a quick breakfast before heading for the gate. The usual problem with these cheap flights is that due to having to pay for checked bags, everyone maxes out on cabin baggage. I'm pretty sure virtually all the bags people were trying to cram in the overhead lockers comfortably exceeded the size limit.

The flight was on time, in fact I think we were fractionally early arriving in Prague. Safely through the system and met by a driver (we had been warned not to try and get a taxi at the airport but to book in advance) who took us straight to our hotel.

We were staying in the Design Hotel Neruda. It's up in lesser town, nestled underneath the castle. Mid-range and comfortable, serving an excellent breakfast, it made an excellent base.

It wasn't 10am, so our room wasn't ready. Of course, we didn't expect it to be, we were just after dropping the suitcases, and then we were ready to explore. The street is famous for having many original house signs that were used before numbers, I took a few photos.

First stop was a walk up the street to the Museum of Miniatures. I had no idea what to expect (probably some neat models of some sort), but it's actually tiny models that you need a microscope to see. We just about managed to get round before a huge tour group descended on the place.

Another walk, and we got to the Public Transport Museum. [photo gallery] We found it fascinating, mostly trams but some other vehicles as well. We then took the sightseeing Route 91 tram into Prague itself.

The Old Town of Prague is fairly compact, so we started out on what would be the first of several days walking around. We headed up to Wenceslas Square - really a long open boulevard rather than a proper square, and then went into the Vytopna Restaurant.





No, my beer isn't delivered like that in Cambridge.

A bit more wandering around, including going round and round the houses to find this moving statue of Kafka's head, which was a bit odd. Then back to the hotel to check in and unpack. Because we were staying up in Lesser Town, we ended up crossing across the famous Charles Bridge quite a few times. It's a bigger piece of architecture than I was expecting, but it was usually packed with tourists.

Dinner was at U Medvidku, so back into the Old Town we went. We had to try traditional Czech cuisine. (Which as far as I can tell is very tasty but involves very large portions.) It's a very popular place, unfortunately we ended up in one of the side rooms rather than the main hall.

Next morning, more walking - first into the centre, then on the Sandemans free walking tour with our guide Tijo. We've done a number of these tours, they are free (apart from the tip), and tend to be done by outsiders who give a slightly different perspective on the place. There's usually a stop in a coffee shop halfway through.

Lunch was at the John Lennon Pub. We had tried to find this the day before, but our map showed it in the wrong place. I had the baked camembert, while Mel went for the goulash soup served in bread. Then we walked past the John Lennon wall.

Back to the hotel and we had booked a massage and spa, to treat those aching muscles.

In the evening we went off to a Black Light Theatre show. The one we went to is supposed to be the original and best, but they all say that and we haven't been to any others for comparison. Again, I didn't really know what to expect, but it's very impressive and excellently done. A little expensive, mind.

Then a late dinner just round the corner at U Provaznice, I just had Schnitzel and bread. And beer. There are relatively few bars open past 11, but we found U Vejvodu, where I had an excellent rich dark beer called Master. There was a little excitement just as we were about to leave, a group left without paying and the bar staff all shot off after them.

Next morning it was looking a little damp. It was fairly autumnal all the time, but we just had the one wet day, and it never really rained hard enough to get the umbrella out. We went up to the Castle and had a wander round. The Castle grounds are free, although it is a secure military area. Fortunately, the queue waiting to be searched was about 2 people when we got there first thing - it was much longer later in the day.

There's a very interesting Toy Museum in the castle, which we enjoyed going round. Those of us in the UK were brought up on the likes of Hornby, but that was a cheap copy of German toys. There was some Hornby present, but more Marklin and other local makes. The fact that it was warm and dry didn't make any difference, of course.

We wandered out to the Villa Richter, which is by the castle. I can imagine it being glorious to have a glass of bubbly outside in the gardens and vineyards. Nothing much on a cold, wet, windy day, so we went off to the Strahov Monastic Brewery instead. I'm sure it's good, but definitely tourist prices.

That was right next to the Miniatures Museum we had visited earlier, there's also the Monastery Library that you can visit. My advice is to give it a miss, there's not much to see at all and it's expensive for even that. (I'm a great fan of old books and libraries, it was a huge disappointment. But then I can go to the Fitz any time I like for free.)

We then took the regular tram, route 22, into the centre for some more wandering. This took us into the Czech Beer Museum. This is a proper museum, with an optional tasting at the end. (So Mel, who doesn't like beer, just had a museum ticket.) It's quite interesting, although a bit expensive. You have to laugh when they have a display of beers of the world and it has Double Diamond in it. The disappointing part was that they didn't have the full choice of beers available to try.

On the way to our next event we grabbed one of the local snacks, a trdelnik. With chocolate. We got ours from Good Food on Karlova, recommended.

So the next appointment was a Wine Spa. There are several beer spas, offering a hot spa with unlimited beer on tap. Mel found a place that would do a wine spa instead. You're not bathing in wine really, it's wine extracts and herbs they add to the water.

Our anniversary dinner was at the Seven Swabians, a medieval themed restaurant that was just a few yards from the hotel. And, ideally for Mel, they serve mead. Mysteriously they had managed to write our reservation down for the wrong date, but it didn't matter and we had an enjoyable evening anyway. I was already feeling rather stuffed (have I mentioned yet that portions are rather generous?) but the chicken and blue cheese was absolutely delicious.

Next morning we walked southwards, without crossing the river, passing the memorial to the victims of communism, to the Kingdom of Railways. It's the biggest train set I've ever seen, and it's not finished yet. Fascinating. And it would probably be even better if they had signs in English, and if we knew the country so recognised some of the places that were on the model.

Crossing the river we passed the dancing building. I suppose you can just about imagine it as a couple dancing. Maybe.

England hasn't been invaded since 1066, but mainland Europe is a different story. The Memorial to the Heroes of the Heydrich Terror reminded us of that. A sombre experience.

We then had a tour of the microbrewery at Novomestsky pivovar. A brewpub, in our terms. We got a personal tour, just the two of us - whether we were the only people on the tour, or whether we were the only english people who turned up, I'm not sure. This was followed by a tasting of some beer samples (I had to drink most of Mel's, what a shame!) and a meat and cheese platter. The dark beer was delicious - stick in a CAMRA beer festival and call it porter, and we would rave about it.

Mel's a bit of a mead fanatic. We went to U Sedmi Svabu for dinner not only because it was interesting and was close to the hotel, but because it advertised mead. Turns out that mead (or medovin) is fairly common in Prague. We had noticed bottles on sale in plenty of shops, and while searching online to translate the labels to work out which flavour was which we stumbled across the Mead Museum. (I'm astonished that such a thorough organizer as Mel wasn't even aware of it, but I think it's only recently opened.) So we just had to go and visit. They have almost a hundred different meads, mostly local. (There was an english bottle hiding up on a shelf.) Mel had an excellent time tasting 10 different ones, plus the initial free sample, and we had to buy a couple of bottles to bring home.

One of the tourist highlights in Prague is the Astronomical Clock on the main square. Yes, it's an interesting old clock. On the hour crowds of tourists gather to watch it do it's thing. You might think it was going to be something impressive, but it's not. The hourly show is pretty pathetic.

We then went to the Municipal House, and had cake and coffee. It's a glorious piece of architecture, some sort of cross between baroque and art nouveau. Apparently it's in xXx with Vin Diesel. While the staff were efficient, they were a bit snooty.

I was a bit done in at this stage, after a chill out at the hotel we wandered a bit further up the hill. There are relatively few bars I've walked into and walked straight back out again, U cerneho vola was one - the reception was beyond unwelcoming. We did find a very nice cafe on the way back, whose name unfortunately escapes me. While I just had a small beer, Mel had the beer cheese - which is cheese you mash up with spices and beer and things into a paste and spread on your bread, and actually works quite well.

Next morning we started out along the same path as the day before, although this time grabbing a cake from the bakeshop on the way, heading for the funicular up to the Petrin gardens. There was a fair queue, not helped by the fact that the staff insisted on running to timetable and making you wait 10 minutes after the cars were full.

We wandered round the hill and paths, but it was a beautiful clear day so we climbed up to the top of the Petrin Tower where you get excellent views.

Walking into Prague we stopped off at the Pivovarsky Dum for a quick beer. Another microbrewery, they do food and also a sampler set of 8 to try. We just sat right next to the brass brewing vessels and chilled out.

We had looked at Blatnicka a couple of times in passing. We went in for a small glass of wine in the afternoon. In truth, I'm not sure if we went in the right place - the official wine bar is next door and the main restaurant seems to have moved across the road. But it was a very pleasant glass of wine.

Dinner on the last day was at Lokal. It's a vast barn of a place, most of the tables are reserved. But if there's a reservation from 7, and you're there at 6, they'll happily sit you down, letting you know what time you have to be finished by. I had the garlic soup and fried cheese, although I was tempted by the carp.

For a last drink we went back to U Provaznice,and had a last look at that Astronomical Clock as we made our way back to the hotel to get our taxi back to the airport.