1

I'm getting some weird output after performing the "Join attributes by location" tool inside QGIS 3.10. Below is a shapefile representing watersheds in South Africa. I'm only interested in the watersheds in direct contact with the sea (in green). As you can see, displayed in white are watersheds I rejected as they are endorheic basins, i.e. with no outflow.

enter image description here

I also have a point shapefile, each point is an average rainfall.

enter image description here

What I'm trying to do is very simple, it is just to join the rainfall data to the watershed polygons, so I can have an idea of the rainfall amount in each one. However, when I perform the tool, rainfall data is assigned to every basin, even the endorheic ones, as shown in the picture below.

enter image description here

The join tool was simultaneously performed using either "intersects", "contains" and "within" as geometric predicate. My goal is just to have the rainfall data for my targeted basins, not the endorheic ones.

2
  • Your data rainfall data look like more raster data than point data (but it could be lots of very close points) could you confirm that it is indeed point ? Also if you join point to the polygon the output should be equivalent shaped polygons, by your picture it look like you get a shape equivalent as your rainfall data, are you sure you set the join in the right order ?
    – J.R
    Commented Feb 5, 2020 at 12:42
  • @J.R thanks for your input. Indeed you are right, the rainfall data comes from a raster I have polygonised. Would that be an issue? Actually I want the shape to be in points, for further analysis.
    – Tim56
    Commented Feb 5, 2020 at 12:50

1 Answer 1

2

Join by location won't work between raster and polygon, you could either turn your raster to points (look for the "Raster Pixels to Points" tool in the Vector creation category) and then join by location or use the "Zonal Statistics" tool (in raster analysis) to append to your polygon statistics (sum, count', average, ...) from the contained raster cells.

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.