Bug report #4761

Distance matrix: k becomes k-1 when working with one layer.

Added by Borys Jurgiel almost 13 years ago. Updated over 7 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Processing/QGIS
Affected QGIS version:master Regression?:
Operating System: Easy fix?:
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:14625

Description

In order to replicate: use one layer (target point layer = input point layer), and k=2. Run any analysis.
It finds k=2 points: the input point itself and a second point. The first point is (correctly) dropped, so k becomes 1 instead of 2.

Associated revisions

Revision 580b9474
Added by Borys Jurgiel about 11 years ago

Merge pull request #769 from vinayan/topol

Fix #5181,#4761 - Ftools-Distance Matrix

History

#1 Updated by Borys Jurgiel almost 13 years ago

  • Estimated time set to 0.50
  • Priority changed from Normal to 6

I set priority to Urgent, as it produces false results.

#2 Updated by Borys Jurgiel almost 13 years ago

  • Crashes QGIS or corrupts data changed from No to Yes

#3 Updated by Borys Jurgiel almost 13 years ago

  • Subject changed from Distance matrix turns k into k-1 when working with one layer. to Distance matrix: k becomes k-1 when working with one layer.

#4 Updated by Giovanni Manghi over 12 years ago

  • Priority changed from 6 to High

#5 Updated by Paolo Cavallini over 12 years ago

  • Target version changed from Version 1.7.4 to Version 1.8.0

#6 Updated by Giovanni Manghi over 12 years ago

  • Assignee deleted (cfarmer -)

#7 Updated by Salvatore Larosa over 12 years ago

  • Crashes QGIS or corrupts data changed from Yes to No
  • Status changed from Open to Feedback

for me works fine as well as QGIS doesn't crash!

Can you share your testcase?

#8 Updated by Paolo Cavallini about 12 years ago

  • Target version changed from Version 1.8.0 to Version 2.0.0

#9 Updated by Giovanni Manghi about 12 years ago

  • Resolution set to worksforme
  • Status changed from Feedback to Closed

Closing for lack of feedback. Please reopen if necessary.

#10 Updated by vinayan Parameswaran over 11 years ago

This is a bug that has been there since Qgis 1.8. I can't share a shapefile now. In fact, it will not work for any file.

How to replicate:

  • Create a point layer with 4 point features.Populate Id field with unique values.
  • In distance matrix dialog, set input layer and target layer as the same layer.
  • set id field as input and output unique fields.
  • Output Matrix Type -> select Linear Matrix. Enable the checkbox 'use only nearest(k) points' and set its value to 1.
  • now ideally it should create a CSV file with four records because we chose a single neighbour only.
  • But the resulting CSV is blank
  • Now try increasing the nearest(k) value to 2.
  • now for each feature in the shapefile, there should be two rows in the csv. so there should be 8 rows. But you can see that there are only four rows.

I have submitted a pull request that addresses this issue here.
https://github.com/qgis/Quantum-GIS/pull/538

#11 Updated by vinayan Parameswaran over 11 years ago

  • Status changed from Closed to Reopened
  • Resolution deleted (worksforme)
  • Pull Request or Patch supplied changed from No to Yes

#12 Updated by Giovanni Manghi over 11 years ago

  • Status changed from Reopened to Feedback

I have submitted a pull request that addresses this issue here.
https://github.com/qgis/Quantum-GIS/pull/538

can the ptach be submitted to allow tests? cheers!

#13 Updated by Giovanni Manghi over 11 years ago

  • Pull Request or Patch supplied changed from Yes to No
  • Status changed from Feedback to Open
  • Estimated time deleted (0.50)

https://github.com/qgis/Quantum-GIS/pull/538

The request has been closed but not committed and I see that the bug is still there.

#14 Updated by vinayan Parameswaran about 11 years ago

below pull request should fix it..
https://github.com/qgis/Quantum-GIS/pull/769

#15 Updated by Borys Jurgiel about 11 years ago

  • Status changed from Open to Closed

#16 Updated by Giovanni Manghi over 7 years ago

The "ftools" category is being removed from the tracker, changing the category of this ticket to "Processing/QGIS" to not leave the category orphaned.

Also available in: Atom PDF