In Surfer, it is possible to assign NoData values to grid nodes outside of multiple polygons, however these polygons will need to be combined into a single complex polygon, or else the entire grid may be assigned NoData values. This is a result of the area outside one polygon being included inside the other polygon, and vice versa.
The area outside Polygon A includes Polygon B, and vice versa,
which causes the entire grid to be assigned NoData when using multiple polygons.
You can use the Features | Islands/Lakes | Combine command to combine multiple polygons into a single complex polygon, and then re-export the BLN to use in assigning NoData values to the grid. The exact steps are as follows:
- Click Home | New Map | Base | Base, select the original BLN file and click Open. A base map is created showing the existing polygons.
- In the Contents window, select the Base(vector) object.
- Click Features | Group | Start Editing.
- In the Contents window, click the button to expand the base layer, then select all the Polygon objects below the Base layer. Hold the CTRL or SHIFT key on the keyboard to select multiple polygons.
- Click Features | Islands/Lakes | Combine. Now the polygons are combined into a single complex polygon.
- Click Features | Group | Stop Editing.
- In the Contents window, turn off the axes by unchecking them.
- Click File | Export.
- In the Export dialog, enter a File name, change the Save as type to BLN Golden Software Blanking (*.bln), and click Save.
- In the Export Options dialog, on the Scaling page, make sure the Scaling source is set to Map.
- On the BLN Options tab, make sure the Break apart compound areas option is not checked and Outside is toggled in the NoData areas section.
- Click OK.
The BLN file that is created will contain one complex polygon and can then be used to blank the grid file outside the polygon.
If you are using Surfer 10 or previous, the polygons can be combined manually in the worksheet. To do this:
- Click File | Open and open the BLN file containing both polygons in the Surfer worksheet. Notice that above the points for each polygon there is header row with the number of points and the blanking flag.
- Remove the header row of the second polygon (select the two and click Edit | Delete).
- Repeat the first point in Polygon A after the last point in Polygon B. This will combine both polygons into a single complex polygon. The first value is repeated to close the shape to create a polygon instead of polyline.
- Update the header value to contain the total number of points in the Polygon A and Polygon B.
Editing the blanking file to create complex polygons resolves the issue of having the entire grid blanked.
In a more complex example, consider adding a third polygon. One complex BLN file with three polygons would appear as below.
Multiple polygons can be combined into a single complex polygon so that the entire grid is not blanked.
Also see the attached script conjoinBLN.bas which automatically converts a BLN file with multiple polygons into a BLN file with a single complex polygon. Download the script and open it in the Scripter program that comes with Surfer. Click Script | Run and follow the prompts. The files can be downloaded below.
Updated November, 2019