[Geoserver-devel] Getting a nicer generic raster GetLegendGraphics output

Hi,
OpenGeo asked me to look into getting a better GetLegendGraphics output
for generic raster.
In fact the current one is rather ugly:
http://demo.opengeo.org/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=bluemarble

A colored R.... R what? Ah, "R"aster. However it's quite pixellated
and does not really look professional.

I've looked around to see what other software does... most of the
time (ArcExplorer, ArcGis, OpenJump) there is really no icon at
all.

uDig as its own little icon. It's sure raster, but maybe a little
too simple? See udig.png attached (coming from a screenshot).
It's however better than the current R imho.

Also tried to look into gvSig but could not make it work at all...
with my own JDK it works fine but does not open raster files
because it cannot initalize the custom gvSig GDAL extensions,
with their own most dialogs are solid gray, which is
a known issue on Ubuntu if you use any JRE 1.5.
Oh well, if anybody has it working and finds they are using
a nice icon, please report?

Oh, there is also the icon that we're using in the GeoServer
GUI of course. We could consider using that one as well,
attached as raster.png

The main issue I see with the above raster icons is that they don't scale, whilst GetLegendGraphic users can decide how big the icon is...
See for example:

http://demo.opengeo.org/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=bluemarble
http://demo.opengeo.org/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=40&HEIGHT=40&LAYER=bluemarble

and compare with:

http://demo.opengeo.org/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=topp:states
http://demo.opengeo.org/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=40&HEIGHT=40&LAYER=topp:states

I guess a better approach would be to have a SVG icon that we can paint
at different scales (that would be a bit on the heavy site) or just
go plain java2d if the icon is actually simple (like uDig one, but
the one we use in GS is just a matter of writing a simple loop too)

Thoughts?

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

(attachments)

udig.png
raster.png

The same raster shape is used as part of WMS icon etc... The udig raster icon is dynamically generated using draw commands (and should be able to reflect the image colors). I was hoping to trade simplicity for relevance.

Andrea there is an osgeo list called graphics; that rounds up the various projects and tries to talk about icons. Thus far it is a very quiet list but you could ask there after a good raster icon.

Does not geosilk provide something?

Jody

On 09/03/2010, at 9:58 PM, Andrea Aime wrote:

Hi,
OpenGeo asked me to look into getting a better GetLegendGraphics output
for generic raster.
In fact the current one is rather ugly:
http://demo.opengeo.org/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=bluemarble

A colored R.... R what? Ah, "R"aster. However it's quite pixellated
and does not really look professional.

I've looked around to see what other software does... most of the
time (ArcExplorer, ArcGis, OpenJump) there is really no icon at
all.

uDig as its own little icon. It's sure raster, but maybe a little
too simple? See udig.png attached (coming from a screenshot).
It's however better than the current R imho.

Also tried to look into gvSig but could not make it work at all...
with my own JDK it works fine but does not open raster files
because it cannot initalize the custom gvSig GDAL extensions,
with their own most dialogs are solid gray, which is
a known issue on Ubuntu if you use any JRE 1.5.
Oh well, if anybody has it working and finds they are using
a nice icon, please report?

Oh, there is also the icon that we're using in the GeoServer
GUI of course. We could consider using that one as well,
attached as raster.png

The main issue I see with the above raster icons is that they don't scale, whilst GetLegendGraphic users can decide how big the icon is...
See for example:

http://demo.opengeo.org/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=bluemarble
http://demo.opengeo.org/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=40&HEIGHT=40&LAYER=bluemarble

and compare with:

http://demo.opengeo.org/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=topp:states
http://demo.opengeo.org/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=40&HEIGHT=40&LAYER=topp:states

I guess a better approach would be to have a SVG icon that we can paint
at different scales (that would be a bit on the heavy site) or just
go plain java2d if the icon is actually simple (like uDig one, but
the one we use in GS is just a matter of writing a simple loop too)

