Bug report #17319

v.net category value

Added by Sergio Antonio almost 3 years ago. Updated almost 3 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:GRASS
Affected QGIS version:2.14.18 Regression?:No
Operating System:windows 8 Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:25217

Description

The dialog boxes of the v.net (GRASS GIS) tools available in QGIS allow the user to select the features to be used by entering the CATEGORY VALUES field. But the value used in the analyzes are not those of the cat column (see GRASS GIS) nor those of the id column (both, cat and id, belong to the attribute table). Please, what is the parameter (attribute) that controls CATEGORY VALUES?

NetworkProject.zip (85.6 KB) Sergio Antonio, 2017-10-22 03:40 PM

History

#1 Updated by Giovanni Manghi almost 3 years ago

  • Status changed from Open to Feedback
  • Assignee deleted (Sergio Antonio)

Is this a question or a bug report?

Is this about the tools in the Processing toolbox or the QGIS/GRASS plugin?

Could you please detail what operation are you trying to do and expected results?
please specify inputs (from attached project) and steps.

#2 Updated by Sergio Antonio almost 3 years ago

I was really in doubt when I clicked on "bug report", but for a user who is following manuals, tutorials and examples, the unexpected response seems to be a bug.
If I'm using a wrong column (attribute) to select which features I want to include in the analyses, this is not a bug. It would be a confusion of terminology (but I actually could not figure out what it could be).

THE PROBLEM
In the dialog boxes of the tools v.net.alloc, v.net.allpairs, v.net.distance, v.net.iso, v.net.salesman and v.net.steiner, when I use the "cat" values, the responses are inconsistent and are not related to this column of the attribute table. If this column is deleted, the tools mentioned continue to work, populated by some attribute that I still do not understand what it is.
Please, read the following: Vector object categories and attribute management at https://grass.osgeo.org/grass64/manuals/vectorintro.html

This problem occurs in QGIS Desktop 2.14.18 with GRASS 7.2.1, using the tools listed above.

DETAIL OF OPERATIONS
The project contains:
a) a layer with a network, where SENT_DUPLO means double-path and SENT_UNICO means single-handed path (both in meters).
b) a layer of points representing students, where "id" means the standard identifier of the QGIS (values ​​in the range: 1001 - 1017) and "cat" (values ​​in the range: 2001 - 2017) refers to the category to be used as "Category values" in the v.net _ dialog boxes. This attribute (cat) is used in GRASS GIS, according to manuals, tutorials ...
c) a layer of points representing schools, where we have "id" (random values ​​and NULL) and "cat" (values ​​in the range: 7 - 1).

First attempt - layer: network_distance_cat_student-1_10_15_cat_school-1_2_3
Tool: v.net.distance
Input vector line layer: network
Input vector point layer (from): students
Input vector point layer (to): schools
Threshold for connecting to the network: 50 (default)
From category values: 1,10,15
To category values: 1,2,3
Network: c: \ ... \ network_distance_cat_student-1_10_15_cat_school-1_2_3

The result is different of the one expected because there are no categories with these values ​​in the attribute table (students layer): 1,10,15 (in fact we have: 2001,2010,2015).

Second attempt - layer: network_alloc_cat_1_to_3
Tool: v.net.alloc
Input vector line layer: network
Input vector point layer (from): schools
Threshold for connecting to the network: 50 (default)
From category values: 1,2,3
Network: c: \ ... \ network_alloc_cat_1_to_3

The result is different of the one expected because there are no matches between categories 1, 2, 3 with subnets 1 (purple), 2 (red), 3 (green).

Third attempt - layer: network_alloc_all_points
Tool: v.net.alloc
Input vector line layer: network
Input vector point layer (from): schools
Threshold for connecting to the network: 50 (default)
From category values: 1-1000
Network: c: \ ... \ network_alloc_all_points

The result is different of that one expected because there are no matches between categories 1, 2, 3, 4, 5, 6, 7 with subnets 1 through 7 (please, turn on and off each subnetwork to see mismatch).

Fourth attempt - layer: network_distance_cat_student-2001_2010_2015_cat_school-1_2_3
Tool: v.net.distance
Input vector line layer: network
Input vector point layer (from): students
Input vector point layer (to): schools
Threshold for connecting to the network: 50 (default)
From category values: 2001,2010,2015
To category values: 1,2,3
Network: c: \ ... \ network_distance_cat_student-2001_2010_2015_cat_school-1_2_3

The v.net.distance tool returns a error message because the algorithm does not find the categories with these values ​​in the attribute table (students layer): 2001,2010,2015, but they do exist.

Thank you.

#3 Updated by Giovanni Manghi almost 3 years ago

Sergio Antonio wrote:

I was really in doubt when I clicked on "bug report", but for a user who is following manuals, tutorials and examples, the unexpected response seems to be a bug.
If I'm using a wrong column (attribute) to select which features I want to include in the analyses, this is not a bug. It would be a confusion of terminology (but I actually could not figure out what it could be).

I can't study this detailed (thanks!) case at the moment. As I think you are Portuguese speaking please have a look here if it helps understand

http://qgis.pt/workshops_qgis2016/Analise_de_Redes_com_QGIS_PedroVenancio.pdf
http://qgis.pt/workshops_qgis2016/dados_exercicio_analise_redes.zip

#4 Updated by Sergio Antonio almost 3 years ago

OK, thank you.
While I was waiting for your answer, I continued my studies on the subject and concluded that the QGIS associates the values of the "Category Value" field with the row number of each feature (students or schools, in this case).
When the user populates the "Category Values" field with 1,7-10, 207, for example, QGIS assumes the features of the lines 1, 7, 8, 9, 10, and 207 of the attribute table.
For this reason, inconsistencies occur in the attached project.
So I suggest that the "Category Value" field be changed to "Row number feature value" or something better with this meaning.
"Row number", as we know, can be obtained by the @row_number variable, at any time.
The suggested material is very very good, but it does not solve my doubts.

#5 Updated by Alexander Bruy almost 3 years ago

IMHO this should be closed. As I understand this is question about GRASS tool usage, not a bug.

#6 Updated by Giovanni Manghi almost 3 years ago

Alexander Bruy wrote:

IMHO this should be closed. As I understand this is question about GRASS tool usage, not a bug.

agree.

#7 Updated by Sergio Antonio almost 3 years ago

I also agree, it's not a bug.
It is a confusion of terminology. It is enough for the user to know that Category Number is associated with the Row Number.
Please close this issue. Thanks!

#8 Updated by Giovanni Manghi almost 3 years ago

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

Also available in: Atom PDF