Follow

How can I crop a SHP file contour map in Surfer?

Q: I have contours in a SHP file and I want to limit them to only appear inside an irregular boundary. How can I do this in Surfer?

 

A: There are two methods for cropping, or limiting the extent of, vector data contour lines to a specific region. You can edit the lines with the Break at Intersections command, or you can convert the contour lines into a grid file and assign the NoData value to grid nodes outside the desired boundary.  

 

To limit or crop the contours in a vector file like a SHP file in Surfer:

  1. Click Home | New Map | Base.
  2. In the Import dialog, choose your SHP (or other vector data) file and click Open.
  3. Select the Base (vector) layer in the Contents window.
  4. Click Features | Group | Start Editing to start editing the base (vector) layer.
  5. Use the Home | Insert | Polygon command to draw the boundary for the contour lines. 
  6. Press ESC or click the Home | Selection | Select command to end draw mode after you have drawn the polygon.
  7. Press CTRL+A or click and drag your mouse on the page to bulk-select the drawn polygon and all of the polylines it intersects.
  8. Click the Features | Edit Polylines | Break at Intersections command.
  9. Delete all of the polylines outside of the polygon.
  10. Delete the drawn polygon if desired.
  11. Click Features | Group | Stop Editing when you are finished editing the features in the base (vector) layer.

 

The above method is fast and should be used if your are satisfied with the contour lines appearance in the base map. However, the following method is recommended if you wish to use all of Surfer's contour layer features with the contour lines.

 

First, to convert the contour lines into a grid file:

  1. Click Grids | New Grid | Grid from Contours.
  2. Click Browse in the Contour Source section of the Grid Contours dialog.
  3. In the Open dialog, choose your SHP (or other vector data) file and click Open.
  4. Select the attribute that contains the elevation information in the Select Field dialog and click OK.
  5. Set the Output Grid GeometryOptions, and Output Grid options to the desired values, or accept the defaults.
  6. Select the Add grid as layer to option and set the New layer type to Contour.
  7. Click OK in the Grid Contours dialog.

Next, add the NoData boundary to the map.

  1. Select the new map and click Home | Add to Map | Layer | Empty Base.
  2. Select the Base (vector) layer in the Contents window.
  3. Click Features | Group | Start Editing to start editing the base (vector) layer.
  4. Use the Features | Insert | Polygon command to draw the boundary for the contour lines. 
  5. Press ESC or click the Features | Insert | Polygon command again to end draw mode after you have drawn the polygon.
  6. Click Features | Group | Stop Editing.

Finally, assign the NoData values to the new grid with the NoData polygon boundary.

  1. Click the Grids | Edit | Assign NoData command. The Assign NoData to Grid dialog opens.
  2. Select the Contours layer in the Input Grid list.
  3. Select the Base(vector) layer in the NoData Polygon Boundary list.
  4. Select the NoData Outside option in the NoData Polygon Boundary list.
  5. Specify a file name in the Output Grid field.
  6. Select the Add grid as layer to option and select the Map in the list.
  7. Select Contour in the New layer type list and click OK.
  8. Delete or hide the original Contour layer in the map.
  9. Delete or hide the Base(vector) layer in the map, if desired.

 

Updated November 8, 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.