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:
- Click Home | New Map | Base.
- In the Import dialog, choose your SHP (or other vector data) file and click Open.
- Select the Base (vector)layer in the Contents window.
- Use the Home | Insert | Polygon command to draw the boundary for the contour lines.
- Press ESC or click the Home | Selection | Select command to end draw mode after you have drawn the polygon.
- 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.
- Click the Features | Edit Polylines | Break at Intersections
- Click Home | Selection | Select All | Block Select.
- Click and drag your mouse on the page to bulk-select all of the objects inside the polygon.
- Click Home | Selection | Select All | Invert and press DELETE to remove all of the objects outside of the polygon.
- Delete the drawn polygon if desired.
The above method is fast and should be used if you 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:
- Click Grids | New Grid | Grid from Contours.
- Click Browse in the Contour Source section of the Grid Contours dialog.
- In the Open dialog, choose your SHP (or other vector data) file and click Open.
- Select the attribute that contains the elevation information in the Select Field dialog and click OK.
- Set the Output Grid Geometry, Options, and Output Grid options to the desired values, or accept the defaults.
- Select the Add grid as layer to option and set the New layer type to Contour.
- Click OK in the Grid Contours dialog.
Next, add the NoData boundary to the map.
- Select the new map and click Home | Add to Map | Layer | Empty Base.
- Select the Base (vector) layer in the Contents window.
- Use the Features | Insert | Polygon command to draw the boundary for the contour lines.
- Press ESC or click the Features | Insert | Polygon command again to end draw mode after you have drawn the polygon.
Finally, assign the NoData values to the new grid with the NoData polygon boundary.
- Click the Grids | Edit | Assign NoData command. The Assign NoData to Grid dialog opens.
- Select the Contours layer in the Input Grid list.
- Select the Base(vector) layer in the NoData Polygon Boundary list.
- Select the NoData Outside option in the NoData Polygon Boundary list.
- Specify a file name in the Output Grid field.
- Select the Add grid as layer to option and select the Map in the list.
- Select Contour in the New layer type list and click OK.
- Delete or hide the original Contour layer in the map.
- Delete or hide the Base(vector) layer in the map, if desired.
Updated December 20, 2021
Comments
Please sign in to leave a comment.