How to check the number of polygons