[GRASS-dev] grass wiki main page & colorbrewer tool

Hi Nikos,

I see you are looking at cleaning up the main page of the
grass wiki.

fyi I'd previously done some experimentation mixing different
"heath-like" box-group colors to make it more interesting, see:
   http://grasswiki.osgeo.org/wiki/Main_Page_color_test

maybe it helps.

best,
Hamish

ps- if anyone at the sprint is looking for a nice task, building
a wxPy color wizard around the ColorBrewer tables might be fun:
  http://colorbrewer2.org/
I've got their data reduced to some csv text files from a past
attempt, and AFAIR the licensing on those was compatible w/ GPL.
(it's worth looking that up again, but I wouldn't have bothered
starting on it if it wasn't) I think QGIS has something similar
already?

ps- if anyone at the sprint is looking for a nice task, building
a wxPy color wizard around the ColorBrewer tables might be fun:
http://colorbrewer2.org/
I've got their data reduced to some csv text files from a past
attempt, and AFAIR the licensing on those was compatible w/ GPL.
(it's worth looking that up again, but I wouldn't have bothered
starting on it if it wasn't) I think QGIS has something similar
already?

Hamish, if there is no time or interest to do this at the sprint (fixing the bugs for GRASS6.4.3 release are probably
higher priority) maybe you can add it into the cartography enhancements topic for GSoC2013
http://grasswiki.osgeo.org/wiki/GRASS_SoC_Ideas_2013.
Given the max. number of classes supported - 12 and less for some color schemes, supposedly you cannot distinguish more,
it would be nice to add a button for generating discrete colors for continuous data, such as elevation,
for a given number of classes - it can be done now, but as far as I know you would have to reclass your raster first.

Helena

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Hamish wrote:

> ps- if anyone at the sprint is looking for a nice task, building
> a wxPy color wizard around the ColorBrewer tables might be fun:
> http://colorbrewer2.org/
> I've got their data reduced to some csv text files from a past
> attempt, and AFAIR the licensing on those was compatible w/ GPL.

(you can also download the excel spreadsheet from their site directly)

Helena wrote:

Hamish, if there is no time or interest to do this at the
sprint (fixing the bugs for GRASS6.4.3 release are probably
higher priority)

fwiw one of my strong wishes for 6.4.3 is to convert the wxPsMap
eps symbols into proper grass symbols and use the 'symbol' command
with them. I don't really want to release the current way and
have to keep support for the duplicated eps decorations forever.

maybe you can add it into the cartography enhancements topic
for GSoC2013
http://grasswiki.osgeo.org/wiki/GRASS_SoC_Ideas_2013.

that's fine too.

a minor note about one of the suggestions already there: Google
only accepts projects which are primarily coding in nature to
SoC. So graphics design, website overhaul, and documentation
projects while very important and often badly needed for FOSS
projects are actually beyond the scope of the program.
IIUC Google's Code In for high school students allows those
sorts of things as challenges though. (at perhaps the cost
of more mentoring time needed)

Given the max. number of classes supported - 12 and less for
some color schemes, supposedly you cannot distinguish more,

I haven't read the academic paper behind the site (I assume
there is one based on how they got their funding), so I'm not
sure if the colors were selected algorithmically, by educated
eye, or a mix of both. If there's a formula we could tap into
(like r.watershed has), then all the better for it.

it would be nice to add a button for generating discrete
colors for continuous data, such as elevation,
for a given number of classes - it can be done now, but as
far as I know you would have to reclass your raster first.

Even though it is very popular in other widely used software,
I've always tried to steer away from applying discrete classes
to continuous raster data. IMO it deserves it's own chapter
in "How to lie with statistics"*, as it is very easy to fool
both yourself and others about what the data says based on the
ultimately arbitrary choice (as far as nature is concerned)
of intervals. I realize that it is also difficult for the human
eye to follow a constant hue and isolines can be useful, so
typically what I try to do for those as a compromise is have the
continuous gradient colors in the back ground with contour lines
of the same data over the top.

[*] actually I think there's already a book on it called "How to lie with maps"

If you really want to do it though there's no reason to reclass,
see the r.colors.stddev script for an example. Just make two
rules at the same value right next to each other. e.g., from
r.colors.stddev:

r.colors "$GIS_OPT_INPUT" color=rules << EOF
       0% black
       $MEAN_MINUS_3STDEV black
       $MEAN_MINUS_3STDEV red
       $MEAN_MINUS_2STDEV red
       $MEAN_MINUS_2STDEV yellow
       $MEAN_MINUS_1STDEV yellow
       $MEAN_MINUS_1STDEV green
       $MEAN_PLUS_1STDEV green
       $MEAN_PLUS_1STDEV yellow
       $MEAN_PLUS_2STDEV yellow
       $MEAN_PLUS_2STDEV red
       $MEAN_PLUS_3STDEV red
       $MEAN_PLUS_3STDEV black
       100% black
EOF

screenshots here, but google's pages site seems to have gone
a bit haywire:
   https://sites.google.com/site/hamishbowman/grass_color_maps

regards,
Hamish

On Feb 3, 2013, at 11:17 PM, Hamish wrote:

Hamish wrote:

ps- if anyone at the sprint is looking for a nice task, building
a wxPy color wizard around the ColorBrewer tables might be fun:
http://colorbrewer2.org/
I've got their data reduced to some csv text files from a past
attempt, and AFAIR the licensing on those was compatible w/ GPL.

(you can also download the excel spreadsheet from their site directly)

Helena wrote:

Hamish, if there is no time or interest to do this at the
sprint (fixing the bugs for GRASS6.4.3 release are probably
higher priority)

fwiw one of my strong wishes for 6.4.3 is to convert the wxPsMap
eps symbols into proper grass symbols and use the 'symbol' command
with them. I don't really want to release the current way and
have to keep support for the duplicated eps decorations forever.

maybe you can add it into the cartography enhancements topic
for GSoC2013
http://grasswiki.osgeo.org/wiki/GRASS_SoC_Ideas_2013.

that's fine too.

a minor note about one of the suggestions already there: Google
only accepts projects which are primarily coding in nature to
SoC. So graphics design, website overhaul, and documentation
projects while very important and often badly needed for FOSS
projects are actually beyond the scope of the program.

this topic should cover the programming part, not the design of symbology. We need to have
d.rast.leg and d.vect.leg - even if it is just single color for a feature like water
(like we have r.colors and v.colors - I was thrilled to discover v.colors, thanks a lot for that,
e.g. the streets map with speed limits in the nc data set looks great and I see the trick with the legend,
but that is not a solution for vector data in general)
We need better handling of scale bar and everything needs to be more robust.
I looked at the cartographic composer and recommended it to students but
we are still behind other packages in terms of producing nice maps in a convenient way -
everything (or most of it ) is there, it just needs more work. That is the part of GRASS I get
most complaints about, although some students produce beautiful maps with GRASS.

IIUC Google's Code In for high school students allows those
sorts of things as challenges though. (at perhaps the cost
of more mentoring time needed)

Given the max. number of classes supported - 12 and less for
some color schemes, supposedly you cannot distinguish more,

I haven't read the academic paper behind the site (I assume
there is one based on how they got their funding), so I'm not
sure if the colors were selected algorithmically, by educated
eye, or a mix of both. If there's a formula we could tap into
(like r.watershed has), then all the better for it.

