Skip to content

Mapping and geospatial analysis

Alberto Labarga edited this page Nov 8, 2020 · 3 revisions

In recent years, data-driven investigative journalism have emerged as an accepted field in its own. While computer-assisted reporting is a term used for several decades, ubiquity of data and equipment means the role now encompasses more. Some large newspapers have multiple data journalists on staff, with a full-time focus on finding and telling stories within the data.

Many times, these data stories are told better with visualizations, and maps are the best way to show geographic data—and most stories have a location element. Finding and filtering data is an important part of data-driven journalism, but the visualization is often how it is consumed by the reader.

Mapping with points

If you are mapping points it means that each row in your dataset is given a location on your map. For example, if you were mapping businesses’ food hygiene inspections then a pointer would be placed at the location of each business.

This approach is one of the simplest ways to get started with mapping. But for the same reason it can be used badly.

Mapping points makes sense if:

Your data refers to specific locations, such as businesses or crime scenes
Users will want to look at data points near them, such as how local schools perform, or whether someone was arrested for that crime
The resulting map shows a clear distribution of those points, and this is the story you are trying to tell: for example fast food vans near the sports stadium are failing food hygiene inspections; or there are more burglaries in one area than another.

Mapping points is not the right approach if:

Your data refers to larger areas, such as countries or regions. Even cities or parts of cities can make little sense when plotted as points on a map.
Users do not need a map to find a location relevant to them, or cannot. For example in a national map, many users may not be able to locate their town; after all, how many times do we use national maps to orientate ourselves? In reality we tend to use local maps or specific road maps.
The story is not about the visible distribution or clustering of those points, but about comparison (for example the worst or best places) or composition.

In this last case you are better using a visualisation device designed for that purpose, such as a bar chart (comparison) or pie chart (composition).

If your story is about distribution but not a geographical one, then try a scatter chart.

One thing to note about mapping points is the potential for mapping tools to place marks wrongly.

This is because mapping tools work by geocoding your locations. That effectively means that they convert text in your address fields (such as ‘London’ or ’34 High Street’) into geographical data: typically latitude and longitude.

The best case scenario is if you have latitude and longitude in your data. This means that the tool does not have to perform any conversion, and the process is much quicker and more accurate (assuming your lat/long values are accurate).

But if your geographical information is partial or inexact, and outside the US, you may have problems.

Most mapping tools default to the US, so ‘Cambridge’ will be placed in Massachusetts unless you are able to specify otherwise. It may be able to map zip codes, but not postcodes.

There are two ways to reduce the chances of misplacement: the first is to use any options in your mapping tool to limit the geocoding.

The mapping tool BatchGeo, for example, allows you to specify a particular country rather than the default ‘worldwide’. And Google Fusion Tables allows you to specify ‘hints’ on locations.

The second way to reduce misplacement is by combining the address details into one column, rather than (or as well as) having things like ‘street name’ and ‘city’ and ‘country’ in separate fields.

Mapping shapes

A more ambitious alternative to mapping points is to map shapes: in other words, instead of each data point being placed on a specific point on a map, instead different areas on that map are drawn and coloured/labelled according to the relevant data.

Shapes can be anything: you can have a map with shapes for each country in the world or a particular continent; or you can have a map with shapes for each county in the UK, or each constituency (voting region), or local authority. Or police authority area. Or health authority.

This is particularly useful if your data does not relate to geographical points (a specific location with its own latitude and longitude) but rather to broader geographical areas, such as a town or city, region or country, or an administrative area.

And data often will only relate to areas: unemployment rates, inflation and health data will all relate to areas. You are not going to get data which shows you the location of every sick person, unemployed person, or expensive loaf of bread.

If you are to be accurate in representing these figures, shapes are the way to do it.

But they are also harder to ‘draw’ than points on a map.

This is because shapes are actually data too: a description of the coordinates and paths needed to draw each shape.

As a result, drawing a map with shapes invariably involves merging data: your data about those places; and the data containing the descriptions of those shapes.

This second set of data is often called ‘shape files’. The mapping tool OpenHeatMap, for example, has a number of shape files stored in its database, including shapes for countries, US states, UK constituencies and authorities, and administrative regions in New Zealand, Mexico, Ireland, and other places.

The final option is to draw the shapes yourself. In Google Maps Engine Lite once you have drawn your maps (shapes, points, or routes) you can export as KML.

There’s also another option which doesn’t involve shape files at all: you can find an image showing all the regions you need, then add a layer of interactivity to convert that into an image map, as described below.

Colouring map shapes color-brewer

The Color Brewer tool

When choosing to colour-code shapes in a map you need to consider the same issues as outlined above with regard to points: don’t choose too many colours, and keep the story clear and/or useful.

It is a good idea to use a tool like Color Brewer to help you choose the colour palette. This will suggest colour combinations which can be seen by users with colourblindness, and which also suit the type of data you are showing (ordinal, for example) (more background on founder Cindy Brewer here).

It is a good idea to use a tool like Colorbrewer to help you choose the colour palette. This will suggest colour combinations which can be seen by users with colourblindness, and which also suit the type of data you are showing (ordinal, for example). Below you can see a good example (from this article) of how different colour schemes – and colour scales – communicate different types of data more clearly.

Tools like Meograph and Tripline allow you to tell stories with routes, while Google Maps Engine Lite allows you to draw them and export in a format which can be used in mapping tools.

A route has its own built-in narrative which can be quite powerful. They lend themselves to photoblogging (taking images along the route) or audio or video (likewise). You could present data about each point along the route using those media (charts, for example) rather than making it about the map.

If your story is about a route it is worth considering these tools instead of simple points. You could also look at timeline tools like Timeline JS as routes can often be shown in this format too.

Clone this wiki locally