I have two vector layers:

  • the red one is 'Landuse'
  • the orange is a vector extent of land below '1mAHD' extracted from a 5 meter DEM.

I want to clip out the 'Landuse' under the '1mAHD' layer. They both have fairly complex geometry as you can see. The "Clip" is taking forever so I'm wondering if there's a Plugin, script or series of steps I could follow to complete this task faster and easier and without getting into doing things manually. i.e. editing all the small holes out!

enter image description here

  • 2
    Do your layers have the same CRS? How many features do you have in each layer? You may try also with a spatial index
    – Taras
    Jun 3 at 4:30
  • 1
    Would simplifying (generalizing) the geometries before running the clip operation be an option? Or do you need the layers to retaint the excat precision?
    – Babel
    Jun 3 at 7:04
  • 1
    To create a spatial index: right click layer / properties / source tab / Geomtry / Create spatial index (if not already existing)
    – Babel
    Jun 3 at 7:07
  • 1
    I would try to do it in Arcgis in foreground. But if it should be done in QGIS, I would manually or programmatically split both layers to parts and try to test clip on chunks then merge outputs in one layer. Jun 3 at 7:26
  • 1
    Did you run a Check validity on both layers prior to running the clip? Even seemingly unimportant self intersections might create an issue in a complex overlay. If you have them run the Fix Geometries tool and then run your clip on them. You might even run a v.clean GRASS tool first. Are you using the Vector Overlay Clip or GDAL Clip Vector by mask layer? Over the years if one tool took too long I'd try another. The GRASS v.overlay tool is a third option. I've found GRASS tools to be very powerful.
    – johns
    Jun 3 at 13:36

Thanks everyone who posted suggestions. The solution was a mix of many of those comments. The process used to perform the clip successfully was as follows. The following processes were performed on the layer as 1 polygon.

Image A image_a

  • First, I used the "Delete Holes" feature with a threshold setting of 10,000,000. This effectively removed any internal holes in the polygons
  • Second, I used the "Smooth" tool to reduce the number of boundary vertices in the polygon.
  • Third, I used the "Multipart to singleparts" tool (as Q would not let me edit the whole layer as 1 polygon)
  • Fourth, I had to manually edit all the small artifacts from the outsides of the clipping polygons to clean it up (Took a while !....). The resulting Polygon is shown in the second image.

Image B image_b

  • Once these tasks were performed the "Clip" tool worked.The final output was the clipped landuse under 1mAHD. I was then able to calculate areas of each of the landuses under 1mAHD. Obviously there was a loss in accuracy due to the holes and external polygons being removed, but this was acceptable at the scale I was working with.

Image C image_c

It seems that when the clipping overlay and underlying layers are highly detailed that the clipping tool does not work. Although it might on a smaller dataset. It would've been good to retain the detail and still perform the clip but the result was satisfactory nonetheless, with the steps detailed above.

Hope this useful for someone else!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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