Ciao Simone,
I tried with ChannelSelection in SLD before, but I think I wasnt using
it with right combination of mosaic parameters.
At the end I solved the problem by setting these parameters:
Mosaic parameters:
BackgroundValues :255
InputTransparentColor: FFFFFF
OutputTransparentColor: FFFFFF
HandleFootprint: false
SLD:
<RasterSymbolizer>
<ChannelSelection>
<GrayChannel>
<SourceChannelName>1</SourceChannelName>
</GrayChannel>
</ChannelSelection>
<ColorMap type="values" extended="false">
<ColorMapEntry color="#ff6600" quantity="0" label="0"
opacity="1" />
<ColorMapEntry color="#ffffff" quantity="1" label="1"
opacity="0" />
</ColorMap>
</RasterSymbolizer>
(+ adding transparent=true to request off course )
Grazie Daniele&Simone :)
Regards,
Ivan
On Fri, Nov 5, 2010 at 12:49 PM, Simone Giannecchini
<[email protected]> wrote:
> Ciao Ivan,
> the error you are getting is expected since the RasterSymbolizer
> is supposed to be used only for single band raster (you can select a
> band prior to
> applying it using the proper SLD tag).
>
> If you first apply the directo to transform a color into transparent,
> you are going from 1 band to at least 2 (or 4 for RGBA) therefore the
> RasterSymbolizer
> cannot be applied directly since it finds two bands instead of 1.
>
> Simone.
> -------------------------------------------------------
> ===
> Notice that our office phone number has recently changed!
> Please, update your records!
> ===
> Ing. Simone Giannecchini
> GeoSolutions S.A.S.
> Founder
> Via Poggio alle Viti 1187
> 55054 Massarosa (LU)
> Italy
>
> phone: +39 0584962313
> fax: +39 0584962313
> mob: +39 333 8128928
>
>
> http://www.geo-solutions.it
> http://geo-solutions.blogspot.com/
> http://www.linkedin.com/in/simonegiannecchini
> http://twitter.com/simogeo
>
> -------------------------------------------------------
>
>
>
> On Fri, Nov 5, 2010 at 12:29 PM, Ivan Grcic <[email protected]> wrote:
>> Thanks for the response Daniele.
>>
>> Indeed, changing the footprint to false and inputTransparentColor to
>> white does the job. I haven't payed too much attention to footprint
>> parameter before.
>>
>> But there's new problem emerging now. Before I used specific style to
>> make white color transparent for 1bit tiffs, such as:
>> <RasterSymbolizer>
>> <ColorMap type="values" extended="true">
>> <!-- paint black values with red-->
>> <ColorMapEntry color="#ff0000" quantity="0" label="0"
>> opacity="1"/>
>> <!-- make white transparent-->
>> <ColorMapEntry color="#ffffff" quantity="1" label="1"
>> opacity="0"/>
>> </ColorMap>
>> </RasterSymbolizer>
>>
>> When I set inputTransparentColor error is thrown: Band number 2 is not
>> valid (full error attached)
>>
>> If I use default raster style, and define backgroundValues to 255, and
>> OutputTransparentColor: FFFFFF and then later in request put
>> transparent=true , image gets transparent for white color.
>>
>> But this way I cant define some other color for black values.
>>
>> I will try and play with RasterSymbolizer more, any suggestions welcomed :)
>>
>> regards,
>> Ivan
>>
>> Any suggestions?
>> On Fri, Nov 5, 2010 at 11:17 AM, Daniele Romagnoli
>> <[email protected]> wrote:
>>> Hi Ivan,
>>> did you set the HandleFootprint parameter to false?
>>> 2.0.2 relates on 2.6.4 which provides support for footprint (Essentially, a
>>> shapefile providing data validity area for each granule composing the
>>> mosaic). When using it, each granule is cropped on its footprint borders
>>> before doing the mosaic. Therefore, there is no more need to mask a
>>> "white-fill" or a "black-fill" or an "inputTransparentColor-fill" to exclude
>>> the granule's void area to mosaic it.
>>> I have tried your sample data on 2.0.2 by setting the parameter to false and
>>> it works fine.
>>> Please let me know if you can confirm this.
>>> I agree that maybe we can setup the default value for this parameter to
>>> false.
>>>
>>> Regards,
>>> Daniele
>>>
>>> On Thu, Nov 4, 2010 at 1:16 PM, Ivan Grcic <[email protected]> wrote:
>>>>
>>>> Hi all,
>>>>
>>>> Im having problems with setting layer input transparent color since I
>>>> upgraded to geoserver 2.0.2.
>>>>
>>>> I have scanned B&W images, as seen in:
>>>>
>>>> http://docs.geoserver.org/2.0.2/user/tutorials/image_mosaic_plugin/imagemosaic.html#scanned-maps-mosaic-configuration
>>>>
>>>> With identical data and identical configuration in geoservers, i cant
>>>> get this to work on 2.0.2, while its working just perfect in 2.0.1.
>>>> (im attaching two screenshots from both geoservers)
>>>>
>>>> Has something maybe changed in 2.0.2 regarding to
>>>> InputTransparentColor ( or is this maybe a bug)?
>>>>
>>>> Here is gdalinfo on raster:
>>>> Size is 12502, 8335
>>>> Coordinate System is `'
>>>> Origin = (537499.953137000091374,651000.012564999982715)
>>>> Pixel Size = (0.060000000000000,-0.060000000000000)
>>>> Image Structure Metadata:
>>>> COMPRESSION=LZW
>>>> INTERLEAVE=BAND
>>>> Corner Coordinates:
>>>> Upper Left ( 537499.953, 651000.013)
>>>> Lower Left ( 537499.953, 650499.913)
>>>> Upper Right ( 538250.073, 651000.013)
>>>> Lower Right ( 538250.073, 650499.913)
>>>> Center ( 537875.013, 650749.963)
>>>> Band 1 Block=256x256 Type=Byte, ColorInterp=Palette
>>>> Overviews: 3126x2084, 1563x1042, 782x521, 391x261, 196x131, 98x66, 49x33
>>>> Image Structure Metadata:
>>>> NBITS=1
>>>> Color Table (RGB with 2 entries)
>>>> 0: 0,0,0,255
>>>> 1: 255,255,255,255
>>>>
>>>> Regards,
>>>> Ivan
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> 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
>>>>
>>>
>>>
>>>
>>> --
>>> -------------------------------------------------------
>>> 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/
>>>
>>> -------------------------------------------------------
>>>
>>>
>>
>>
>>
>> --
>> Ivan Grcic
>>
>> ------------------------------------------------------------------------------
>> 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
>>
>>
>
------------------------------------------------------------------------------
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