A landscape shot of a beach looking out to sea.

How far is it to the beach?

Or, how we use our custom scripting technology to answer a 'simple' question

We are used to making data easier to understand for our clients, but in this blog we want to look at things a bit differently - Just how do we use our scripting technology to answer an apparently simple question in a geographically quantifiable and mathematically sound way. This provides a particular challenge on an island nation where most starting points can reach the sea in any direction.

So, if you’d like a detailed technical insight into how we approach the geodata challenges set by our clients, then read on.

Coast to Coast Analysis

We want to look at the drive times from every UK sector (about 10,000) to the coast.

For convenience we have decided that any postcode sector that borders the sea is a “seaside sector”. This gives a poor model at estuaries - not many people consider central London as the seaside - but it is a reasonable approximation for a first cut.

We will use our custom scripting engine to achieve an analysis. Don’t worry about the details. If you are a JavaScript programmer you will follow most of it. Tileview and TimeTravel are built-in classes.

var tt = TileView.tiletypes('sector'); // get the postcode sector tile type
var tiles = tt.tiles; // get all the tiles (postcode sectors)
var allTileNames = tiles.map (lambda t:t.name); // and just their names

// now get just those sectors which have a link whose left or right tile doesn’t exist
var seaTiles = tiles.filter (lambda t:t.links.filter(lambda lnk:((lnk.l==null) || (lnk.r==null))).length>0);
var seaTileNames = seaTiles.map (lambda t:t.name).sort; // and just their names

// use the timetravel database lookups to find the nearest coastal tile to each UK tile
TimeTravel.TimeBetweenSectors (allTileNames, seaTileNames);

Speaking Our Language...

The scripting language developed by Beacon Dodsworth is based on JavaScript syntax but with built-in functionality to access our rich geographic, drive-time and demographic datasets.

The last line delivers a table (an array) of the nearest postcode sector in the second list (seaTileNames) to each postcode sector in the first list (allTileNames).

The result of running this script can be sent to a CSV file that looks like this:

"IV20 1","IV20 1",7.4,5
"FK17 8","FK 8 1",23.5,25
"SO41 6","BH25 5",7.8,5.2
"GL 7 6","GL 2 8",34.3,41

with one row for every UK sector.

We can manipulate this array further using the scripting, for example to see who is more than an hour away from the coast. What we really need is to visualise it.

Taking the above generated file (assume it was called C:\blogs\seaside.csv) we can use the custom drawing functions to generate an image:

