Hi,

I would like to add also that with paletted images no other resampling method 
than ”nearest” makes sense. Try if removing “–r average” helps.

The safe way is to expand the paletted images into RGB(A) with the pct2pgb 
utility but the price is increased need for disk space.

-Jukka Rahkonen-



Lähettäjä: Daniele Romagnoli [mailto:daniele.romagn...@geo-solutions.it]
Lähetetty: 8. maaliskuuta 2018 16:17
Vastaanottaja: rich...@duif.net
Kopio: geoserver-devel <geoserver-devel@lists.sourceforge.net>
Aihe: Re: [Geoserver-devel] Geotiff: pyramids non transparant while original is 
transparent

Hi Richard,
I think that the problem is in how GDAL produces overviews with palettes:
https://lists.osgeo.org/pipermail/gdal-dev/2016-November/045589.html

The different behavior between QGIS and GeoServer is due to this:
QGIS (based on GDAL) uses the palette of the main image whilst some other 
readers, as an instance, the JAVA TiffReader used by GeoServer, uses overview's 
specific palette.

I'm also going to ask if there is any news on that on GDAL.

Hope this helps.
Regards,
Daniele

As further references:
------------------------------
https://trac.osgeo.org/gdal/ticket/2213
https://lists.osgeo.org/pipermail/gdal-dev/2016-November/045590.html
https://github.com/geosolutions-it/imageio-ext/issues/122



On Thu, Mar 8, 2018 at 2:37 PM, Richard Duivenvoorde 
<rdmaili...@duif.net<mailto:rdmaili...@duif.net>> wrote:
Hi All,

We have some Geotiff rasters with small lines (cables) on it.
Serving these transparent with Geoserver is fine, using
InputTransparentColor set to #ffffff.

But adding pyramids/overviews to it, the lines look better in QGIS, so
we added the pyramids using gdaladdo.

While that works for QGIS, for Geoserver (2.12.0) it looks as if the
InputTransparentColor in the overviews is NOT used?

The map is not transparent anymore, untill you zoom in at the base
level, THEN the map will be transparent again.

Using default raster sld.

Anybody a clue?

Regards,

Richard Duivenvoorde

PS:

Gdalinfo for the original tiff (without pyramids):

