Opened 18 years ago
Closed 15 years ago
#289 closed bug (fixed)
GRASS Edit: don't force category 0 if none specified
Reported by: | Owned by: | rugginoso | |
---|---|---|---|
Priority: | major: does not work as expected | Milestone: | Version 1.0.3 |
Component: | GRASS | Version: | Trunk |
Keywords: | Cc: | lami@… | |
Must Fix for Release: | Yes | Platform: | All |
Platform Version: | Awaiting user input: | no |
Description
When I digitize a Grass vector in QGIS and add a feature using the 'next not used' category mode, the first category used is '1'. But, if I digitize a feature in 'no category' mode, add after that add a 'new' category in the Grass 'attributes window', the category added is '0'.
In both cases category '0' should be used as the first one.
Maciek
Change History (8)
comment:1 by , 18 years ago
comment:2 by , 17 years ago
Must Fix for Release: | → Yes |
---|
follow-up: 4 comment:3 by , 16 years ago
Awaiting user input: | unset |
---|
Hi Maciek, I think this behavior of QGIS is not a problem. When you add a 'new' category in 'no category' mode QGIS show you that it put the value 0 at the cat in the Grass 'attributes window' but if doesn't do it. This because GRASS manages only integer and positive category values.
If you are agree I suggest to close this bug.
Regards Leonardo
comment:4 by , 16 years ago
Platform: | Linux → All |
---|---|
Platform Version: | Ubuntu Dapper |
Summary: | category 0 handled wrong → GRASS Edit: don't force category 0 if none specified |
Replying to leolami:
When you add a 'new' category in 'no category' mode QGIS show you that it put the value 0 at the cat in the Grass 'attributes window' but if doesn't do it.
This because GRASS manages only integer and positive category values.
We were both partly in error:
- Your error: GRASS *does* support category number 0. See Radim's note [1].
- Mine: I didn't consider that GRASS Edit will silently assume category=0 when the "Category" dialog is empty. And that's the culprit.
The whole bug is this:
- If category "Mode" is set to "No category", the "New" button in "Edit attributes" tool of GRASS Edit should be disabled - because the user can't specify the category (the dialog is greyed out) in this mode.
- In "Manual entry" "Mode", if the "Category" dialog is empty, the "New" button in "Edit attributes" tool of GRASS Edit should be disabled too.
In short words - don't force category '0' (just like you would not force any other value) if the user did not explicitly put it the "Category" dialog.
To consider: since GRASS supports category 0, I *wonder* if GRASS Edit should not start at category '0' in "Next not used" "Mode", instead of '1' in like it does now. On the other hand, as some GRASS modules are buggy that they still assume the first possible category to be '1', such a "correction" in QGIS GRASS Edit might be not a good idea. Probably better leave this as it is for now, but fix the bug described above.
[1]http://sourceforge.net/mailarchive/message.php?msg_name=340505ef0601170244n1b5fe25bhd0a3eba7342b78d4%40mail.gmail.com
comment:5 by , 16 years ago
Cc: | added |
---|
Hi Maciek, I see the Radim note and I agree on start at category '0' in "Next not used" "Mode", instead of '1'. But, like you say, some GRASS modules still assume the first possible category to be '1' and this can creates problems.
Are you agree if we move it from bug to defect?
Regards Leonardo
comment:6 by , 16 years ago
Leonardo
I'll repeat - I *don't* think GRASS Edit should default to '0' as the initial category instead of '1', *yet*. It is something to *consider* in future depending on how category 0 vs 1 are handled in GRASS in *future*. That's one issue.
The other issue is that there is a major bug in GRASS Edit related to category handling:
- If category "Mode" is set to "No category", the "New" button in "Edit attributes" tool of GRASS Edit should be disabled - because the user can't specify the category (the dialog is greyed out) in this mode.
- In "Manual entry" "Mode", if the "Category" dialog is empty, the "New" button in "Edit attributes" tool of GRASS Edit should be disabled too - because the user haven't specified the category yet, thus GRASS Edit can't know what the "New" category shall be.
This *is* a bug, a rather big one.
comment:7 by , 15 years ago
Owner: | changed from | to
---|
comment:8 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Changed the behavior of the attribute editor as suggested by msieczka.
Fixed in r11331.
Moreover
As I said: if I add a feature using 'no category' mode, and then add category manually it's '0'
But when I do the same again, again category '0' is used!
Maciek