var tt = TileView.tiletypes('sector'); // same as above in the first script
var colours = [ // set up some Hex colours to use (yellow through red, green to blue)
'FF0', /* yellow for the shortest time */
'F00', /* red */
'4F4', /* green */
'00F' /* blue for the longest time */
// the readLine function will execute for each line in the CSV file
// generating a straight line between the source and target sectors
// or a circle where they are the same

var readLine = function (line) {
var sourceTileName = line.source;
var targetTileName = line.target;
var time = line.time;
var lineColour = (time>90)?'00F':colours[time/10]; // calc a colour based on drive time
var p1 = tt.Tiles(sourceTileName).labelPoint; // use the sector centroid
var p2 = tt.Tiles(targetTileName).labelPoint;
return (sourceTileName==targetTileName)?
{what:Geometry.Circle (p1, 1000), // a 1000m radius circle style:{Pen:null, Brush:{colour:lineColour, opacity:255}}}:
{what:Geometry.Polyline ([p1, p2]), // a straight line
style:{Pen:{width:2, colour:lineColour}}}; }

// open and read the CSV file generated previously, creating an array of styled geometry
var linesAndCircles = FileSystem.file('C:\\blogs\\seaside.csv').readCSVLines (readLine);
// generate the image 
Canvas (
[ Tiling('OS'), // background OS imagery
{what:Page.rectangle(0,0,1,1), // make the background paler with a full page rectangle
style:{pen:null, brush:{colour:'fff', opacity:100}}},
linesAndCircles // the styled lines and circles
{ filename: 'images/sunshine', // where the image will be saved
pixelWidth:1000, // the size of the target image pixelHeight:2000 }



This script is fairly complex (although only about 50 lines) but demonstrates some of the file I/O, geometry and drawing features we can use. The Canvas method’s first parameter is an array of content for the map; the second configures the map size and where it will be saved. The resulting image shows the accessibility of the “coast” in a striking way:

The above map shows distance from the coast with yellow being those lucky souls with least far to travel, and blue being reserved for those with the most epic journey.

The above map shows distance from the coast with yellow being those lucky souls with least far to travel, and blue being reserved for those with the most epic journey.

We have built an interactive test bed for our scripting engine. Putting the technology behind our mapping servers drives web services for drive time lookups, routing and map generation.

Journey from the Centre of the Country

Outside the highlands of Scotland there are a couple of sectors in central England that are the furthest from any coastline. One is just south of Leicester (LE8 5) whose nearest coastline is at Goole on the tidal River Ouse, 92 minutes’ (156km) drive away. Fairly close to the west in Earl Shilton between Leicester and Hinckley is another sector almost 92 minutes away from the River Severn in Gloucester. Third (SY7 0)  is west of Ludlow, 91 minutes (but only 91km) away from the Severn even though the beautiful Welsh coastline is nearer as the crow flies.

Rapid analysis and visualisation of this kind helps to formulate the real questions about access and attractiveness and to refine our model.


Beacon Dodsworth provide a variety of solutions to help businesses get the best from their data.


Sign up  for our newsletter to learn more about data, analysis and mapping solutions


A close up map of Leicestershire using the same method of illustrating distance to the coast.

A close up map of Leicestershire using the same method of illustrating distance to the coast.

Our other blogs

British Population Survey (BPS)

The British Population Survey (BPS) is a survey of household income and shopping habits collected by face-to-face interviews. We take a look at the BPS in detail, what exactly it is made from and how its data can be usefully applied by businesses and public organisations.

What is geodemographic profiling?

More than 64 million people live in the UK, each with their own outlook, priorities, needs and way of life. Geodemographic profiling offers a way to group these individuals to try and identify the right audience for your product or service.

The census helps you to understand your customers

The UK Census 2021: what it is, how is it made, and how can it be used to help your organisation with demographic analysis.

Using geographic intelligence to grow the UK’s broadband network

Using geographic intelligence to sustainably grow the UK’s broadband network.

Mapping efficient sales territories

We've worked with mapping, demographic, and travel data for a long time, and have become specialists in territory mapping. So we'd like to share a few tips on how best to define sales catchments for your team, or embark on territory review.

TimeTravel: the latest update

We look at the latest update to TimeTravel, our dataset of drive times and distances between any postcode sector or district. What has changed in the UK road and geographic network, plus new features to make it even more accurate.

How to create a postcode map

Turning a list or spreadsheet of postcode data into a series of points on a map isn't as simple as using an Excel wizard to do it for you, but it isn't rocket science. We look at the best way to create a postcode point/pin map.

Living Costs and Food Survey

The Living Costs and Food survey (LCF) is compiled every year and is used by the UK and European governments, Department for Transport (DfT), and Her Majesty’s Revenue and the Customs (HMRC). But what is it, and why should we care?

Cycle to work day

Each year for #cycletoworkday we take a look at cycling statistics across the country and try to map that data and find interesting trends. This is mainly because we at Beacon Dodsworth are either a little bit obsessed about cycling, or we tend to worry about the environment.

Mapping for local projects

Recently, we were contacted by a company responsible for organising charity door knockers. They needed more than 9,000 postcode sectors mapped at A4 size to use at a local level to plan fundraising routes and clearly define territories for each agent.

Social change over 10 years

With the next census due to take place this year, we thought it was a good time to take stock of some of the changes and trends we noticed between the 2001 and the 2011 census. What difference does 10 years make to our society and the people that live within it?

Beacon Dodsworth New Office

Now we are back in the office, we continue to support hybrid working. So, we’ve taken the opportunity to downsize our office to make us more resilient to future lockdowns, staff self-isolation, and any other uncertainty the modern world might throw our way.

Postcode to postcode drive time and distance

What happens if we want a postcode to postcode drive time lookup table?

Administrative Geography

Administrative geography is a way of dividing the country into smaller sub-divisions or areas that correspond with the area of responsibility of local authorities and government bodies. We take a look at administrative geography, what it is and how to use it.

Who spends most on Fruit and Veg

National Vegetarian Week (#NationalVegetarianWeek) this year ran from 10th to 16th May. It gave us the opportunity to highlight how GIS mapping can be used to create marketing campaigns and raise awareness of the benefits of eating more fruit and veg.

Data visualisation and colour blindness

John, our director talks about living and working with colour blindness in the mapping industry where colours are pivotal in adding dimensions to people's understanding.

How far is it to the beach

We use Beacon Dodsworth's scripting technology to answer that most important of questions when the sun finally does threaten an appearance.

All you need to know about postcodes but were afraid to ask

The humble postcode has been around for years. We look at how postcodes are used and what led to their introduction.

Yorkshire Day

As a Yorkshire-based company, we wanted to help celebrate Yorkshire Day, which takes place on 1st August. Naturally, we wanted to put a geographic spin on the celebration, so we took a look at drinking preferences within God’s own county.

The foundations of geographical analysis

Displaying data on maps makes it easier to understand as well as giving a new perspective on a problem. Using a GIS to prepare and present data has become increasingly popular over the last 20 years, but graphical displays of data on maps were around long before computers came along.

How to back up your Prospex data

Keep your GIS projects safe by using the in-built Prospex back up process. Here is how.

The power of postcode sectors

Postcode sectors are aggregations of individual postcodes and they provide meaningful geographical reporting areas in any GIS. However, they aren't as easy to map as you might think. Here is how we do it.

The new normal for the GIS world

Toby, our Account Manager, looks at the changes to working style and client needs in the geodata industry following the COVID-19 outbreak.

Where is the North

We've used the territory manager tool in Prospex GIS to split the UK into north, south and east and west with equal population counts.

What is GIS software?

A Geographical Information System (GIS), is a tool for analysing, visualising, managing and presenting data that is related to a physical, geographical location. That link to geography is the key difference between GIS and other data visualisation techniques.

Mapping GP prescription data

An article by Allan Brimicombe (Head of Centre for Geo-Information Studies at the University of East London) & Pat Mungroo on using GP prescription data to understand health needs.

Geodemographics and the University of East London

The University of East London explain how they have been using our P² People & Places geodemographic classification.

Google Fusion Tables

After almost 10 years of service, Google retired their Fusion Tables product at the end of 2019. This tool was very useful at visualising and sharing large amounts of tabular data - particularly amongst small and mid-sized businesses. So what can we do to fill the gap left by this tool?

Get in touch
Call  01904 701020, complete   or