0

I am trying to average all the data for one attribute in a particular census tract from the road segments data that lies inside of them. The documentation states that you can sum average etc. data by using join attributes by location. When I go into this feature it does not give me any option to choose sum or average the data. I select the attribute column I want to pass to the polygon layer to I can select the column I want to move to the layer, but not do any calculations. When I choose PM2 it just gives me a column in the new polygon layer labeled PM2 with null values. What am I missing?

This is my polygon layer attribute file (to sum the values INTO)

This is the street layer that I want to take the PM2 data FROM:

This is the "join attributes by location"

1 Answer 1

2

You would have to use the tool Join attributes by location (summary).

Feel free to look at this tutorial

4
  • Thanks! I am not super familiar with QGIS and never keep the processing toolbox turned-on- and have only a fraction of the capabilities in the menus. Have to remember this Cheers!
    – PattyB
    Commented Apr 2, 2023 at 12:43
  • That tool also does not sum. It can find min, max median but sum has some problem, it does not produce SUM column, even if there are more than one intersecting features, which min max can separate. Commented Sep 14, 2023 at 15:36
  • A correction to my comment: min() max() summaries can calculate on even string fields it seems. After I created a new field with to_int(), I was able to calculate sum and mean. So we need to be cognizant of the field type. Commented Sep 15, 2023 at 6:52
  • @GürayHatipoğlu I don't know what the mean or sum of a text can possibly be. For min/max, don't forget that text comparison is done (can be done) character by character, so 2 > 10000 and ' 1 < 20000'. Also text comparison is locale dependent. ==> always use the proper field type if you want to do math.
    – JGH
    Commented Sep 15, 2023 at 14:11

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.