Generate a Clip Boundary
In order to clip a contours shapefile, you will need to set up another vector layer to act as the clipping boundary.
In this tutorial, we will create a new vector layer (polygon feature) to be used as the clip boundary. You may also use another existing layer to clip your contours, in that case, skip to Step 3. From the top menu in QGIS, navigate to:
Layer → Create Layer → New Shapefile Layer
In the New Shapefile Layer menu, we recommend updating the following settings:
- File Name: navigate to the folder where you would like to save your shapefile, and give your file a name.
- Geometry type: in this example, we are going to use polygon so that we can clip the contours to a rectangular shape
- Coordinate system (dropdown menu): It is important to set the correct coordinate system when generating your new shapefile layer, otherwise you may run into errors in the steps that proceed.
Once you have added a new shapefile layer with the correct input settings, toggle editing mode on. To do this:
Right-click on your shapefile layer (in this case “Clip_Boundary”) → Toggle Editing
At this point, you can draw your polygon using the Add Polygon feature in the top menu.