[Geoserver-users] Transparent background in ImagePyramid

I've a large imagepyramid that has an area of nodata (value 0) which is
currently being shown as black. I'd like to set the background to
transparent. I tried changing BackgroundValues; InputTransparentColor and
OutputTransparentColor but nothing seemed to work. Is it possible to have
transparent background in imagepyramids?

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Transparent-background-in-ImagePyramid-tp5151837.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Dear Daniele,
the transparent trick can be done using either OutputTransparentColor
or InputTransparentColor.

As a start could you to paste here the output of gdalinfo on a typical
element of your pyramid?

I would also report the version of GeoServer as well as the
combination you used for transparency.

Regards,
Simone Giannecchini

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

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

On Fri, Jul 18, 2014 at 7:32 PM, DanielV <daniel.victoria@anonymised.com> wrote:

I've a large imagepyramid that has an area of nodata (value 0) which is
currently being shown as black. I'd like to set the background to
transparent. I tried changing BackgroundValues; InputTransparentColor and
OutputTransparentColor but nothing seemed to work. Is it possible to have
transparent background in imagepyramids?

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Transparent-background-in-ImagePyramid-tp5151837.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi Simone,

Thanks for your attention. I'm using GeoServer 2.4.0 and right now I'm
trying to use
Background value=0
InputTransparentColor=000000

But when I open the openlayer image preview in Geoserver, I still see the
black border around the image. One thing I noticed is that by using the
InputTransparentColor, I now have an alpha channel with correct values but
apparently the image preview is not respecting the alpha channel.

Bellow is the gdalinfo for one of the pyramids tile.

Driver: GTiff/GeoTIFF
Files: mosaico_sul_01_01.tif
Size is 8192, 8192
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (-57.754539999999999,-22.341123000000000)
Pixel Size = (0.000048008830920,-0.000048008830920)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( -57.7545400, -22.3411230) ( 57d45'16.34"W, 22d20'28.04"S)
Lower Left ( -57.7545400, -22.7344113) ( 57d45'16.34"W, 22d44' 3.88"S)
Upper Right ( -57.3612517, -22.3411230) ( 57d21'40.51"W, 22d20'28.04"S)
Lower Right ( -57.3612517, -22.7344113) ( 57d21'40.51"W, 22d44' 3.88"S)
Center ( -57.5578958, -22.5377672) ( 57d33'28.42"W, 22d32'15.96"S)
Band 1 Block=512x512 Type=Byte, ColorInterp=Red
Band 2 Block=512x512 Type=Byte, ColorInterp=Green
Band 3 Block=512x512 Type=Byte, ColorInterp=Blue

Cheers
Daniel

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Transparent-background-in-ImagePyramid-tp5151837p5151840.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

An update. Loading the WMS layer in QGis will also show the black background,
even though it recognizes the alpha band with correct values (0 for areas
that should be transparent and 255 for the rest)

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Transparent-background-in-ImagePyramid-tp5151837p5151843.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Ciao Daniel,
can you provide a sample dataset?

Regards,
Simone Giannecchini

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

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

On Fri, Jul 18, 2014 at 7:49 PM, DanielV <daniel.victoria@anonymised.com> wrote:

Hi Simone,

Thanks for your attention. I'm using GeoServer 2.4.0 and right now I'm
trying to use
Background value=0
InputTransparentColor=000000

But when I open the openlayer image preview in Geoserver, I still see the
black border around the image. One thing I noticed is that by using the
InputTransparentColor, I now have an alpha channel with correct values but
apparently the image preview is not respecting the alpha channel.

Bellow is the gdalinfo for one of the pyramids tile.

Driver: GTiff/GeoTIFF
Files: mosaico_sul_01_01.tif
Size is 8192, 8192
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (-57.754539999999999,-22.341123000000000)
Pixel Size = (0.000048008830920,-0.000048008830920)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( -57.7545400, -22.3411230) ( 57d45'16.34"W, 22d20'28.04"S)
Lower Left ( -57.7545400, -22.7344113) ( 57d45'16.34"W, 22d44' 3.88"S)
Upper Right ( -57.3612517, -22.3411230) ( 57d21'40.51"W, 22d20'28.04"S)
Lower Right ( -57.3612517, -22.7344113) ( 57d21'40.51"W, 22d44' 3.88"S)
Center ( -57.5578958, -22.5377672) ( 57d33'28.42"W, 22d32'15.96"S)
Band 1 Block=512x512 Type=Byte, ColorInterp=Red
Band 2 Block=512x512 Type=Byte, ColorInterp=Green
Band 3 Block=512x512 Type=Byte, ColorInterp=Blue

Cheers
Daniel

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Transparent-background-in-ImagePyramid-tp5151837p5151840.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi Simone,

Think I discovered the problem. I was using a custom style for the piramid
and since I'm not an expert in setting those rasterstyle parameters, I
probably forgot to put the alpha band on the SLD file. I've changed to the
default raster style that comes with Geoserver and /voila/, no more black
borders.

I discovered this while preparing a sample dataset for you so, thanks for
your help in fixing my mistake. I'll also update the stackexchange question
I made about the topic.

Cheers
Daniel - now with transparent backgrounds

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Transparent-background-in-ImagePyramid-tp5151837p5152119.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Oops, spoke too soon. The problem was identified, that is, since I'm using a
custom rasterstyle, raster transparency is not respected. But I can't alter
the sld in order for the transparency to work (at least I don't know how). I
also tried setting 0 as nodata in every pyramid granule but it did not work.

The way I see it, I should probably have to alter my images and put the
bands in the desired order (3,2,1) prior to building the pyramid. Then I can
use the default raster style. Or is there another way of getting raster
transparency with a custom SLD?

I've uploaded a sample dataset (380Mb) to
https://dl.dropboxusercontent.com/u/19035357/mosaic_rapid.7z

I contains 3 rescaled rapideye images, the virtual dataset used, a raster
pyramid and the SLD that I'm using.
Thanks
Daniel

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Transparent-background-in-ImagePyramid-tp5151837p5152124.html
Sent from the GeoServer - User mailing list archive at Nabble.com.