Opened 10 years ago
Last modified 6 years ago
#2399 new enhancement
*.colors.out: simplified colors output
Reported by: | lucadelu | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.6.2 |
Component: | Raster | Version: | svn-trunk |
Keywords: | colors, r.colors.out, v.colors.out | Cc: | |
CPU: | Unspecified | Platform: | All |
Description
Hi devs,
At time the *.colors.out commands output a color table as-is. This is not necessarily useful when it comes to export for WMS etc which ideally uses a minimalistic color table. Example: a Celsius temperature map comes with a long FP color table but for Web representation it is sufficient to provide a simplified table.
Hence, the *.colors.out could offer a reclassified table based on the original FP color table.
Proposal:
To optionally reduce the number of output colors values for a map, I introduced a new parameter (classes) in *.colors.out.
It works as follows:
- first obtain the number of all color values and divide it with the number of classes set by the user to obtain the bin size,
- In the existing Rast_print_colors() there is a "for" loop in which we can check the values if the color table row is the first, last or a multiple of our bin size and restrict printing to only these values.
At this point, *.colors.out will no longer only print the original FP color table, but optionally also a reduced classified color table for external use.
Please try the attached patch (one parameter added to Rast_print_colors() and update of respective calls elsewhere in GRASS) and let me know if acceptable.
Attachments (1)
Change History (12)
comment:1 by , 10 years ago
comment:5 by , 8 years ago
Milestone: | 7.2.1 → 7.2.2 |
---|
comment:6 by , 7 years ago
Milestone: | 7.2.2 → 7.4.0 |
---|
All enhancement tickets should be assigned to 7.4 milestone.
comment:8 by , 7 years ago
Milestone: | 7.4.1 → 7.4.2 |
---|
comment:9 by , 6 years ago
Milestone: | 7.4.2 → 7.6.0 |
---|
All enhancement tickets should be assigned to 7.6 milestone.
Is the patch complete? I miss the Rast_print_colors function code.