I have a polygon shapefile of many lakes, I also have a point shapefile of locations on those lakes where fish were caught.

The point shapefile contains the attributes: Fisherman_iD, Fish_Caught, Lat, Long.

The polygon shapefile contains the attributes Lake_name, Points_per_polygon(PNTCNT)

Each point obviously has differing entries under the fish_caught field.

What I want to get is the average fish caught per lake (polygon).

So I need to have a total number of fish caught, per individual polygon, and then I can divide that by the PNTCNT file I create using the Points in a Polygon tool.

Ideas? I am relatively new to QGIS.

  • Are all the lakes together in the shapefile or each lake has its own attribute?
    – gusv2000
    Mar 6, 2013 at 18:36
  • All the lakes are in one shapefile
    – Chewy
    Mar 6, 2013 at 18:52
  • I don't understand the first part of your explanation. Why do you need a point shapefile of locations? If you do a points in polygon with the point shapefile (Fisherman, etc) you get how many fisherman are in any lake, multiply by the number of fish caught and you have the No. of fish in each lake.
    – gusv2000
    Mar 6, 2013 at 19:00
  • 3
    Have you tried "Join by location"? You can select to "sum" attribute values.
    – underdark
    Mar 6, 2013 at 19:21
  • Thanks! Join by location worked in the end! Love this forum =)
    – Chewy
    Mar 7, 2013 at 22:54

2 Answers 2


If getting PostGIS set up right now is more than you want to get involved with, you can get by with probably much less effort in the program you have chosen.

You will want to assign to each of your points the name of the lake so you can sum the catch by the lake variable. This is what ArcGIS folks call a spatial join. In qgis parlance, you can do a couple of things:

  • Points in polygon, assigning count of points to polygon (but this would not retain categories of the point layer, so you will probably rather
  • join based on location. This you find in Vector -> Data Management Tools -> Join Attributes by Location.

enter image description here

enter image description here

  • +1 for this answer. What you could then do is export & open the resulting table in excel (or similar) and make a pivot table. Row labels: lake_name; values: average of Fish_Caught.
    – dez93_2000
    Feb 5, 2015 at 23:02

If you import your data into a PostGIS or Spatialite database, this is a pretty simple task for a spatial SQL query. It would be something like:

SELECT l.lake_name, avg(f.fish_caught)
FROM lakes l, fish f
WHERE ST_Intersects(l.geom, f.geom)
GROUP BY l.lake_name

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.