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

I found the following link to a post saying that a count lines in polygons had been added to ftools for QGIS:

However I can't find how to access this feature nor any online discussion of how to do this - can anyone help?

Alternatively, are there any other tools that will allow this?

I have a hexagonal grid and want to count the number of animal track paths that go through each cell for a migratory distribution map.


share|improve this question

I couldn't find the field count in the fTools anymore (QGIS 2.0). But I managed to get the number of lines within a polygon using the plugin MMQGIS. Assuming you have a line layer test.shp and a polygonlayer buffers.shp you have to do the following:

Choose MMQGIS > Combine > Spatial Join

Select the parameters:

Output Shape (Target) Layer: buffer.shp

Spatial Operation: Intersects

Data (Join) Layer: test.shp

Attribute Operation: First

Output File: example.shp

The output file example.shp contains the attribute count, which gives you the number of lines within each polygon.

share|improve this answer

As already mentioned in the QGIS wiki link you provided you can find the tool in the ftools sextante toolbox. The Name is "Sum Line length" and it needs a polygon and a line shape. It returns the absolute line length intersecting the polygon as well the number of lines. Returned values are added to the attributetable of the output.

enter image description here

If the toolbox doesn't show up, you have to activate it first (Sextant Toolbox options). If it still doesn't show up you probably have to upgrade your QGIS to the newest development version (1.9 Master)

share|improve this answer
The development version should not be used in production environments. – steko Dec 18 '12 at 22:54
why not? Because all new features aren't stable and results not verified? If you apply this logic in a wider frame, you shouldn't even use the user coded plugins because they are constantly changed and could give unverified results. This is an Open Source Project we're talking about and many OS-Projects use the bleeding edge of the available software. Trust your head instead of a version number! If you can't do this, then better stay with commercial software. – Curlew Dec 18 '12 at 23:59
You can run both 1.8 and master build side by side so you can use features like this from master then go back to 1.8 if it makes you feel safer. – Nathan W Dec 19 '12 at 0:35
Thanks so much for the guidance - I hadn't found this toolbox. This worked fine in QGIS 1.8. – KimS Dec 19 '12 at 1:06

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.