I am trying to join attributes from a vector polygon layer to a vector points layer wherever a point falls inside one of the polygons.

I tried to use the QGIS 'join attributes by location" tool, setting the points shapefile as the target layer, polygons as the join layer, and 'within' as the geometric predicate. The operation fails immediately upon starting. The log contents:

Algorithm Join attributes by location starting...

unknown See log for more details

The points shapefile is fairly small (~900 points) while the polygon layer contains many features (~3M), although I don't think this should be an important factor. Interestingly, I have been able to run the operation in reverse (switching the target and join layers and using 'contains' as the geometric predicate) successfully, however this is not what I need to do.

I have also tried using "Add polygon attributes to points" from the SAGA toolbox without any luck. (I will post the log contents if it helps)

Is there a possibility that there is something wrong with the geometry of this shapefile? I have also tried to save to a new vector layer, or to copy the points to a fresh layer, with no change in result.

Running QGIS 2.18 on Mac OS X El Capitan

  • Is one of the files open elsewhere? You could also try converting the files to GeoJSON and then back again to Shapefiles. I've had success with this at times when there may be a slight corruption in the data. – Jamie2483 Jan 6 '17 at 16:17
  • Two suggestions: 1) Check the polygon layer for invalid geometry using the Topology Checker plugin. Invalid geometries make QGIS unable to figure out what is inside a polygon. 2) Try the long-term release version of QGIS (currently 2.14). Maybe the 'join attributes by location' tool is broken in the latest version. – csk Jan 6 '17 at 16:24
  • @Jamie2438 I just tried this, and interestingly the GeoJSON output has no geometry, only an attribute table. This seems pretty odd and might point toward a corruption in the data. – corvus Jan 6 '17 at 16:43
  • @csk thanks for the suggestions. I will try the topology checker plugin; I hope to avoid reverting to 2.14 just for this, but might try that if I can;t figure anything else out. – corvus Jan 6 '17 at 16:43
  • Just noticed that you mentioned the polygon layer has several million features. That many features may be causing your issue. Make sure you have the 64 bit version, and under settings > rendering > check the box next to "Render layers in parallel using many CPU cores." Also try adding a filter to the polygon layer and run the tool on just a subset of the data. – csk Jan 6 '17 at 17:07

Your Answer

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

Browse other questions tagged or ask your own question.