I'm using Distance Matrix to find the closest point between one set (4 points) and another set (4 points), detailed below. All results look okay except one, where the returned point is not the closest. Any ideas what is it that I'm doing wrong?
Set 1 (input)
Set 2 (target)
The output layer shows the following. However, TargetID for 1 should be 3, and not 2. By the way, I did another distance matrix layer where the "Use only the nearest (k) target point" was 0, giving an output of all distances between all points, and indeed the distance between 1 (bilbao) and 3 (oviedo) was smaller than the distance between 1 (bilbao) and 2 (alcala de henares), which suggests that qgis knows the correct distance between points but returned a wrong one when I'm looking for the nearest point only.
Distance Matrix layer