4

I've tried joining two point layers by location on QGIS 2.18.27 (Mac iOS 10.13.5 High Sierra), but some points in the new vector don't end up appearing. One point layer is an interpolated point layer of a line, with one point every 500 meters (we'll call this interpolated_point layer), and the other point layer is a point at every node of above-mentioned line layer (we'll call this the node_point layer), both set to World Mercator [EPSG:54004].

Points and attribute table for <code>node_point</code>layer Points and attribute table for the node_point layer

Points and attribute table for the <code>interpolated_point</code> layer Points and attribute table for the interpolated_point layer

New joined layer The node_point layer (left) and the new joined layer (right, using the Join attributes by location tool) with missing feature highlighted

I used the Join attributes by location tool in the Vector > Data management tools menu and set the node_point as the Target layer and the interpolated_point layer as the Join vector layer. The Geometric predicate is within and Precision is set to 500 m (so that if a point on the interpolated_point layer isn't within another point in the node_point layer, it'll try to get the attributes of the point within 500 meters; that is, that's how I think it works).

Dialogue box Join attributes by location dialogue box with entered parameters. points_mercator is node_point and interPoints_mercator is interpolated_point

I've tried checking the validity of the node_point layer and all the features node_point layer are all right, so I'm not sure what I'm doing. Reversing the Target and Join vector layer parameters don't change the (undesired) result either. Any thoughts? The expected result is that I have a new layer that has all and only the points from the node_point layer with the attribute tables combined by location.

Again, using QGIS 2.18.27 on a Mac iOS 10.13.5 High Sierra.

EDITS:

  1. Added screenshot of interpolated_point and node_point layers and their attribute tables (as suggested by @pdavis)
  2. Added screenshot of Join attributes by locationdialogue box with parameters used (as suggested by @pdavis)
  3. Added expected results (as suggested by @pdavis)
  4. Added CRS used
4
  • Do you get your expected result if you switch the target and join layers? I'm assuming there are more points in your interpolated layer than your nodes layer and that's why you're not seeing all your points?
    – pdavis
    Commented May 2, 2019 at 16:13
  • @pdavis nah, still don’t get the same results. Yes, there are more points in the interpolated layer than the nodes layer, but they’re all on the same line and nearly on top of each other, so I can’t think of why it can’t do at least a proximity join...
    – Lalochezia
    Commented May 2, 2019 at 19:17
  • Can you edit your question to include some screenshots - images of the layers in the map, the attributes tables, the 'Join by location' dialog box with your filled in parameters, etc. and even possibly what you expect the output table to look like?
    – pdavis
    Commented May 2, 2019 at 20:08
  • I have included edits @pdavis, hopefully the question is a bit clearer.
    – Lalochezia
    Commented May 6, 2019 at 15:09

1 Answer 1

2

Thanks for posting edits to help clarify. There are two things wrong here:

  1. You are not correctly understanding the 'within' predicate. This means that one geometry is fully contained within another geometry so using it with points doesn't make sense. The second answer in this post offers a succint explanation on geometric predicates. My guess as to why you are getting any returns at all is because you have so many points along the line, that one will fall 'within' your node points based on some default precision threshold used by the tool. But I don't know for sure . . .
  2. Apparently, the precision parameter in QGIS 2.x didn't work and has been removed for 3.x. See this post: Join Attributes by Location - Precision

Your operation is a fairly standard analysis and the best way that I've found to accomplish what you want (in QGIS) is to use the NNJoin plugin. Why QGIS doesn't have native tool to do this I can't understand. Maybe other readers of this post can elaborate.

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.