it would be nice to add a button for generating discrete
colors for continuous data, such as elevation,
for a given number of classes - it can be done now, but as
far as I know you would have to reclass your raster first.

Even though it is very popular in other widely used software,
I've always tried to steer away from applying discrete classes
to continuous raster data. IMO it deserves it's own chapter
in "How to lie with statistics"*, as it is very easy to fool
both yourself and others about what the data says based on the
ultimately arbitrary choice (as far as nature is concerned)
of intervals. I realize that it is also difficult for the human
eye to follow a constant hue and isolines can be useful, so
typically what I try to do for those as a compromise is have the
continuous gradient colors in the back ground with contour lines
of the same data over the top.

I totally agree with you on this but there is some research that says otherwise
and there are some situations when the discrete maps simply work better.
I can see it when we have the GRASS and ArcGIS maps side-by-side,
our continuous color ramps are certainly better than the grey ramp for continuous
data in ArcGIS, but the discrete color ramps produced by some ArcGIS modules
are often more readable although they can hide some detail - I try to deliver that
message all the time and we use relief shading a lot to avoid hiding features.
It very much depends on the data - it would be a long discussion.
The precipitation example in GRASSbook - Fig.6.17 is a good example where the continuous
color ramp did not work, even when it was in color you could not see the pattern.

