qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.59k stars 3k forks source link

Matrix distance does not output right fields when using N x T matrix type #29165

Open qgib opened 5 years ago

qgib commented 5 years ago

Author Name: Harrissou Santanna (@DelazJ) Original Redmine Issue: 21347 Affected QGIS version: 3.5(master) Redmine category:processing/qgis


When running the distance matrix algorithm on all the features using the "Standard (N x T) distance matrix" type, you get columns corresponding to all target features. When limiting the number of closest features to k, you get k new columns that do not necessarily match the closest features. I would expect to get:

In the attached screenshot, k=1. Instead of a single column (28) corresponding to feature 0 target, I'd expect more to be added (3,6,8,9,10) as closest points to other inputs. So I have for each input its closest point and not the closest point of the first fetched feature which is neither the minimal distance between the layers.


qgib commented 5 years ago

Author Name: Giovanni Manghi (@gioman)


Did it worked as expected for example in 2.18?


qgib commented 5 years ago

Author Name: Harrissou Santanna (@DelazJ)


Never used it (came across this while documenting the algorithm). And don't have a 2.18 build anymore.


gioman commented 3 years ago

@DelazJ The option seems to make sense only when using "linear N * K x 3" distance matrix, not sure it can be disabled when using the "standard (N x T)" matrix.

DelazJ commented 3 years ago

@gioman I can't tell if it's not compatible (code wise) and the GUI is not clear whether it's incompatible. I understood k with standard NxT as a way to limit target features (to the closest) instead of outputting the whole target layer columns. Also using k<>0 outputs a table different to the linear scenario.