How do I merge two or more GRD or DEM files in Surfer to create a contour map?

There are a few ways you can merge GRD or DEM files.


Method 1. Overlay separate maps.

The first is to create separate contour layers for each grid and overlay them in the same map. This works well for most files:

  1. Click Home | New Map | Contour, select the first GRD or DEM file and click Open. That creates the map with the first contour layer.
  2. Select the map and click Home | Add to Map | Layer | Contour, select the next GRD or DEM file and click Open. That creates a new contour layer and adds it to the map. Now the map has two contour layers.
  3. Repeat for all GRD or DEM files you have so that all the contour layers are combined and displayed in the same map.


Method 2. Mosaic the grids.

The next method is to use the Grid Mosaic command to merge two (or more) grid or DEM files together into a single grid. You would create the map from this one combined grid file:

  1. Click Grids | Resize | Mosaic, select the first grid file and click Open.
  2. In the Grid Mosaic dialog click the Add button, select the second DEM and click Open.
  3. You have a choice of the Resample Method and the Overlap Method (what to do when the grids overlay and there are multiple sets of data in a specific area).
  4. Specify an Output Grid file name and location and click OK.


Method 3. Convert the grid to data, merge the data, and regrid.

If overlaying maps or mosaicking is not working as you expect, or the contact/seam just isn't looking right (perhaps due to NoData values), the third method is to convert the grids/DEMs to data files, merge the data files and remove the NoData values, and regrid the data. The exact steps are:

  1. Click Grids | Edit | Convert.
  2. Select the first grid or DEM file, in the Grid Info section note the Size (rows and columns) of the grid file, and click Open.
  3. In the Save Grid As dialog, select DAT XYZ (*.dat) as the Save as type, give the file a name and click Save.
  4. Repeat steps 1-3 for the other grid file, so you have two DAT files.
  5. Click File | Open, select one DAT and click Open. It will open in the Surfer worksheet.
  6. Scroll to the bottom of the file and click in the first empty cell in Column A.
  7. Click Data | Edit | Merge.
  8. Select the second DAT file and click Open. The new data will be appended to the bottom of the first file.
  9. Select all three columns (A, B and C) and click Data | Data | Sort.
  10. Choose Sort First By: Column C, Descending, and click OK.
  11. Now we want to get rid of the blanked nodes. The values could be the Surfer blanking value, 1.70141e+38, or in DEM files the value can be -32767. Select the first row with the blanking value in Column C, scroll to the last row that has the blanking value it in, hold the SHIFT key down and select the last row with the blanking value in Column C. That will select all the intervening rows.
  12. Click Data | Edit | Delete.
  13. Once all the blanking values are deleted from the data file, click File | Save (or File | Save As) and save the file to a DAT file.
  14. Click Home | Grid Data | Grid Data, select the DAT file and click Open.
  15. In the Grid Data dialog, choose the Nearest Neighbor gridding method and set the # of Nodes equal to that of the original grid file (noted in Step 2 above). Set the file path and file name for the output grid file and click OK.


Updated October 25, 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.