Coastal Seascape

 

How far is it to the beach?

Customised scripting technology provides the answers to a vital question in the summer heat

With the warmer weather finally kicking in, we will all, no doubt be thinking about heading for the beach to soak up the rays.

For those of us lucky enough to live in or near York that probably means a short drive over to Bridlington, Scarborough or Whitby. Unfortunately it also probably means a long wait on the A64.

What about people who live in areas that are furthest from the sea? Where would be the best place for them to go for a seaside break and more importantly what is the best way to go about finding this out?

 

Interested in our mapping and consultancy services?
Call  01904 701020, complete   or 

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:

"source","target","time","distance"
"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 */
'FF8',
'F00', /* red */
'F44',
'F88',
'4F4', /* green */
'8F8',
'88F',
'44F',
'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:

UK map showing closest coastal sector to each other sector

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

 

Our blogs

Living Costs and Food Survey

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

Postcode to postcode drive time and distance

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

Meet the team: Toby

Toby, our Sales Executive, gives a retrospective of his time teaching, and learning about Beacon Dodsworth's GIS solutions.

Customer data analysis solutions

Customer data analysis solutions provide actionable insight and a range of opportunities that can make a huge difference for businesses. Free data samples available

A career in the GIS industry

Three months into my first professional software developer job with Beacon Dodsworth, and I love it.

What is GIS software?

GIS software is a problem-solving toolkit that will effectively enable you to manage large datasets for example from your customer database, understand locations and present information.

Where is the North

We've used the territory manager tool in Prospex GIS to split the UK into North, East, South and West with equal population counts.

Lifestyle data and spending habits

Exploring consumer habits around baked goods using lifestyle data and geodemographic profiling unlocks a range of opportunities.

What has the census ever done for us?

How Census 2011 can be used to help organisations with demographic analysis.

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.

How far is it to the beach

Using Beacon Dodsworth's scripting technology to showcase demographic and geographic trends.

Geodemographics and the University of East London

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

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.

Household spend on fruit and vegetables

Using GIS mapping to visualise, analyse and present data in a geographical context.