Follow

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

  1. Click Home | Grid Data | Grid Data.
  2. Select the XY data file and click Open.
  3. In the Grid Data dialog, set the X, Y and Z columns to the appropriate columns in the data file.
    1. In this case, the X column is column C (longitude).
    2. The Y column is column B (latitude).
    3. 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.
  4. Change the Gridding Method to Data Metrics.
  5. Click the Advanced Options button to change the metric being gridded and the search area.
  6. In the Data Metrics Advanced Options dialog:
    1. Click on the General tab.
    2. 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.

    1. Click the Search tab. This is where you can define the area to search for entities.
    2. 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.
    3. 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.
  7.  

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.

  1. Click OK in the Data Metrics Advanced Options dialog.
  2. 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.
  3. Click OK and the grid is created.
  4. Once the grid file is created, you can begin to put together the map. Click Home | New Map | Contour, select the grid file and click Open. The contour map is created.
  5. 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

  1. 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.
    1. Click Grids | Edit | Filter, select the grid file and click Open.
    2. 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.
    3. Click OK in the notice that the grid has been filtered.
    4. Select the existing contour map on the screen and click the General tab in the Properties window.
    5. Click the Open Grid button to change the grid file.
    6. 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.
  1. 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.
    1. Click Home | Add to Map | Base, select World.gsb, and click Open.
    2. If asked to adjust the limits, you can click No.
    3. Click on the Base layer in the Contents window a drag it beneath the Contours layer. This places the boundary behind the contours.
    4. With the Base layer still selected, click the General tab in the Properties window.
    5. Click the + next to Fill properties to expand that section.
    6. Set the Foreground color to 30% black. This gives all the areas in the base map a light gray fill color.
    7. Select the Contours layer in the Contents window.
    8. 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.
  2.  

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.
  1. 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.
    1. Click Home | Add to Map | Classed Post, select the data file and click Open.
    2. When asked if you want to adjust the map limits, click No.
    3. Click on the Classed Post layer in the Contents window.
    4. Click the General tab in the Properties window.
    5. Set the X coordinates column to column C (longitude).
    6. Set the Z coordinates column to column E (magnitude).
    7. Check the box to the right of Show legend to create a legend of the symbols.
    8. Click the Classes tab, click the Edit Classes button.
    9. Set the desired class and symbol properties for each class.
    10. Click OK.

Add a classed post layer to the map to show the raw data point locations.
  1. Finally, add the finishing touches on the map.
    1. Add a color scale for the contours.
      1. Click the Contours layer in the Contents window.
      2. In the Properties window, click the Levels tab.
      3. Check the Color scale box (only available if Fill contours is also checked).
      4. If desired, click the color scale object in the Contents window and adjust any properties or add a title to the color scale in the Properties window.
    2. Create a title on the top axis.
      1. Click the Top Axis in the Contents window.
      2. In the Properties window, click the General tab.
      3. Enter the desired title to the right of Title text.
    3. Format the axis labels in degree/minutes/seconds format.
      1. Click the Bottom Axis in the Contents window.
      2. In the Properties window, click the General tab.
      3. Click the + next to Label Format to expand that section.
      4. Change the Type to DMS (Lat/Long).
      5. Select the desired DMS format.
      6. Repeat for the Left Axis, if desired.

 

Finish the map by adding a color scale, a map title and formatting the axis labels.

 

Heat maps are an excellent way to quickly visualize and identify areas of interest, and are an important tool for any industry.

 

Updated September 18, 2017

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.