Create Heat (or Density) Maps in Surfer

Heat (or density) maps are powerful tools to visualize the density, or concentration, of a particular entity within a specified area. The concentration of the entities, which can be almost any counted item, are represented by colors on the map. For instance, an earthquake emergency aid group would use heat maps to display the concentration of seismic activity across the globe. Overall, the world has more seismic activity in total, but there are smaller areas, such as those at tectonic plate boundaries, that have higher seismic densities. The heat map provides a visual representation of the areas where the emergency aid group should be prepared to provide emergency assistance. Other examples of heat maps include the number of mouse clicks on sections of a webpage, the number of crimes within a city, the number of artifacts in an archaeological field survey, or the number of retail customers in a given city. Heat maps provide informative visual representations of location activity and are used in practically all industries.

Create heat maps in Surfer depicting the number of occurrences in a given area.

To create a heat map in Surfer, all you need is a table of XY locations. In this example, earthquake data for the last 30 days was downloaded from the USGS (http://earthquake.usgs.gov/earthquakes/map/). To visualize the data to see where the highest concentrations of earthquakes occurred, you can follow these steps.

Creating the Grid File

Click Home |Grid Data | Grid Data.

Select the XY data file and click Open.

In the Grid Data dialog, set the X, Y and Z columns to the appropriate columns in the data file.

In this case, the X column is column C (longitude).

The Y column is column B (latitude).

The Z column can be any column (it doesn't matter because we're creating a density grid and this Z value isn't used). In this case, select column B.

Change the Gridding Method to Data Metrics.

Click the Advanced Options button to change the metric being gridded and the search area.

In the Data Metrics Advanced Options dialog:

Click on the General tab.

Click the + next to Data Location Statistics to expand that section. Here you can choose either Count or Approximate Density. Count is the most simple and gives you a straightforward count of the number of entities within the search radius. Approximate Density gives you the number of entities divided by the area of the search. In this example, we'll use Count.

Select Data Location Statistics | Count to generate a grid of the number of entities in the search.

Click the Search tab. This is where you can define the area to search for entities.

If it is not already unchecked, uncheck the box next to No Search (use all of the data). This allows the search options to be specified.

The search radius defines the area around each grid node that Surfer will look in for entities to count. When using data metrics, you must set a search radius. If you do not, the entire map will contain the same value. If you set the search radius too small, you will get tight patterns around each data point. If you set the radius too large, the density patterns will become too generalized. The units of the search radius are the same as the units of the X and Y values in the data file. Since this data is a map of the entire world, in units of lat/long, enter a value of 20 for Radius 1 and Radius 2. So that means that Surfer will look in a 20° radius circle around each grid node and count the number of earthquakes in that circle, and that value will be the grid node value.

Set the Radius 1 and Radius 2 values of the Search Ellipse to be the radius around each grid node that you want Surfer to look for data.

A smaller search ellipse of 5 (left) produces patterns that are too tight around the data points, and a search ellipse of 30 (right) creates patterns that are slightly too generalized.

Click OK in the Data Metrics Advanced Options dialog.

The next thing to set is the resolution of the grid file. You can specify the resolution either by setting the number of grid nodes in the file, or by specifying the spacing between nodes. Fewer nodes results in a coarser grid file and more nodes results in a finer grid. Increasing the number of grid nodes takes longer to grid and creates a grid file that is larger in size. However, this does not always equate to a smoother more accurate map. At some point, creating more nodes is not going to make the map look any different and too many nodes can create undesired effects in the resulting grid, such as artifacts or too much detail. For now, the default number of nodes is sufficient.

Click OK and the grid is created.

Once the grid file is created, you can begin to put together the map. Click Home | NewMap | Contour, select the grid file and click Open. The contour map is created.

You can edit any of the properties, such as contour line and fill color, by selecting the Contours layer in the Contents window and making changes in the Properties window.

Create a contour map of the grid file and fill the contours with a color gradient.

Building and Finishing the Map

Although you have a basic contour map of the results, there are some finishing touches that may increase the visual appearance. This first option is to filter the grid file to round out the edges of the contours and make the map look a little smoother.

Click Grids | Edit | Filter, select the grid file and click Open.

The Low-pass Filters are the smoothing filters, and the default Gaussian (3x3) filter is a good choice. This filter is a moving average that examines a 3 node by 3 node box to create the new node value. Click OK.

Click OK in the notice that the grid has been filtered.

Select the existing contour map on the screen and click the General tab in the Properties window.

Click the Open Grid button to change the grid file.

Select the new filtered grid and click Open. The grid file for the contours is replaced with the filtered grid.

Filter the grid with a low-pass filter to create a smoother contour map.

The next step is to add a base map, to help indicate the relative location of the contours. In this case, we can use World.gsb, downloaded from the Golden Software website.

Click Home | Add toMap | Base, select World.gsb, and click Open.

If asked to adjust the limits, you can click No.

Click on the Base layer in the Contents window a drag it beneath the Contours layer. This places the boundary behind the contours.

With the Base layer still selected, click the General tab in the Properties window.

Click the + next to Fill properties to expand that section.

Set the Foreground color to 30% black. This gives all the areas in the base map a light gray fill color.

Select the Contours layer in the Contents window.

Click the Layer tab in the Properties window and set the layer Opacity to 60%. The makes the contour layer semi-transparent so you can see the base layer objects under it.

Add a base layer under the contours to show the relative location of the map. Change the contour opacity to 60% to see through the contours to the features on the base layer.

Add the data points as a post or classed post layer to visualize the raw data over the map. Since we have magnitude data for the earthquakes in this data set, we can create a classed post layer and set the symbol properties based on the magnitude of the earthquake.