5

I'm seeing the same problem to Clip or Intersection tool - QGIS giving empty files trying to use the Clip tool since upgrading to QGIS 2.4.0, but have not been able to fix the problem based on the responses there. I tried creating a simple example to ensure was not my data but am seeing the same problem.

I have a series of points & a polygon. I want to retain those points within the polygon only. Example of points and polygon

I use Vector -> Geoprocessing Tools -> Clip

Commands used

This results in an empty attribute table.

Options I've tried:

  • I have tried switching the Input and Clip layer in case I had these round the wrong way
  • Disable on the fly reprojections (confirmed the layers do overlap, they are in the same projection)
  • Checked through Properties to confirm both layers have CRS EPSG:4326 - WGS 84
  • I left this simple example running for approximately 40 minutes with no change in outcome in case I was just not leaving enough time (in previous versions this was successful in a short time span).
  • I have tried using other Geoprocessing tools to see if it is just clip - I do not receive any output with any of them.
7
  • Are those layers shapefiles? Clipping to csv files might not work. Have you saved and left the edit mode of the cliplayer? Please add the extent of those layers, as reported by properties, metadata tab.
    – AndreJ
    Aug 7, 2014 at 6:01
  • I had something similar. In my case, I was saving the output file into a location which required admin privileges (even though I was admin). It always generated an empty file because of that.
    – Joseph
    Aug 7, 2014 at 12:58
  • Andre - They are both created vector layers (as in created within QGIS) Joseph - I don't imagine that is the problem, I'm working in my normal files and have been able to save other things. The only thing I can find that has changed is upgrading to 2.4.0 (this worked previously in an older version).
    – Esme_
    Aug 8, 2014 at 4:18
  • "created within" as memory layer? Try to save them as shapefile or spatialite database before clipping.
    – AndreJ
    Aug 8, 2014 at 5:10
  • i am having the same problem empty clipped layer. I am new to QGIS some one told me easy way of solving this Jul 9, 2015 at 19:21

7 Answers 7

6

I had the same problem. Turns out that my mask layer I created wasn't in the same projection as the other layers. Right-click the mask layer and 'Set Layer CRS'. Mask then jumped somewhere else so deleted it and created a new one. Worked for me.

4

I had the same problem.

I think Johann Hurter has the best solution. In my case, for I don't know what reason, when I opened my shapefile it was not in its original CRS (previous manipulation error maybe). Because I activated the projection on the fly it was displaying it correctly on the background map. But when I was trying to clip with another layer it didn't worked.

I realized that the current CRS of my shapefile was wrong when I looked into the .prj file of other similar shpafile.

What you should do:

  1. Find the original CRS of both layers
  2. Set CRS of both layers to their original CRS
  3. Save as in the desired CRS which can be the current one (if you don't save nothing will change as Set doesn't modify the inner coordinates...)
  4. Clip
2

If you're dealing with a lot of data:

I want to retain those points within the polygon only. If this is your objective then, I agree with others - intersect is your tool.

I had the similar task (20k+ points / 17 polygons) with a same result. In my case the real problem was the amount of data, ways of solving it are:

  • use only selected features on the intersect/clip layer (and do the procedure more times)
  • decrease the number of columns in the polygon layer (this helped a lot)
  • add some pre-filters, anything that can decrease the amount of information.

hope this helps anyone.

1
  • Hi, I think this is my issue as well. I am using a slope raster but when converted it has over 4 million attributes. Problem is I cant dissolve them once they are a vector. How can I do this prior to converting it to a vector? Dec 1, 2016 at 18:29
2

Based on the picture you have posted, your issue looks to be that you are still in editing mode for the polygon layer (you can see the red crosses on the vertices). So the polygon is there but only for display purposes.

Save your edits and toggle editing off, and try the clip again.

0

I had the same issue. It turned out to be a difference in projection although I thought Qgis' 'on the fly' was clever enough to deal with this. Anyway, I reprojected the shp I wanted to clip and then it worked

0

Bit of a different situation over here but I was trying to do symmetrical difference operations on two layers that had geographic CRS's (EPSG:4326). Once I changed them to geometric layers with local stateplane CRS's the operation worked well.

-2

Thats not a bug. You have a point layer, point dont have an area (only 1 dimension) so you can't clip it. For doing what you want, you have to intersect them or make a spatial query with a contain.

4
  • I assume the asker wants the points inside the polygon. It works for me without any problem.
    – AndreJ
    Aug 7, 2014 at 8:23
  • Yes, sorry I tested it and it works for me too (but I still consider this procedure not completly correct in a theorical way of view). If the epsg are correct, as he says, I don't know where the problem could be.
    – Sergio
    Aug 7, 2014 at 9:14
  • Andre - are you by chance using 2.4.0 Desktop? I'm on 2.4.0 Desktop on Windows 7. Might help me pinpoint the problem. Thanks
    – Esme_
    Aug 8, 2014 at 4:36
  • I am using the same version on Windows XP and 7, both 32-bit QGIS.
    – AndreJ
    Aug 8, 2014 at 5:09

Your Answer

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

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