Opened 9 years ago

Last modified 4 years ago

#2555 new defect

v.colors: silently ignores rules given at stdin

Reported by: mlennert Owned by: grass-dev@…
Priority: normal Milestone: 7.8.3
Component: Vector Version: svn-releasebranch70
Keywords: v.colors stdin Cc:
CPU: Unspecified Platform: Unspecified

Description

v.colors map=censusblk_swwake use=attr column=MEDIAN_AGE rules=- << EOF
0% white
100% red
EOF

No color change in the map. However, if you create a rules file (called 'rules' here) with the same rules:

v.colors map=censusblk_swwake use=attr column=MEDIAN_AGE rules=rules

everything works as expected.

The reason is main.c, lines 282ff where the code handling the stdin case is just commented without informing the user. IIUC, the problem is getting the min and max values of the attribute or cats and of deciding whether the values are floating point or not. For the first, the arraystats library offers the AS_basic_stats function. For the latter, a simple check of the column type should be enough (or = int if cat values are used).

Ideally this should be fixed, but if this is not possible, the option of giving the rules at stdin should not be proposed in the interface description and help page and there should be a message that this function is currently not implemented. Silently ignoring is not a very user friendly approach...

Change History (20)

comment:1 by annakrat, 9 years ago

I think, there is similar problem with option raster and volume (which should be renamed if it's not yet). I agree this is confusing and should be removed (I assume it's not super easy to implement?). Martin, any opinion on that?

in reply to:  1 ; comment:2 by mlennert, 9 years ago

Replying to annakrat:

I think, there is similar problem with option raster and volume (which should be renamed if it's not yet). I agree this is confusing and should be removed (I assume it's not super easy to implement?). Martin, any opinion on that?

The issue with copying from raster is different. I filed a separate ticket: #2556.

in reply to:  2 ; comment:3 by martinl, 9 years ago

Replying to mlennert:

Replying to annakrat:

I think, there is similar problem with option raster and volume (which should be renamed if it's not yet). I agree this is confusing and should be removed (I assume it's not super easy to implement?). Martin, any opinion on that?

I would just add fatal error that it's not supported yet and keep this ticket open.

comment:4 by martinl, 8 years ago

Milestone: 7.0.07.0.5

comment:5 by martinl, 8 years ago

Milestone: 7.0.57.2.0

in reply to:  3 comment:6 by neteler, 7 years ago

Replying to martinl:

Replying to mlennert:

Replying to annakrat:

I think, there is similar problem with option raster and volume (which should be renamed if it's not yet). I agree this is confusing and should be removed (I assume it's not super easy to implement?). Martin, any opinion on that?

I would just add fatal error that it's not supported yet and keep this ticket open.

Has this been added?

comment:7 by annakrat, 7 years ago

In 69806:

v.colors: throw fatal error if rules from stdin are specified, see #2555

comment:8 by annakrat, 7 years ago

In 69807:

v.colors: throw fatal error if rules from stdin are specified, see #2555 (merge from trunk, r69806)

comment:9 by annakrat, 7 years ago

In 69808:

v.colors: throw fatal error if rules from stdin are specified, see #2555 (merge from trunk, r69806)

comment:10 by annakrat, 7 years ago

Milestone: 7.2.07.2.1

I put there fatal error for now, this ticket is still open to actually implement the rules from stdin.

comment:11 by martinl, 7 years ago

Milestone: 7.2.17.2.2

comment:12 by neteler, 7 years ago

Milestone: 7.2.27.2.3

Ticket retargeted after milestone closed

comment:13 by martinl, 6 years ago

Milestone: 7.2.3

Ticket retargeted after milestone closed

comment:14 by martinl, 6 years ago

Milestone: 7.2.4

comment:15 by mlennert, 5 years ago

Martin, do you think this is something which will ever be fixed, or should we consider v.colors as an experience with limits that we will not work on anymore ?

comment:16 by martinl, 5 years ago

Milestone: 7.2.47.8.0

Let's hope.

comment:17 by neteler, 5 years ago

Milestone: 7.8.07.8.1

Ticket retargeted after milestone closed

comment:18 by neteler, 4 years ago

Milestone: 7.8.17.8.2

Ticket retargeted after milestone closed

comment:19 by neteler, 4 years ago

Milestone: 7.8.2

Ticket retargeted after milestone closed

comment:20 by neteler, 4 years ago

Milestone: 7.8.3
Note: See TracTickets for help on using tickets.