2

I am missing auto-complete in QGIS. From other answers I understand that you need to snap around the hole and you can't just let QGIS fill the hole, is that correct? It's bothersome when it's a lot of verticies.

I am used to the function from ArcView 3.2 before after

3
  • 1
    You can enable tracing after enabling the advanced digitization toolbar - at least it seems like you're searching for this.
    – Erik
    Commented Jun 21, 2021 at 8:50
  • 2
    Here the documentation for tracing, as mentioned by @Erik: docs.qgis.org/3.16/en/docs/user_manual/working_with_vector/…
    – Babel
    Commented Jun 21, 2021 at 9:01
  • Enable snapping and in the snapping options turn on topological editing. (Snapping is on, and topological editing are on when they are grayed, which may seem counterintuitive because in other contexts graying typically means the option is not available.) It should work like the auto complete tool in ArcGIS.
    – John
    Commented Jun 21, 2021 at 13:46

2 Answers 2

1

Since QGIS 3.20, you can use the newly introduced Streaming digitizing mode. In combination with tracing (as mentioned in the comment by @Erik), this allows for a very neat and easy way to create polygons covering the holes, without clicking for vertices.

During digitizing, simply click R to toggle from normal to streaming digitizing mode. Than just draw freehand (move the mouse, without clicking) around the holes. Only once right-click to finish your polygon.

If you cover the whole extent of your polygons like this, all holes will be covered in one step. You will get one multipart-polygon that fills exactly all the holes. To get single-part polygons, select it, run Menu Vector / Geometry Tools / Multipart to singleparts and check the box next to Selected features only.

Drawing freehand polygons with streaming digitizin mode activated (1) and tracing activated (2). In red you see the mouse movement - this will create the polygon from which overlaps with the existing polygons will be extracted - you will only getg new polygons where the holes were:

enter image description here

Result: polygon fill color is set to transparent, so you see that there is no overlap (only at the upper left for demonstration purpose, created in the initial polygons):

enter image description here

1

A solution for many holes to fill at once. This algorithmic approach could be used with any software and could be fully automatized, here I show it for QGIS. See step-by-step screenshots below:

  1. Create the layer's bounding box. Let's call this layer Bounds.

  2. Run Menu Vector / Geoprocessing Tools / Difference, set Bounds as Input layer and the original polygons as Overlay layer. This creates the layer Difference.

  3. Run menu Menu Vector / Geometry Tools / Multipart to singleparts.

  4. Delete the parts that fall outside the initial polygon (thouse touching the outer ring of the bounding box). Select them, using select by expression with the following expression, then delete the selected feature:

     touches (
         @geometry,
         exterior_ring(
             geometry (
                 get_feature_by_id ('Bounds',1)
             )
         )
     )
    
  5. You're left with the holes only. Run Union to combine them with the initial polygon.

  6. Dissolve the Union layer to merge all features to one polygon.

Screenshot: Screenshots: 1: original polygon with holes in blue; Bounding box hached in red; 2/3: after running difference, only the holes and the part outside the initial polygon remains; the latter can be selected as those features that touch the outer ring of the bounding box (red); 4) after deleting, you remain with the initial polygon + holes; 5) Running Union, the initial polygon plus the holes are on the same layer; 6) Dissolved layer with the holes filled:

enter image description here

1
  • 1
    Thanks for the inupt, I improved the solution
    – Babel
    Commented Jun 11 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.