I was not able to get InputTransparentColor to work as expected but I did
find a another way.

This little gem helped me understand how "mask bands" work in geotiff:
http://docs.oam.osgeo.org/storage/creating.html. I found the GDAL docs
pretty confusing on that topic.

Basically you have to break it into 2 steps: 1) use gdalwarp to create an
alpha band representing your nodata areas, then 2) use gdal_translate to
convert it back into 3 band RGB designating the input alpha band as mask
band. Then you can use JPEG compression with YCBRC photometric option.
Combine that with layer settings from
http://docs.geoserver.org/stable/en/user/tutorials/imagemosaic_footprint/imagemosaic_footprint.html#raster-masking
and the result is exactly what I need.

Thanks Devin for the suggestions.




Jason Newmoyer
Newmoyer Geospatial Solutions
843.606.0424
ja...@newmoyergeospatial.com



On Thu, Feb 2, 2017 at 9:33 AM, Jason Newmoyer <ja...@newmoyergeospatial.com
> wrote:

> I checked my settings and I am using Nearest Neighbor in all cases.
>
> I've also tried tried to generate an alpha band with "gdalwarp -srcnodata
> 0 -dstalpha" but it will not allow me to use YCBCR photometric option
> because apparently it requires it to be exactly 3 output bands. Anyone know
> how to work around this?
>
>
> Jason Newmoyer
> Newmoyer Geospatial Solutions
> 843.606.0424 <(843)%20606-0424>
> ja...@newmoyergeospatial.com
>
>
>
> On Thu, Feb 2, 2017 at 9:08 AM, Devin Eyre <devin.e...@stormgeo.com>
> wrote:
>
>> Both.  For WMS, there's just one setting for the whole geoserver, but if
>> you're using WCS, there's a per-layer setting for interpolation.
>> ------------------------------
>> *From:* Jason Newmoyer <ja...@newmoyergeospatial.com>
>> *Sent:* Wednesday, February 1, 2017 6:00 PM
>> *To:* Devin Eyre
>> *Cc:* GeoServer Mailing List List; Lonnie Matsuno
>> *Subject:* Re: [Geoserver-users] Cannot get InputTransparentColor to
>> work in ImageMosaic
>>
>> Do you mean in GeoServer layer settings or when processing with GDAL?
>>
>> On Jan 31, 2017 2:57 PM, "Devin Eyre" <devin.e...@stormgeo.com> wrote:
>>
>>> You'll also need to use nearestNeighbor method (i.e., don't interpolate)
>>> for interpolation.
>>> ------------------------------
>>> *From:* Lonnie Matsuno <lonnie.mats...@valtus.com>
>>> *Sent:* Tuesday, January 31, 2017 1:14 PM
>>> *To:* GeoServer Mailing List List
>>> *Subject:* Re: [Geoserver-users] Cannot get InputTransparentColor to
>>> work in ImageMosaic
>>>
>>>
>>> I'm not sure if this is the same issue, but we encountered "bleeding" of
>>> near black pixels with geotiff's with JPEG compression. We have
>>> subsequently switched to a lossless compression in our source geotiffs and
>>> it works pretty well.
>>>
>>>
>>>
>>> Lonnie
>>> ------------------------------
>>> *From:* Devin Eyre [devin.e...@stormgeo.com]
>>> *Sent:* January 31, 2017 12:01 PM
>>> *To:* Jason Newmoyer
>>> *Cc:* GeoServer Mailing List List
>>> *Subject:* Re: [Geoserver-users] Cannot get InputTransparentColor to
>>> work in ImageMosaic
>>>
>>> Have you tried this:
>>>
>>> http://osgeo-org.1560.x6.nabble.com/Re-How-should-i-set-outp
>>> ut-transparent-color-no-color-in-image-mosaic-plug-in-in-
>>> Geo-server-version--td5027043.html
>>> ------------------------------
>>> *From:* Jason Newmoyer <ja...@newmoyergeospatial.com>
>>> *Sent:* Tuesday, January 31, 2017 11:33 AM
>>> *To:* Devin Eyre
>>> *Cc:* GeoServer Mailing List List
>>> *Subject:* Re: [Geoserver-users] Cannot get InputTransparentColor to
>>> work in ImageMosaic
>>>
>>> Yes, when I do that it turns the black areas transparent in the
>>> resulting image, as expected. However, the tiles still overlap each other
>>> instead of showing through.
>>>
>>> Here's a piece of the image. The area marked red I would expect to be
>>> imagery showing through from the tile underneath when using
>>> InputTransparentColor.
>>>
>>> [image: Inline image 1]
>>>
>>>
>>> Jason Newmoyer
>>> Newmoyer Geospatial Solutions
>>> 843.606.0424
>>> ja...@newmoyergeospatial.com
>>>
>>>
>>>
>>> On Tue, Jan 31, 2017 at 11:53 AM, Devin Eyre <devin.e...@stormgeo.com>
>>> wrote:
>>>
>>>> Have you tried setting OutputTransparentColor to 000000?
>>>> ------------------------------
>>>> *From:* Jason Newmoyer <ja...@newmoyergeospatial.com>
>>>> *Sent:* Tuesday, January 31, 2017 9:33 AM
>>>> *To:* GeoServer Mailing List List
>>>> *Subject:* [Geoserver-users] Cannot get InputTransparentColor to work
>>>> in ImageMosaic
>>>>
>>>> GeoServer 2.10, RHEL 6
>>>>
>>>> I cannot seem to get the InputTransparentColor configuration to work as
>>>> expected with my ImageMosaic layer. I have a mosaic of satellite imagery
>>>> (standard RGB, YCbCr JPEG compressed with overviews) tiled into a regular
>>>> grid of square tiles. Tile index is stored in PostGIS using a view. Tiles
>>>> are ordered (zindex column) so newest imagery ends up on top.
>>>>
>>>> When two tiles overlap, the evil black nodata fringe of the top most
>>>> layer shows over top of the next tile underneath. I believe
>>>> InputTransaparentColor is intended to fix this. However setting it to
>>>> 000000 actually results in a FULLY transparent image. Not an exception
>>>> response, an actual transparent png.
>>>>
>>>> The granules do not contain an alpha band, raster mask, or nodata
>>>> values. The nodata sections are actually fully black pixels.
>>>>
>>>> Any ideas?
>>>>
>>>> [image: Inline image 1]
>>>>
>>>> Jason Newmoyer
>>>> Newmoyer Geospatial Solutions
>>>> 843.606.0424
>>>> ja...@newmoyergeospatial.com
>>>>
>>>>
>>>>
>>>
>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> Geoserver-users mailing list
>>> Geoserver-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>>
>>>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to