4

I'm new in QGIS and I'm trying to do a Join attribute by location and Count points in polygon using a polygon shapefile and a points shapefile. After running these tools, an error message is printed:

"QgsFeature.setGeometry(QgsGeometry): argument 1 has unexpected type 'NoneType' See log for more details"

Even tho it creates a shapefile, I look into the returning shapefile and it creates some features over the area where points are located but it doesn't create features where other points are located. It would be great to know the cause of this problem and how to fix it.

points-polygons

underdark
  • 84,148
  • 21
  • 231
  • 413
Gustacro
  • 43
  • 6
  • Welcome to GIS SE! Could you tell us when that error has popup. After running the join or after running the count analysis? This will help us to understand the root of the problem. – ramiroaznar Aug 25 '17 at 15:29
  • the error popup after running the Join attribute by location -"QgsFeature.setGeometry(QgsGeometry): argument 1 has unexpected type 'NoneType' See log for more details" , and Count points in polygon - "NoneType' object has no attribute 'geometry' See log for more details". Both of the create a shapefile where no all the polygon are created to cover all the areas where the points are located – Gustacro Aug 25 '17 at 16:23
  • Are your layers filtered? do they have the same projection? something similar once happened to me and that was the solution. – Elio Diaz Aug 25 '17 at 14:53

1 Answers1

7

Could be an invalid geometry. Try running the check validity tool and fixing any errors that are shown

check validity

firefly-orange
  • 2,521
  • 6
  • 23
  • Thank you @firefly-orange, after applied check validity and remove Null Geometries to the shapefile polygons and shapefile points, the analysis tool (Counts points in Polygon) worked perfectly. – Gustacro Aug 26 '17 at 13:53