Details Ticket 2437


Comment | Reply | Take | Resolve


Serial Number 2437
Subject ps.map: raster colortable fails on dynamic cat names
Area bug
Queue grass
Requestors hamish_nospam@yahoo.com
Owner none
Status open
Last User Contact Never contacted
Current Priority 15
Final Priority 70
Due No date assigned
Last Action Fri Feb 9 07:33:33 2007 (2 yr ago)
Created Sat May 29 08:59:09 2004 (4 yr ago)

Transaction History Ticket 2437


Sat, May 29 2004 08:59:09    Request created by guest  
Subject: ps.map: raster colortable fails on dynamic cat names

Platform: GNU/Linux/i386
grass obtained from: Mirror of Trento site
grass binary for platform: Compiled from Sources
GRASS Version: 5.3 cvs may 2004

ps.map's raster colortable function doesn't work correctly when the cats file
contains dynamic naming rules.

e.g. 'r.neighbors method=diversity' creates a cats/ file as follows:
# 6 categories
11x11 neighborhood: diversity of test_map
$1 $?different categories$category$
1.00 0.00 0.00 0.00

In  src/ps.map/ps.map/cmd/ps_clrtbl.c, line 55, there is:
    /* How many categories to show */
    num_cats = G_number_of_raster_cats(&PS.cats);

This gets set to 0 for the above map when it should be 6. (uses G_read_cats()
to populate PS.cats several lines earlier)
Forcing it higher causes a SegFault.


It works with d.legend:
G_read_cats();
G_read_range(map_name, mapset, &range);
G_get_range_min_max (&range, &min_ind, &max_ind);
cats_num = max_ind - min_ind + 1 ;
[more or less, admittedly d.legend can be a bit convoluted..]


I take it this is a bug in G_number_of_raster_cats() or G_read_cats()?

I hadn't seen anything about dynamic category names before this. Any docs for
it? Should it be supported?


thanks,
Hamish
Fri, Feb 9 2007 07:33:33    Priority changed to 15 by hbowman  
Comment | Reply | Take | Resolve

You are currently authenticated as guest.
[Show Configuration] [Login as another user]

Users Guide - Mail Commands - Homepage of RequestTracker 1.0.7 - list any request