[GRASS-dev] [GRASS GIS] #2029: raster legend on discrete maps not graduated

GRASS GIS trac at osgeo.org
Tue Jul 9 16:31:07 PDT 2013


#2029: raster legend on discrete maps not graduated
-------------------------+--------------------------------------------------
 Reporter:  timmie       |       Owner:  grass-dev@…              
     Type:  defect       |      Status:  new                      
 Priority:  normal       |   Milestone:  6.4.4                    
Component:  Raster       |     Version:  unspecified              
 Keywords:  d.legend     |    Platform:  Unspecified              
      Cpu:  Unspecified  |  
-------------------------+--------------------------------------------------

Comment(by hamish):

 DCELL will always create a gradient legend, since it's a real number.
 (unless you use the use= option)

 A reclass of a floating point map should be a virtual CELL map, which is
 what your r.info shows for the Data type.

 note reclasses of floating point maps are not as well supported as
 reclasses of cell maps. in fact the man page says it won't work at all,
 but it "sort of" does. So I'm not very surprised things don't work 100%
 with that.

 fwiw, this works fine for me in devbr6:

 {{{
 # North Carolina dataset
 g.region rast=slope

 r.univar -e slope perc=0,10,20,30,40,50,60,70,80,90,100
 0th percentile: 0
 10th percentile: 0.94092
 20th percentile: 1.57311
 30th percentile: 2.12774
 40th percentile: 2.66269
 50th percentile: 3.21512
 60th percentile: 3.82967
 70th percentile: 4.56931
 80th percentile: 5.58133
 90th percentile: 7.39227
 100th percentile: 38.6894

 r.reclass in=slope out=slope.deciles rules=- << EOF
 0 thru 0.94092 = 1 First decile
 0.94092 thru 1.57311 = 2 Second decile
 1.57311 thru 2.12774 = 3 Third decile
 2.12774 thru 2.66269 = 4 Fourth decile
 2.66269 thru 3.21512 = 5 Fifth decile
 3.21512 thru 3.82967 = 6 Sixth decile
 3.82967 thru 4.56931 = 7 Seventh decile
 4.56931 thru 5.58133 = 8 Eighth decile
 5.58133 thru 7.39227 = 9 Ninth decile
 7.39227 thru 38.6894 = 10 Tenth decile
 EOF

 d.legend slope.deciles
 }}}


 Hamish

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2029#comment:3>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list