Thoughts?

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.
<udig.png><raster.png>------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Jody Garnett ha scritto:

The same raster shape is used as part of WMS icon etc... The udig
raster icon is dynamically generated using draw commands (and should
be able to reflect the image colors). I was hoping to trade
simplicity for relevance.

Reflects the image colors? Hum... not that I can see, I get the
same icon with 4 boxes from black to white no matter what
image I open (ECW, mrsid, since GeoTiffs do not open).
Do you have the algorithm that generates the icon handy? A svn pointer?

Andrea there is an osgeo list called graphics; that rounds up the
various projects and tries to talk about icons. Thus far it is a very
quiet list but you could ask there after a good raster icon.

Yet another ml... ok, worth a short, 30 ml or 31, does not make much of
a difference anymore, doesn't it?

Does not geosilk provide something?

It does, I included it in the previous message (it's the bluish
checkerboard one).

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

On Mar 11, 2010, at 9:00 AM, Andrea Aime wrote:

Jody Garnett ha scritto:

The same raster shape is used as part of WMS icon etc… The udig

raster icon is dynamically generated using draw commands (and should

be able to reflect the image colors). I was hoping to trade

simplicity for relevance.

Reflects the image colors? Hum… not that I can see, I get the
same icon with 4 boxes from black to white no matter what
image I open (ECW, mrsid, since GeoTiffs do not open).
Do you have the algorithm that generates the icon handy? A svn pointer?

Showing the predominant colors from the raster symbolizer is a smart idea and much more relevant than a generic icon (especially a generic that assumes a particular icon set is being used on the client side). Does the benefit outweigh the technical heft?

Does not geosilk provide something?

It does, I included it in the previous message (it’s the bluish
checkerboard one).

As Jody noted, GeoSilk does provide an icon for raster: http://projects.opengeo.org/common/geosilk/trunk/geosilk/raster.png

Unfortunately, that doesn’t address your concern about scaling. It also assumes that the client is using GeoSilk throughout—which is a safe assumption for GeoServer and GeoExt, but not much further.


Rolando Peñate
Design Lead
OpenGeo - http://opengeo.org

Rolando Peñate ha scritto:

On Mar 11, 2010, at 9:00 AM, Andrea Aime wrote:

Jody Garnett ha scritto:

The same raster shape is used as part of WMS icon etc... The udig
raster icon is dynamically generated using draw commands (and should
be able to reflect the image colors). I was hoping to trade
simplicity for relevance.

Reflects the image colors? Hum... not that I can see, I get the
same icon with 4 boxes from black to white no matter what
image I open (ECW, mrsid, since GeoTiffs do not open).
Do you have the algorithm that generates the icon handy? A svn pointer?

Showing the predominant colors from the raster symbolizer is a smart idea and much more relevant than a generic icon (especially a generic that assumes a particular icon set is being used on the client side). Does the benefit outweigh the technical heft?

Well, there are two issues:
- the raster symbolizer can be without color map, and we certainly
   cannot scan the raster fully to see what the dominant colors are
- in case we have a color map a very complete symbol with all the
   possible values is already generated

So not much for the technical challenge, but for the cost involved
in scanning the image (which can be tens of gigabytes or more), I would like to avoid doing any content analysis and just use a
generic raster.

<snip />

Does not geosilk provide something?

It does, I included it in the previous message (it's the bluish
checkerboard one).

As Jody noted, GeoSilk does provide an icon for raster: http://projects.opengeo.org/common/geosilk/trunk/geosilk/raster.png

Unfortunately, that doesn't address your concern about scaling. It also assumes that the client is using GeoSilk throughout—which is a safe assumption for GeoServer and GeoExt, but not much further.

I'll reproduce the icon in code so that I can scale it up.
Just a suggestion: is it better to preserve the shape and scale it
up (preseving the number of little squares) or preserve the texture
and replicate it in space like a pattern instead?

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.