Image caption Testing a barrier: Just one of the options to stop a lorry attack

Can an attack like the ones in Berlin or Nice, where a lorry is used as a weapon, ever be stopped?

If we want to live in a free and open society, then no security infrastructure could ever remove all the risks.

But there are really effective methods to stop lorry attacks and to protect public spaces. I'm among a small group of journalists fortunate enough to have seen one of the key methods tested, quite literally, to destruction.

The US, Israel and the UK are among the nations that have led the thinking on protecting public spaces with the development of measures ranging from in-your-face massive barriers to incredibly subtle changes in the street scene that you and I would barely notice.

Anyone who visits these nations' capitals will be in no doubt about the physical security that surrounds critical buildings. Our Parliament is ringed by massive black barriers. The area around the New York Stock Exchange is surrounded by anti-vehicle ramps and any visitor to Israel doesn't need to be told what security looks like.

'Target hardening'

With careful planning, cities can be "hardened" by the creative use of special barriers and bollards capable of withstanding direct impacts - stopping a lorry from reaching its goal.

Does this engineering and other related measures turn a city into a fortress?

Let's go back to the example of Parliament. The large black barriers that surround the Palace of Westminster are obvious.

Media playback is unsupported on your device Media caption How the UK is working to prevent a similar attack

They're designed to stop a lorry strike at high speed and I saw a prototype of them tested in 2009.

You can watch the video of that exercise on the old version of our website - although it may not work on modern smartphones.

But less than 100m from Parliament lies Whitehall, the home of many of the UK government's ministries. There are no large black barriers there. Well that's not strictly true. The barriers are there - you just can't see them because they've been built into the architecture of a street scene that allows the free movement of pedestrians but would stop a lorry attack.

Now, governments are obviously going to protect critical infrastructure - but what makes the Nice and Berlin attacks so frightening is that they were not buildings, but public spaces where people were out enjoying themselves.

Image caption Walls in Whitehall: This will stop a lorry too

If attackers shift their focus from "national" landmarks to what's known in the security jargon as "soft targets", how can anywhere ever be safe?

The UK government's approach has been to have a team of dedicated police officers, engineers, architects and other experts who advise everyone from city councils through to Premiership football clubs about how to reduce the risk of vehicle-borne attacks to crowded locations.

There is planning guidance and the Royal Institute of British Architects has its own dedicated advice on designing for counter-terrorism without turning the nation into Alcatraz.

When local police counter-terrorism security advisers assess a location, they don't just say, "pour a load of concrete and hope for the best". Each recommended measure for a UK location has been tested to internationally-recognised criteria, including an official British Standards Institute specification.

Image caption Stopped: Counter-terrorism lorry test witnessed by the BBC in 2009

So, depending on the specific location, many of the barriers increasingly built into our landscape have been tested to see if they can withstand a head-on impact from a seven-tonne lorry driven at 50mph (80 kmh).

The most well-known example of that kind of planning in action can be found at Arsenal's Emirates' Stadium, where giant letters spelling out the club name are, in fact, also a massive shield.

If a Berlin-like lorry attack were attempted at the stadium, the letters would absorb the energy of the collision. In all likelihood, the lorry would simply smash itself to pieces. Other public locations around the UK have been similarly hardened.

Image copyright Alamy Image caption Emirates Stadium: Letters are an anti-attack measure

Now, fairly obviously, nobody wants to see massive Parliament-style black barriers on the seafront of seaside resorts. But, again, there are measures that can reduce the risk. Temporary road barriers made of large reinforced concrete blocks can be deployed at public events within hours and can even be securely anchored into the ground with the minimum of disturbance to the landscape.

Lesser measures, such as a series of complex chicanes, may be enough to thwart a lorry attack long enough for the police to arrive.

These kinds of measures are regularly seen at major political events, such as party conferences or summits - but less so at public events.

Could a lorry attack happen in the UK? Fairly obviously, yes, which is why the UK has guides for event organisers, urging them to think through how they mitigate the risks of becoming a target for terrorism.

The key guide for major outdoor events runs to 81 pages, and it starts by urging organisers to answer some key questions:

Identity the threat - that means take some proper advice from people in the know

Establish what you want to protect and what's vulnerable

Identity the security improvements that would offer protection

Review and rehearse to make sure you've got it right

So when the German authorities investigate the full circumstances of how this lorry was able to cause such devastation, they will have to ask themselves whether they have a system in place that can prepare and protect for such an atrocity.