[GRASS-dev] Re: [GRASS GIS] #1589: r.clump: inadequate color ramp

GRASS GIS trac at osgeo.org
Fri Feb 24 16:04:17 EST 2012


#1589: r.clump: inadequate color ramp
---------------------------------------------+------------------------------
 Reporter:  pcav                             |       Owner:  grass-dev@…              
     Type:  defect                           |      Status:  new                      
 Priority:  normal                           |   Milestone:  6.4.3                    
Component:  Raster                           |     Version:  6.4.1                    
 Keywords:  r.clump, G_make_random_colors()  |    Platform:  Linux                    
      Cpu:  x86-64                           |  
---------------------------------------------+------------------------------
Changes (by hamish):

  * keywords:  => r.clump, G_make_random_colors()
  * component:  Default => Raster
  * milestone:  => 6.4.3


Comment:

 after closing the map r.clump does:

 {{{
     G_read_range(OUTPUT, G_mapset(), &range);
     G_get_range_min_max(&range, &min, &max);
     G_make_random_colors(&colr, min, max);
     G_write_colors(OUTPUT, G_mapset(), &colr);
 }}}

 so maybe G_make_random_colors() is to blame?

 it falling over at ~900 clumps is suspiciously close to this calculation
 in lib/gis/color_rand.c:
 {{{
 #define MAX_COLORS 1024
 #define DEVIATION 128
 ...
 count = MAX_COLORS - DEVIATION + rand() % DEVIATION;
 }}}


 as a basis for testing, could someone who knows about the module add an
 example using one of the standard datasets to the help page?


 see also r.watershed's color creation mechanism.


 thanks,
 Hamish

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/1589#comment:1>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list