On 2010-11-03 17:34, Daniele Romagnoli wrote:
> Hi Nils,
> please read below.

Many thanks Daniele! Now I seem to have it working
almost perfectly.

> The black fill you are seeing when accessing a SjokortSkar nodata area
> comes from the  backgroundValue which is set to zero (black).

I suspected that, but only got exceptions when I tried
to change it.

> What I would instead do is creating an SLD with a ColorMap having type =
> values and then, for each ColorMapEntry, setting up:
> - quantity = the index of the palette,
> - color = the HEX color value of the RGB values of the palette.
> (In such a context, are all the files of the same group, using the same
> palette?)

I assume (hope...) they do.

> As an instance, using gdalinfo on one of your KUST datasets, I get:
> Color Table (RGB with 256 entries)
>    0: 255,255,255,255
>    1: 250,250,247,255
>    2: 59,43,47,255
>    3: 214,0,124,255
>    4: 0,148,51,255
>    5: 250,250,200,255
>    6: 210,240,255,255
> ......
> I would transform the first 3 numbers (ignore the 4th) of each index in
> the related HEX color code:
> as an instance:
> 0: 255,255,255,255 ---- <ColorMapEntry color="#FFFFFF" quantity="0"
> opacity="0"/>
> 1: 250,250,247,255 ---- <ColorMapEntry color="#FAFAF7" quantity="1"
> opacity="0"/>
> ....
>
> <RasterSymbolizer>
> <Opacity>1.0</Opacity>
> <ColorMap type="values" extended="false">
> <ColorMapEntry color="#FFFFFF" quantity="0" opacity="0"/>
> <ColorMapEntry color="#FAFAF7" quantity="1" opacity="0"/>
> <ColorMapEntry color="#XXXXX" quantity="2" />
> ......
>
> Note that I would also make transparent the pixel with index = 1, which
> has color FAFAF7, to remove the void "near-white" areas around valid
> pixels, by setting opacity = 0.
>
> By this way, when areas are overlapped, you can get the "good" pixels
> from the bottom layers where the upper layers have 0 (FFFFFF) or 1 (FAFAF7).
>
> I have just tested it (very quickly by setting up a SLD with fake color
> values, since I didn't converted each RGB to Hex) and it produces good
> results. In attachment, you can find the final result: on the left side,
> there is the OpenLayers output with no style applied whilst the right
> side contains the output with style applied.

This works fine, I just get a couple of places where
pixellated "lines" on a layer lower in the stack are
visible through a transparent area in the topmost layer.

Nothing much to do about that, it is not an error as
such, just something the users will have to know about.

Thanks again!

-- 
mogul | nils weinander |
hudiksvallsgatan 4 113 30 stockholm sweden |
+46 8 4100 6456 | +46 709 78 28 37 |
[email protected] | skype: nils.weinander |
www.mogul.com

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to