Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In QGIS, is there a way to count the number of vertices of polygons and lines in a given layer, and create a separate field containing these values? I suspect it's a function somewhere in the field calculator but I can't find it.

share|improve this question

You can use the excellent 'Vertices Counter' plugin which does exactly this. You can see the step-by-step guide here:

Counting Number of Vertices in a Layer

share|improve this answer
Thanks Ujaval. I'm afraid python kind of scares me but I just got around to looking at your blog today and it works! Thanks very much and I'm sorry for not looking at this sooner. R – crichard75 Nov 30 '12 at 15:20

Look in the vector menu, there is a "extract nodes" tool.

share|improve this answer
Thanks Giovanni but it’s not quite what I’m looking for. I just tried “extracting nodes” and counting “Points in Polygon”. I’m afraid the shapefile I am dealing with consists of multiple abutting polygons. The polygons were created by snapping to vertex. Extracting nodes creates multiple overlapping points which end up in the count. I’m looking for a way to count the nodes of each individual polygon, so a square polygon may have 4 nodes, not the potential 16 nodes or more from abutting polygons. – crichard75 Aug 29 '12 at 19:07
Then you need to import your data into a fully topological gis = GRASS, you can do it in qgis using the grass plugin. – Giovanni Manghi Aug 30 '12 at 18:56
Thanks Giovanni – crichard75 Sep 6 '12 at 10:29

if you or anyone are interested with arcmap , this page - HowTo: Count the vertices for line or polygon features in ArcMap - can help you...


1. Right-click the layer to be evaluated in the Table of Contents and click Open 
Attribute Table.
2. From the Table Options drop-down, click Add Field to add a new field to the table.
3. Name the field VxCount and select Long Integer for the field type. Click OK.
4. Right-click the heading of the new field and click Field Calculator.

    The geoprocessing tool, Calculate Field, can also be used to populate the field.

5. Under Parser, select Python.
6. In the main expression box, set:

    VxCount = !shape!.pointcount

7. Click OK.

i hope it helps you...

share|improve this answer
Thanks Aragon. I'm going to try do this in QGIS as I don't have regular access to arcmap. R – crichard75 Nov 30 '12 at 15:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.