Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v.vect.stats creates cat & cat_ then fails #26921

Closed
qgib opened this issue Jun 1, 2018 · 6 comments
Closed

v.vect.stats creates cat & cat_ then fails #26921

qgib opened this issue Jun 1, 2018 · 6 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers GRASS

Comments

@qgib
Copy link
Contributor

qgib commented Jun 1, 2018

Author Name: Simon Dedman (@SimonDedman)
Original Redmine Issue: 19091
Affected QGIS version: 3.0.3
Redmine category:processing/grass


Grass processing toolbox element v.vect.stats counts point layer data within polygon areas layers & calculates statistics. If you want to calculate stats & counts for multiple fields in the points layer (e.g. you have data for various years) you have to repeat the process each time, selecting the layer and field, giving the resultant count & stats columns appropriate names, which produces a new polygon layer with the two new data fields appended, AND a field called 'cat'. If you use this new poly layer as the input for e.g. the next year's data, the output layer will already have 'cat' from the first run, so will create 'cat_'. The user likely doesn't care about these fields and there's no info presented during the process about that this is - it looks like a counter but I could very well be wrong. In any case: if you run the process a THIRD time, the code is defeated (presumably) because 'cat' is present so it tries 'cat_' which is also present, so it fails. Subsequently the user has to deduce that this is the problem with no help, then goto layer properties, source fields, edit, select cat & cat_, delete fields, unedit, save.

Proposal:

  1. have an option in the dialogue box to create 'cat' field and explain what it is. Turned on by default.
  2. Have cat field naming schema: cat0, cat1 etc, up to cat9999999 above which point it'll break the 10 character limit. Notwithstanding if you ran v.vect.stats 10 million times manually you'd experience the heat death of the universe before you hit the 10 character limit.
@qgib
Copy link
Contributor Author

qgib commented Jun 1, 2018

Author Name: Nyall Dawson (@nyalldawson)


This is an issue which should be fixed in grass itself, not qgis


  • status_id was changed from Open to Closed
  • resolution was changed from to up/downstream

@qgib
Copy link
Contributor Author

qgib commented Jun 4, 2018

Author Name: Simon Dedman (@SimonDedman)


Created here for reference: https://trac.osgeo.org/grass/ticket/3572#ticket

@qgib
Copy link
Contributor Author

qgib commented Jun 4, 2018

Author Name: Simon Dedman (@SimonDedman)


Module dev Markus suggests the problem could be solved if QGIS uses "v.out.ogr -s" to skip export of GRASS category ID ('cat') attribute, and feasibly boils in the "-m" switch as well, though I'm not sure what that does.
These could be options but he seems to think that's unnecessary.


  • status_id was changed from Closed to Reopened

@qgib
Copy link
Contributor Author

qgib commented May 23, 2019

Author Name: Alexander Bruy (@alexbruy)


Should be already fixed. Please test with master and latest 3.4.


  • resolution was changed from up/downstream to
  • status_id was changed from Reopened to Feedback
  • operating_system was changed from Win10 to

@qgib qgib added Feedback Waiting on the submitter for answers Bug Either a bug report, or a bug fix. Let's hope for the latter! GRASS labels May 25, 2019
@alexbruy
Copy link
Contributor

@SimonDedman please test with master and latest 3.4.8

@alexbruy
Copy link
Contributor

Closed for the lack of feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers GRASS
Projects
None yet
Development

No branches or pull requests

2 participants