2

I have a point layer with houses and their prices, and I have a polygon town layer.

If i join the point layer to the polygon layer in QGIS using 'spatial join' will the price associated with the specific town polygon be the average price of all the points associated in the polygon?

  • 1
    Why not try it and find out? If you have a large data set and are worried about long processing time, copy a subset of the data to use for your test. – csk Mar 6 '18 at 21:45
2

You can use 'join attributes by location' (vector > data management tools)

enter image description here

You can make following statistics: sum, mean, min, max or median. You can do them all, or you can choose which ones you want. There will be a column with values for each calculation.

  • Thank you so much this is exactly what I was looking for! – Will.S89 Mar 7 '18 at 16:25
0

this can very easy be done by using a virtual layer, asuming you have two layers towns(polygon) and houses (point) where the price column is named value in the following example:

select towns.geometry, towns.name, avg(houses.value) from 
houses left join towns on
st_intersects(houses.geometry, towns.geometry)
group by towns.name

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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