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: 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. There are 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, it can be addressed in Surfer:

  • If the grids do not have the same dimensions or grid resolution, you can either regrid 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 Grid | Convert to convert one grid to an XYZ data file, open the data file in the Surfer worksheet, click Data | Coordinate System | New Projected Coordinates and convert the coordinates to be in the same coordinate system as the other grid. Save and close the data file. Then click Home | Grid Data | Grid Data and regrid the data with the same grid geometry as the other grid.

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 example purposes, 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 Maps | Surface, select one grid file and click Open.
  2. Click on the surface map to select it.
  3. Click Map | 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: 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 the function B – A (subtracting the elevation grid, A, from the limestone grid, B).
    5. In the Output Grid File section, update the output grid by clicking on the Change Filename button, .

      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 0. Now only the 0 level is shown. This is the line of intersection between the two surfaces.

    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 | Shaded 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.

    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 January 30, 2017

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


Please sign in to leave a comment.