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.


  • 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, 2017 at 14:53
  • 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. Aug 25, 2017 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, 2017 at 16:23

1 Answer 1


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

check validity

  • 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, 2017 at 13:53

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.