Calculating the Line of Intersection between Two Surfaces in Surfer

Finding the line of intersection between any two surfaces is quite easy in Surfer. For example, you might want to calculate the line of intersection between a geological horizon (i.e. bedrock, sandstone, etc) or the water table and the ground surface; or you might want to calculate the line of intersection between a surface based on airborne laser scanning data and a slightly inclined plane. Whatever data you have, once you have the line of intersection, you can export it to another file format (i.e. DXF or XYZ data) for use in other software, or overlay the contact line on other maps.

Surfer: contour map with interesction line

Surfer: Calculate the line of intersection between two surfaces, and
show which surface is above the other.

To start, you need grid files for both surfaces. You can obtain the grids a few different ways:

  1. Grid raw data in Surfer. If you have raw XYZ data for the surfaces, you can grid the data in Surfer. For example, you may have well data with collar or Kelly Bushing information for the ground surface, and downhole information about the depth that the horizon of interest was encountered.
  2. Obtain grids from colleagues. Someone in your company, or someone in your field may be able to send you grid files of the surfaces in a grid format supported by Surfer. You can find a list of grid formats Surfer can open on our website of Supported File Formats.
  3. Download the grid files from a public online source. Click the Grids | New Grid | Grid from Server command to download a grid file from a WCS server or visit one of the many online data sources that contain grid files of elevation (or DEMs), such as GIS Data Depot, The National Map, CGIAR-CSI, or the Global Data Explorer.

To calculate the line of intersection, the grid files for both surfaces need to be in the same coordinate system, and have the exact same Z units, X and Y extents, and grid resolution. If any of these requirements are missing, they can be addressed in Surfer:

  • If the grids do not have the same dimensions or grid resolution, you can either re-grid one of the data sets with the same dimensions as the other grid, or you can use Grids | Resize | Mosaic to adjust the geometry of one grid to match the other.
  • If the Z units are mismatched, you can use Grids | Calculate | Math to apply an equation to convert the Z units of one grid to match the Z units of the other.
  • If the coordinate system is not the same between the two grids (i.e. one is in lat/long and the other in UTM), you can use Grids | Edit | Project to assign the coordinate system of one grid to the other.

This article will walk through the process of calculating the line of intersection (or contact line) between the local topography and the top of a Mississippian-age limestone unit in south-central Indiana. The topography elevation grid was downloaded from The National Map in ArcGrid format (1 arc second resolution). The grid is in geographic latitude/longitude coordinates with the elevation units in meters. For this example, let’s say the raw XYZ data for the top elevations of the limestone beds were collected and saved in an Excel file. The X, Y and Z units in the raw data were converted to be the same as those in the elevation grid, and the data was then gridded in Surfer with the same X and Y extents and grid resolution as the elevation grid. The grid files used in this article can be downloaded here.

To visually depict the intersection of the surfaces, overlay them by following these steps:

  1. Click Home | New Map | 3D Surface | 3D Surface, select one grid file and click Open.
  2. Click on the surface map to select it.
  3. Click Home | Add to Map | Layer | 3D Surface, select the second grid and click Open.
  4. Select the map and click Map Tools | Map Tools | Trackball to interactively change the rotation and tilt of the map.

Surfer: show interexection between two surfaces

Surfer: Visually show the intersection of two grids by creating and
overlaying two 3D surface maps

To find the definitive line of intersection between the two surfaces, follow these steps:

  1. Use the Grids | Calculate | Math command to subtract the two grid files. Where the difference between the two surfaces is 0 is where they intersect.
    1. Click the Grids | Calculate | Math command.
    2. In the Grid Math dialog, click the Add Grids button.
    3. In the Open Grid(s) dialog, select both grid files and click Open. Select multiple grid files by pressing CTRL (on the keyboard) and clicking both grid files. If the grid files are in separate directories, then repeat adding the second grid.
    4. Enter B – A (subtracting the elevation grid, A, from the limestone grid, B) in the Enter a function... field.
    5. In the Output Grid File section, update the output grid by clicking on the Change Filename icon,  .
    6. Click in the New layer type field, select Contour, and then click OK.
      Surfer's Grid Mth dialog
      Surfer Grid Math: Add both grids as Input Grids in the Grid Math dialog,
      enter the function to subtract the elevation grid from the limestone grid, and click OK.

  2. Create a contour map showing only the zero contour line. This zero contour line marks the location of the intersection between the limestone surface and the ground surface, which is the contact line you put on a geologic map.
    1. Click Home | New Map | Contour, select the grid file created above and click Open.
    2. In the Contents window, select the Contours layer.
    3. In the Properties window, click the Levels tab.
    4. Change the Minimum contour to 0.
    5. Change the Maximum contour to 1. Now only the 0 level is shown. This is the line of intersection between the two surfaces.

    Surfer: contour map with zero-level contour line
    Create a contour map showing the zero-level contour line.
    This line represents where the limestone surface meets the ground surface.

  3. Overlay this map with other map types by clicking Home | Add to Map | Layer and adding other layers to it, such as a shaded relief map.
    1. Select the contour map and click Home | Add to Map | Layer | Color Relief.
    2. Select the elevation grid file and click Open. The contact between the two surfaces is displayed over a shaded relief of the elevation.
    3. To fill in where the limestone surface is above the elevation of the ground, select the contours layer in the Contents window.
    4. In the Properties window, click the Levels tab.
    5. Check the Fill contours check box.
    6. Click the (…) button to the right of Fill colors.
    7. In the Colormap dialog, select the color node on the left and choose a different color, such as Baby Blue from the Color drop down menu.
    8. Change the Opacity to 40% and click OK.

    Surfer: overlay contact line between two surfaces
    Overlay the contact line between the two surfaces with
    other map types, such as a shaded relief map.

  4. Export the line of intersection to other formats for use in other software.
    1. In the Contents window, select the Contours layer.
    2. Click Map Tools | Layer Tools | Export Contours.
    3. In the Export dialog, enter the File name.
    4. Click Save as type and choose to save the contact line as an AutoCAD DXF file, a 2D or 3D ESRI Shapefile, or as an XYZ text file.

Should you have any questions about calculating the line of intersection between two surfaces in Surfer, please email



Updated November 9, 2018

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


Please sign in to leave a comment.