Driver: GTiff/GeoTIFF
Files: WATER.tif
Size is 13422, 20898
Coordinate System is:
PROJCS["Amersfoort / RD New",
    GEOGCS["Amersfoort",
        DATUM["Amersfoort",
            SPHEROID["Bessel 1841",6377397.155,299.1528128,
                AUTHORITY["EPSG","7004"]],

TOWGS84[565.2369,50.0087,465.658,-0.406857,0.350733,-1.87035,4.0812],
            AUTHORITY["EPSG","6289"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4289"]],
    PROJECTION["Oblique_Stereographic"],
    PARAMETER["latitude_of_origin",52.15616055555555],
    PARAMETER["central_meridian",5.38763888888889],
    PARAMETER["scale_factor",0.9999079],
    PARAMETER["false_easting",155000],
    PARAMETER["false_northing",463000],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["X",EAST],
    AXIS["Y",NORTH],
    AUTHORITY["EPSG","28992"]]
Origin = (132801.000000000000000,452878.000000000000000)
Pixel Size = (0.333333300000000,-0.333333300000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  132801.000,  452878.000) (  5d 3'49.93"E, 52d 3'53.02"N)
Lower Left  (  132801.000,  445912.001) (  5d 3'51.56"E, 52d 0' 7.60"N)
Upper Right (  137275.000,  452878.000) (  5d 7'44.84"E, 52d 3'53.60"N)
Lower Right (  137275.000,  445912.001) (  5d 7'46.14"E, 52d 0' 8.18"N)
Center      (  135038.000,  449395.000) (  5d 5'48.11"E, 52d 2' 0.62"N)
Band 1 Block=13422x1 Type=Byte, ColorInterp=Palette
  NoData Value=0
  Color Table (RGB with 256 entries)
    0: 255,255,255,0
    1: 0,0,255,255
    2: 0,0,0,255
    3: 0,0,0,255
    4: 0,0,0,255
    5: 0,0,0,255
    6: 0,0,0,255
    7: 0,0,0,255
    8: 0,0,0,255
    9: 0,0,0,255
   10: 0,0,0,255
etc....

Gdalinfo for the tiff with pyramids:

Driver: GTiff/GeoTIFF
Files: WATER.tif
Size is 13422, 20898
Coordinate System is:
PROJCS["Amersfoort / RD New",
    GEOGCS["Amersfoort",
        DATUM["Amersfoort",
            SPHEROID["Bessel 1841",6377397.155,299.1528128,
                AUTHORITY["EPSG","7004"]],

TOWGS84[565.2369,50.0087,465.658,-0.406857,0.350733,-1.87035,4.0812],
            AUTHORITY["EPSG","6289"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4289"]],
    PROJECTION["Oblique_Stereographic"],
    PARAMETER["latitude_of_origin",52.15616055555555],
    PARAMETER["central_meridian",5.38763888888889],
    PARAMETER["scale_factor",0.9999079],
    PARAMETER["false_easting",155000],
    PARAMETER["false_northing",463000],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["X",EAST],
    AXIS["Y",NORTH],
    AUTHORITY["EPSG","28992"]]
Origin = (132801.000000000000000,452878.000000000000000)
Pixel Size = (0.333333300000000,-0.333333300000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  132801.000,  452878.000) (  5d 3'49.93"E, 52d 3'53.02"N)
Lower Left  (  132801.000,  445912.001) (  5d 3'51.56"E, 52d 0' 7.60"N)
Upper Right (  137275.000,  452878.000) (  5d 7'44.84"E, 52d 3'53.60"N)
Lower Right (  137275.000,  445912.001) (  5d 7'46.14"E, 52d 0' 8.18"N)
Center      (  135038.000,  449395.000) (  5d 5'48.11"E, 52d 2' 0.62"N)
Band 1 Block=13422x1 Type=Byte, ColorInterp=Palette
  NoData Value=0
  Overviews: 6711x10449, 3356x5225, 1678x2613, 839x1307, 420x654,
210x327, 105x164, 53x82
  Color Table (RGB with 256 entries)
    0: 255,255,255,0
    1: 0,0,255,255
    2: 0,0,0,255
    3: 0,0,0,255
    4: 0,0,0,255
    5: 0,0,0,255
    6: 0,0,0,255
    7: 0,0,0,255
    8: 0,0,0,255
    9: 0,0,0,255
   10: 0,0,0,255
etc...

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net<mailto:Geoserver-devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/geoserver-devel



--
Regards,
Daniele Romagnoli
==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V 
for more information.
==

Ing. Daniele Romagnoli
Senior Software Engineer

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:      +39 0584 1660272

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

-------------------------------------------------------
AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i 
file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo 
è consentito esclusivamente al destinatario del messaggio, per le finalità 
indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne 
il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di 
procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro 
sistema. Conservare il messaggio stesso, divulgarlo anche in parte, 
distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, 
costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the 
attention and use of the named addressee(s) and may be confidential or 
proprietary in nature or covered by the provisions of privacy act (Legislative 
Decree June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not in 
accord with its purpose, any disclosure, reproduction, copying, distribution, 
or either dissemination, either whole or partial, is strictly forbidden except 
previous formal approval of the named addressee(s). If you are not the intended 
recipient, please contact immediately the sender by telephone, fax or e-mail 
and delete the information in this message that has been received in error. The 
sender does not give any warranty or accept liability as the content, accuracy 
or completeness of sent messages and accepts no responsibility  for changes 
made after they were sent or for other risks which arise as a result of e-mail 
transmission, viruses, etc.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to