Resending the mail to the list without the attachment being too big.

---------- Forwarded message ----------
From: Daniele Romagnoli <[email protected]>
Date: Wed, Nov 3, 2010 at 5:34 PM
Subject: Re: [Geoserver-users] ImageMosaic transparency problem - Email
found in subject
To: Nils Weinander <[email protected]>
Cc: "[email protected]" <
[email protected]>


Hi Nils,
please read below.

On Mon, Nov 1, 2010 at 9:12 AM, Nils Weinander <[email protected]>wrote:

> On 2010-10-29 10:02, Daniele Romagnoli wrote:
>
>> Hi Nils,
>> do you have any chance to share somehow with us the sample datasets
>> which raise this issue (or a reduced part of them) so we can better
>> check the mosaicking of them?
>>
>
> Daniele
>
> I have mananaged to extract a subset of the complete
> which weighs in at a more manageable 11 MB...
>
> http://dl.dropbox.com/u/2391034/SjokortReduced.tgz
>
> I have used default settings for the coverages, except
> for
>
> InputTransparentColor = #FAFAF7
> OutputTransparentColor = #FFFFFF
>
> for SjokortSkarReduced and SjokortSpecReduced
>

It is worth to point out that these settings are only applied on mosaicking
images for that mosaic. They are not shared between layers when overimposing
them on a getMap.
The black fill you are seeing when accessing a SjokortSkar nodata area comes
from the  backgroundValue which is set to zero (black). I think that the
geoserver 1.7.7 is old and the mosaic plugin doesn't contain the last code
which tries to setup a better background image by using the same
sampleModel/colorModel of the input images.
If you set it to a different value (as an instance, 240) you will see a
different color.


>
> Having read a bit more of the documentation I think
> I might have understood something I didn't get before:
> do I have to define a <ColorMap> in the SLD, with
> an entry with quantity="-9999" and label="nodata"
> and then set BackgroundValues to -9999?


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?)

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.

Please let me know.
Regards,
Daniele



>
> --
> 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
>
>


-- 
-------------------------------------------------------
Ing. Daniele Romagnoli
Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584962313
fax:     +39 0584962313
mob:   +39 328 0559267


http://www.geo-solutions.it
http://geo-solutions.blogspot.com/

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




-- 
-------------------------------------------------------
Ing. Daniele Romagnoli
Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584962313
fax:     +39 0584962313
mob:   +39 328 0559267


http://www.geo-solutions.it
http://geo-solutions.blogspot.com/

-------------------------------------------------------
------------------------------------------------------------------------------
Achieve Improved Network Security with IP and DNS Reputation.
Defend against bad network traffic, including botnets, malware, 
phishing sites, and compromised hosts - saving your company time, 
money, and embarrassment.   Learn More! 
http://p.sf.net/sfu/hpdev2dev-nov
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to