[*] actually I think there's already a book on it called "How to lie with maps"

yes there is famous book about it by Monmonier (#2 on Amazon in Cartography)

If you really want to do it though there's no reason to reclass,
see the r.colors.stddev script for an example. Just make two
rules at the same value right next to each other. e.g., from
r.colors.stddev:

r.colors "$GIS_OPT_INPUT" color=rules << EOF
      0% black
      $MEAN_MINUS_3STDEV black
      $MEAN_MINUS_3STDEV red
      $MEAN_MINUS_2STDEV red
      $MEAN_MINUS_2STDEV yellow
      $MEAN_MINUS_1STDEV yellow
      $MEAN_MINUS_1STDEV green
      $MEAN_PLUS_1STDEV green
      $MEAN_PLUS_1STDEV yellow
      $MEAN_PLUS_2STDEV yellow
      $MEAN_PLUS_2STDEV red
      $MEAN_PLUS_3STDEV red
      $MEAN_PLUS_3STDEV black
      100% black
EOF

I use this trick too (or sometimes it is enough just create an integer copy of the map),
but what I had in mind was something like ryg with 6 classes,
or elevation with 12 classes. So the user selects the color table and number of intervals
and the map is created without specifying the individual colors.

screenshots here, but google's pages site seems to have gone
a bit haywire:
  https://sites.google.com/site/hamishbowman/grass_color_maps

that is a great document - I was just looking at it recently.

Helena

regards,
Hamish

Hamish wrote:

Hi Nikos,

Hi :slight_smile:

I see you are looking at cleaning up the main page of the
grass wiki.

Yes -- seeking for some Designer touch on it :-p

fyi I'd previously done some experimentation mixing different
"heath-like" box-group colors to make it more interesting, see:
   http://grasswiki.osgeo.org/wiki/Main_Page_color_test
maybe it helps.

Yes, it (will) help(s) already. I am aware of the page.

Thank you, N

ps- if anyone at the sprint is looking for a nice task, building
a wxPy color wizard around the ColorBrewer tables might be fun:
  http://colorbrewer2.org/

Maybe NikosV is interested? Cc-ed this post to him.

I've got their data reduced to some csv text files from a past
attempt, and AFAIR the licensing on those was compatible w/ GPL.
(it's worth looking that up again, but I wouldn't have bothered
starting on it if it wasn't) I think QGIS has something similar
already?

Talking about colors and appearances,

I'd like to create a complete list of "grass-gis" keywords to use along
with the listings LaTeX package. It certainly would make LaTeX
documentation on grass-gis stuff look nice(r).

In doing that, I am testing by using a small set of grass-gis commands and
custom variable names defined as otherkeywords. It is, more or less,
successfully. However, I currently face one problem: using something like
"e=" as a keyword, will match the end of every parameter that ends in
"e=", e.g. "title=" and colorised (the end, not the complete parameter) as
instructed.

Anyone interested in such a list and how it can be used within LaTeX
documents?

Thank you, Nikos

Helena wrote:

this topic should cover the programming part, not the design
of symbology.

ok,

We need to have d.rast.leg and d.vect.leg - even if it is
just single color for a feature like water

So like the ps.map vector legend, but as a d.* module, right?
Glynn already converted d.rast.leg to python, how would you
like to see that be improved? (besides renaming it d.rast.legend)

re. improvements for d.rast.leg, here is a mock up I just made
of some MODIS SST data with some ideas in it:

http://bambi.otago.ac.nz/hamish/grass/screenshots/sst_4uNight_A2012047.png

Only part which isn't real is I squashed the LL Plate Carree's
width by percentage (approx cos(lat) * 100) in GIMP, instead of
doing a real reprojection. The rest is scriptable:

* decorations are on the left (flag to move it to the right)
* uses d.font for a TrueType font^ (I set it to Vera)
* units are taken from 'r.info -u' if they are set
* d.legend's range= is take from r.univar -e perc=2,98
* d.text with the map name is rotated 90 deg to up the map space
* a calculation is made to automatically pick a nice d.grid interval
* I still like the black backgrounds from old versions of GRASS
for satellite imagery :slight_smile:

^note we can make good use of the GRASS_FONT and GRASS_FONTSIZE
enviro variables for all d.* modules, avoiding extra options
thus simplifying the code. Of course the GUI versions would need
friendly wrappers with buttons and drop down lists, but that's
relatively easy.

(like we have r.colors and v.colors - I was thrilled to
discover v.colors, thanks a lot for that,

you are welcome, although as you noticed it's a complete hack
taking advantage of r.colors as it does. Better to would be
to add colr files to the vector/ format for GRASS 7. I think
that using GRASSRGB column should remain as an option, but the
'd.vect zcolor=' style could use an optional colr file, so you
had more options for coloring e.g. LiDAR w/ no DB table than just
the presets. Perhaps similar to the user-file symbol support
in the user's mapset (yes, it's possible) you could have a
mapset or location based directory with personal color maps
it could check to use? (&/or a colors/ dir within the grass
addons dir(s) too?)

e.g. the streets map with speed limits in the nc data set
looks great and I see the trick with the legend,
but that is not a solution for vector data in general)

screenshot? (perhaps for the website; we need more good vector
ones there)

We need better handling of scale bar and everything needs to
be more robust.

You mean in the wxGUI map display window, not the d.* C modules,
right? Or that those things should be drawn as vector not with
1 pixel wide lines which do not work well with a large display
size as may be used in a poster?

I looked at the cartographic composer and recommended it to
students but we are still behind other packages in terms of
producing nice maps in a convenient way -
everything (or most of it ) is there, it just needs more
work.

fwiw, knowing ps.map well, I think it is absolutely marvelous.
There is still some work to do merging some nice features from
ps.output, like the better borders.

That is the part of GRASS I get most complaints about,
although some students produce beautiful maps with GRASS.

I'd be delighted to see them file wishes in the trac'er.
I hope the composer takes care of a lot of the "eeek it's
controlled by text" issues, and once they have their text
control file they feel comfortable changing e.g. the caption
spelling in it, or map name if they need to produce a series,
in a text editor and see the joy of consistent templates.

Hamish:

> Even though it is very popular in other widely used
> software, I've always tried to steer away from applying
> discrete classes to continuous raster data. IMO it deserves
> it's own chapter in "How to lie with statistics"*,

...

I totally agree with you on this but there is some research
that says otherwise

If it's the journal article I'm thinking of, I know about it,
I've read it, and I don't agree with its conclusions.

and there are some situations when the discrete maps simply
work better.
I can see it when we have the GRASS and ArcGIS maps
side-by-side, our continuous color ramps are certainly
better than the grey ramp for continuous data in ArcGIS, but
the discrete color ramps produced by some ArcGIS modules
are often more readable although they can hide some detail -
I try to deliver that message all the time and we use relief
shading a lot to avoid hiding features.
It very much depends on the data - it would be a long
discussion.

It could be, but I'd probably need to study up on my ER Tufte
a bit more to be able to do it well. :slight_smile:

The precipitation example in GRASSbook - Fig.6.17 is a good
example where the continuous color ramp did not work, even
when it was in color you could not see the pattern.

(I only had Vol 1, but luckily our library has access to the
eBook :slight_smile:

> If you really want to do it though there's no reason to
> reclass, see the r.colors.stddev script for an example.
> Just make two rules at the same value right next to each
> other.

...

I use this trick too (or sometimes it is enough just create
an integer copy of the map), but what I had in mind was
something like ryg with 6 classes, or elevation with 12
classes. So the user selects the color table and number of
intervals and the map is created without specifying the
individual colors.

my heart's really not in pursuing that myself, and I discourage
it, but it would seem like a simple front end to a future
colorbrewer module to make the reclass map for that if someone
wanted to do it.

regards,
Hamish