0

Basically, I have these area (part of a bigger map) containing many holes (e.g. lakes) I have thrown on the map some 1000 random points and I want now to count those that fall in that area. I already tried with "Data Management tools>Join by attributes" but I receive a geometry error. I also tried the "Vector>Count Points in a Polygon" but I still receive the geometry error. As I said before, I guess the issue is because the area I want to overlap with the random points contains holes. I would be really surprised to know that that one is the only reason why QGIS cannot count the points but I have to say I am a new to that software.

  • 5
    Not quite sure why you are dismissing the geometry error as insignificant when it should be the focus of your question. Interior rings ("holes") are valid in the polygon model, so these are not intrinsic errors. Once the geometry is repaired, the functions should operate correctly. – Vince Sep 20 at 12:26
  • Hello Vince, thank you for answering. Could you please tell me how can I understand what makes the geometry invalid or -if that is not of much relevance per se- repair it? – Guido Bongioanni Sep 20 at 12:44
  • 1
    Many errors can make a geometry invalid, though the full list depends on the GIS package. All you really need is to see if the repair tools available to you can detect and repair your error. – Vince Sep 20 at 13:29
  • Try adding a buffer of 0 (zero) to your geometry - some errors can be repaired with this simple trick. If not, use the Topology checker plugin and checkt your polygon for errors: docs.qgis.org/3.4/en/docs/user_manual/plugins/… – babel Sep 20 at 16:27
  • If you are using QGIS 3x, in the Processing Vector Geometry tools you can try Check Validity to find geometry errors and Fix Geometries to fix some. I've used these often. There is also a Check Geometries tool which can look at geometry and topolgy errors. Geometry errors could explain the problems you had with the tools you used. I'll add another tool you could use: Select by Location in Vector -Research Tools. – johns Sep 20 at 16:46

Your Answer

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

Browse other questions tagged or ask your own question.