Follow

How can I remove all points outside a polygon in Surfer?

There is not a way to automatically remove points (in a post or base map) outside a polygon boundary in Surfer, however, there are a couple of workarounds:
 

Method 1: Manually remove the points from the data file

This method is good if there are just a few points outside the boundary (less than 50) and involves the use of the Track Cursor command. You would use Track Cursor and click on points in a post map, and those points are highlighted in the worksheet. You can then delete the points in the worksheet, save the file, and reload the data. Those points will then be removed from the post map. If you have the plot and worksheet windows in a tiled view, then it makes editing of extraneous or other specific data points very easy.

The steps are:

  1. Create the post map in the plot window (Home | New Map | Post | Post, select the data file and click Open).
  2. Select the post map and click Home | Add to Map| Layer | Base, select your BLN file and click Open. Now your polygon is on top of the posted points.
  3. Click to File | Open, select the data file again, click Open, and the data file opens in the worksheet window.
  4. In the worksheet window, if your X and Y data columns are not columns A and B, click Data | Data | Assign XYZ Columns to assign the correct columns to your X and Y data.
  5. Click View | Windows | Tile Vertical to arrange the windows next to each other.
  6. Enable cursor tracking by clicking Map Tools | Layer Tools | Track Cursor.
  7. Click in the plot window near one of the points outside the boundary, and that point is highlighted in the worksheet window.
  8. Click in the worksheet window and edit or delete the point from the worksheet.
  9. Then click back in the plot window near your next point and that point is highlighted in the worksheet window. Remove that point.
  10. When you are done removing all the points from the worksheet, click File | Save As to save the changes to a new data file.
  11. Select the Post layer in the Contents window and in the Properties window on the General page, click the Open File button, and load the new data file as the data file for the post map.

 

Method 2: Blank the grid outside the boundary, and identify the points that fall in the blanked areas with Grid Residuals

This method is good if there are a large number of data points outside the boundary, or if you are using Surfer 8 or previous. It involves using Grids | Residuals on a blanked grid to create a new data file. The data points that lie in the blanked regions (outside the polygon) are easy to identify in the new data file.

The steps are:

  1. Click Grid | Data and grid the XYZ data from the points.
  2. Click Grid | Blank, select the grid file and click Open.
  3. Select the BLN file containing the polygon and click Open.
  4. Give the blanked grid a new name and click Save.
  5. Click Grid | Calculate | Residuals, select the new blanked grid, or click Browse to open the Open Grid dialog.  Find the new blanked grid file and click Open.
  6. Select the original data file you gridded, or click Browse to open the Open Grid dialog.  Find the new blanked grid file and click Open.
  7. Assign the correct XYZ data columns for the data file, specify a residual column, and click OK.
  8. This opens a worksheet. Highlight all the data columns and click Data | Date | Sort.
  9. Choose to sort by the Residuals column, in Ascending order, and click OK.
  10. Now all the data points that are within the boundary are listed at the top of the worksheet with actual data in the Residuals column. Delete all the other data rows that do not have data in the Residuals column.
  11. Click File | Save As and save this to a new data file. This new data file only has the data points within the boundary.
  12. Create the post map of this data file.

 

Alternatively, you could also use our MapViewer software. MapViewer has an option to identify the records in a region (or points in a polygon).

 

If you would like this option, please send in your request to surfersupport@goldensoftware.com.

 

See also: 

 

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