# Split polygons by number of vertices

I've got a polygon shape layer, and each polygon has 200 or more vertices. I need to divide every polygon by attributes (vertices). Each polygon can not have more than 80 vertexes. I only found plugins that divide polygon by area.

• I do not understand what attributes have to do with vertices. Could you clarify? – user30184 Jan 16 '18 at 14:58
• Is the attribute you want to split by number of vertices per polygon, or is there another attribute of the polygon layer that you are using to select subsets of vertices? It's not clear exactly what you mean. – lambertj Jan 16 '18 at 16:36
• Attribute is number of vertices per polygon. Did I helped you? – Andy Jan 16 '18 at 18:16
• Does configuration of the polygons that are created matter, or is any random selection of <80 vertices per polygon OK? Knowing more about your problem and dataset would help. – lambertj Jan 16 '18 at 20:38
• Also, make sure to add @username (e.g., @lambertj) when replying to a comment with another comment so the person is notified that you responded. – lambertj Jan 16 '18 at 20:38

## 2 Answers

I'm not sure i understand exactly what you are trying to do, but first things first, you will need this formula : `num_points( \$geometry )` or `num_points( \$geometry )-1` if you ignore the last closing point. It gives you the number of vertices (points) that is been used to create each polygon. Then is when i'm not sure i understand what you need to do.

• I used plugin called Vertices Counter to get the number of verices for every polygon in attribute table, now I need to split polygons with 81 and more vertices into polygons with lower number of vertices. – Andy Jan 17 '18 at 6:24
• Seems quite difficult to me. From where will you split ? Do your start from a centroid towards each vertice ? It would be easier if you had an application case, for the moment, I can't even imagine what your are doing, except slicing hairs in 4 (like we say in french :D) – gisnside Jan 24 '18 at 18:22

I would give the Polygon Splitter plugin a try, as it looks like you're using QGIS. It will allow you to split polygons into equal parts vertically, horizontally, or a combo of the two. It won't split by number of vertices, but if you play around with the splitting a little you should be able to ensure that all the polygons fall below your 80 vertex threshold.

An example of Polygon Splitter from another question: polygon split with predefined area