Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

share|improve this question
    
Are all the lakes together in the shapefile or each lake has its own attribute? –  Gus Velasco Mar 6 '13 at 18:36
    
All the lakes are in one shapefile –  Chewy Mar 6 '13 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. –  Gus Velasco Mar 6 '13 at 19:00
2  
Have you tried "Join by location"? You can select to "sum" attribute values. –  underdark Mar 6 '13 at 19:21
    
Thanks! Join by location worked in the end! Love this forum =) –  Chewy Mar 7 '13 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

share|improve this answer

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
share|improve this answer

Your Answer

 
discard

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.