[GRASS-user] raster legend on discrete maps not graduated
Hello, I reclassified a continous integer value raster into discrete classes. But when adding a raster legend to the map, it still shows a continued, map with a colour gradient. This is not true as the raster map values have true and hard class breaks. How can I get aroudn this limitation of the map legend (this also applies to the ps.map dialogue). Thanks in advance and kind regards, Timmie ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
SV: SV: [GRASS-user] Raster legend
I am getting more confused by each time I try to edit the conf-files. To be sure I get your suggestions right, I send you my conf-files. The log.raster conf-file: % 2.658010959625244140625 5.07434749603271484375 2.658010959625244140625:0:191:191 3.1412782669:0:255:0 3.1412782669:0:255:0 3.6245455742:255:255:0 3.6245455742:255:255:04.1078128815:255:127:0 4.1078128815:255:127:04.5910801888:191:127:63 4.5910801888:191:127:63 5.07434749603271484375:20 The non-log.raster conf-file % 443.143585205078125 100252.296875 443.143585205078125:0:191:191 20404.9742431641:0:255:0 20404.9742431641:0:255:0 40366.804901123:255:255:0 40366.804901123:255:255:0 60328.635559082:255:127:0 60328.635559082:255:127:0 80290.466217041:191:127:63 80290.466217041:191:127:63100252.2968751:20 The result from r.what.colors whit converted log-values. 447.00: 0:191:191 1738.00: 0:195:179 6607.00: 0:210:133 25704.00: 67:255:0 10.00: 23:22:21 I tried to apply this values in the non-log.raster conf-file as suggested by Nikos, but without any luck. The legend values still wants to be linear. If you still want to help, you could maybe make me a conf-file in the way you think it should be. Thanks for all the help so far. Fra: Nikos Alexandris [nikos.alexand...@felis.uni-freiburg.de] Sendt: 8. oktober 2009 13:30 Til: Martin Album Ytre-Eide Kopi: grass-user@lists.osgeo.org Emne: Re: SV: [GRASS-user] Raster legend --%--- On Thu, 2009-10-08 at 14:25 +0300, Nikos Alexandris wrote: ... why don't you draw the (non-log.raster) legend for it and try to match colors? --%--- Maybe it's not that clear, but (as Hamish, again, note) it's possible to draw any legend on any raster map. So, # draw log.rast d.rast log.rast # draw non-log.raster (after having found correspondence of log ~ non-log values and colors) d.legend non-log-legend Nikos ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
SV: [GRASS-user] Raster legend
Thanks, but It did not seem to work, or I have not tried what you suggested. The actual values are contained in the logarithmic, and that's fine. It is no problem converting the raster to non logarithmic with r.mapcalc, but it does not help me much. I cant use legend values from the non-logarithmic with the logarithmic raster since the scaling will not be right. I have just used standard rules, but done some experiments with custom made without any luck. I edited the rules in colr/directory as you described. It certainly did something, but not the intended. And I have yet not managed to get de-logged values in the legend. Have tried a lot of things, but I don't really understand the logic in the colr-files. Any more/other ideas? Regards, Martin -Opprinnelig melding- Fra: Hamish [mailto:hamis...@yahoo.com] Sendt: 29. september 2009 17:20 Til: grass-user@lists.osgeo.org; Martin Album Ytre-Eide Emne: Re: [GRASS-user] Raster legend Martin Album Ytre-Eide wrote: I am displaying a raster where the values are logarithmic and that is fine. The d.legend gives me a nice legend, but I would like to convert the values in the legend to non logarithmic values (keeping the raster as it is). I can't find a way to do this in d.legend or r.colors. How is this done? Are the actual values contained in the logarithmic? eg convert back to normal with r.mapcalc pow(e, MAP) or pow(10, MAP)? are the rules custom made? does 'd.legend use=' help? note the legend used does not have to match the raster it shows on, you could do a trick where you make a list of the values you want on the legend, calculate that their logs are, use r.what.color to find the matching color, then use those colors with the de-logged values. probably easier actually to copy the internal rules file in the MAPSET's colr/ directory, convert the first column and range to de- logged version, perhaps run r.mapcalc to make a delogged version of the map (or any, just to get the range), copy in the adjusted colr/ file into the colr/ dir, then use that map for the legend. does that make some sense? Hamish ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: SV: [GRASS-user] Raster legend
On Thu, 2009-10-08 at 14:13 +0200, Martin Album Ytre-Eide wrote: Thanks, but It did not seem to work, or I have not tried what you suggested. The actual values are contained in the logarithmic, and that's fine. It is no problem converting the raster to non logarithmic with r.mapcalc, but it does not help me much. I cant use legend values from the non-logarithmic with the logarithmic raster since the scaling will not be right. Right! I have just used standard rules, but done some experiments with custom made without any luck. I edited the rules in colr/directory as you described. It certainly did something, but not the intended. And I have yet not managed to get de-logged values in the legend. Have tried a lot of things, but I don't really understand the logic in the colr-files. Any more/other ideas? Maybe I don't understand this correctly but all you need is to overlay a non-logarithmic legend derived from a logarithmic scaled raster. Is it just to have the legend/ colors? Maybe it is silly, but given that you successfully converted the log.raster to non-log. (as Hamish suggested) then why don't you draw the (non-log.raster) legend for it and try to match colors? I think that this is what Hamish suggests actually. Disregard this message if I am wrong/ add more confusion. Nikos -Opprinnelig melding- Martin Album Ytre-Eide wrote: I am displaying a raster where the values are logarithmic and that is fine. The d.legend gives me a nice legend, but I would like to convert the values in the legend to non logarithmic values (keeping the raster as it is). I can't find a way to do this in d.legend or r.colors. How is this done? Hamish: Are the actual values contained in the logarithmic? eg convert back to normal with r.mapcalc pow(e, MAP) or pow(10, MAP)? are the rules custom made? does 'd.legend use=' help? note the legend used does not have to match the raster it shows on, you could do a trick where you make a list of the values you want on the legend, calculate that their logs are, use r.what.color to find the matching color, then use those colors with the de-logged values. probably easier actually to copy the internal rules file in the MAPSET's colr/ directory, convert the first column and range to de- logged version, perhaps run r.mapcalc to make a delogged version of the map (or any, just to get the range), copy in the adjusted colr/ file into the colr/ dir, then use that map for the legend. does that make some sense? Hamish ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: SV: [GRASS-user] Raster legend
--%--- On Thu, 2009-10-08 at 14:25 +0300, Nikos Alexandris wrote: ... why don't you draw the (non-log.raster) legend for it and try to match colors? --%--- Maybe it's not that clear, but (as Hamish, again, note) it's possible to draw any legend on any raster map. So, # draw log.rast d.rast log.rast # draw non-log.raster (after having found correspondence of log ~ non-log values and colors) d.legend non-log-legend Nikos ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Raster legend
Martin Album Ytre-Eide wrote: I am displaying a raster where the values are logarithmic and that is fine. The d.legend gives me a nice legend, but I would like to convert the values in the legend to non logarithmic values (keeping the raster as it is). I can't find a way to do this in d.legend or r.colors. How is this done? Are the actual values contained in the logarithmic? eg convert back to normal with r.mapcalc pow(e, MAP) or pow(10, MAP)? are the rules custom made? does 'd.legend use=' help? note the legend used does not have to match the raster it shows on, you could do a trick where you make a list of the values you want on the legend, calculate that their logs are, use r.what.color to find the matching color, then use those colors with the de-logged values. probably easier actually to copy the internal rules file in the MAPSET's colr/ directory, convert the first column and range to de- logged version, perhaps run r.mapcalc to make a delogged version of the map (or any, just to get the range), copy in the adjusted colr/ file into the colr/ dir, then use that map for the legend. does that make some sense? Hamish ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user