Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] A bit more forgiving on layer graphics ...

What about displaying the full image returned from those requests in a tool-tip-like popup?

Richard

Jody Garnett wrote:
Those following udig development may remember a time when more legend graphics showed up. This is due to a conflicting world view we have with the WMS spec. It provides *legend* graphics were we really need *layer* graphics for udig.

Here is a snapshot of a patch that is a bit more forgiving on legend graphics not being the requested size ...



To illustrate the "problem" here are some sample legend graphic requests used above:

A themed glyph from mapserver:
<http://dev1.dmsolutions.ca/cgi-bin/mswms_gmap?REQUEST=GetLegendGraphic&LAYER=popplace&STYLE=&FORMAT=image/png&WIDTH=16&VERSION=1.0.0&HEIGHT=16&SERVICE=WMS>

A couple glyph w/ text layers from mapserver:
<http://dev1.dmsolutions.ca/cgi-bin/mswms_gmap?REQUEST=GetLegendGraphic&LAYER=road&STYLE=&FORMAT=image/png&WIDTH=16&VERSION=1.0.0&HEIGHT=20&SERVICE=WMS>
<http://dev1.dmsolutions.ca/cgi-bin/mswms_gmap?REQUEST=GetLegendGraphic&LAYER=park&STYLE=&FORMAT=image/png&WIDTH=16&VERSION=1.0.0&HEIGHT=16&SERVICE=WMS>

And finally a themed layer from cubserver (they draw it in a box!)
<http://test-dw.ccrs.nrcan.gc.ca:9090/cubewerx/cubeserv/cubeserv.cgi?REQUEST=GetLegendGraphic&LAYER=CANADNACB_L:CEOWARE2&STYLE=&FORMAT=image/png&WIDTH=16&VERSION=1.0.0&HEIGHT=16&SERVICE=WMS>

What I have done is:
1) return any image that is 16x16 (it does happen)
2) scale up to 16 x 16 any image that is too small
3) if a mask is available trying and skip any masked lines then columns, before extracting a 16x16 swatch 4) if an alpha is available trying to skip any clear lines then columns, before extracting a 16x16 swatch
5) skip any while lines then columns, before extracting a 16x16 swatch

I also experimented with simply:
- grabbing the first 16x16 swatch (always worked, no possibility of looking right) - resizing a square based on min width or height (looked great for non themed legend graphics)

Jody


------------------------------------------------------------------------

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel



Back to the top