In QGIS, ring means an interior ring, IE a hole in an existing polygon. Fundamental to the concept of a ring is that it falls entirely within an existing polygon. This means that:
- The Add Ring tool cuts a hole in an existing polygon. Like using a cookie cutter to cut out and remove a piece of a cookie.
- The Fill Ring tool cuts a hole in an existing polygon, and creates a new polygon from the interior of the cut. Like using a cookie cutter to cut a hole in a cookie, but not removing the cut piece.
- The Delete Ring tool removes an existing ring and fills in the hole. Like smooshing a new piece of cookie dough into a hole cut out of a cookie.
Since the polygon you're trying to create is not within an existing polygon, you must use a different tool. Depending on what you're trying to achieve, you may want to either:
- use the Add new feature tool to create a new feature, or
- use the Split tool (Advanced Digitizing toolbar) on the underlying polygons. This will create multiple pieces, which you'll need to select (Select features tool, Attributes toolbar) and merge (Merge Selected Features tool, Advanced Digitizing toolbar).
If you are indeed using the Ring tools correctly and still getting the error
could not add ring since the inserted Ring is not contained in a feature the issue may be invalid geometry. When a polygon has invalid geometry, QGIS doesn't know where the inside of the polygon is. Since a ring must be placed inside a polygon, attempting to place a ring inside an invalid geometry will give this error.
Common geometry errors include:
- Duplicate vertices: one vertex directly on top of another.
- This is often caused by double-clicking when creating a polygon (very common in QGIS with people who also use ArcMap because in Arc you double-click to finish creating a feature).
- Can also be caused by having snapping on when creating a polygon or editing vertices.
- Self-intersection: the sides of the polygon cross. Sometimes creates an hourglass shape.
- Can also be caused by polygonizing a raster. Two diagonally adjacent raster cells will be polygonized with their corners at the same location.
To find and fix invalid geometry, use the
Check Validity or
Fix Geometry tools. See Fixing geometry validity errors in QGIS for more info.