1

I have a GeoTIFF file and have created a corresponding coverage store and layer inside of GeoServer. Set up went smoothly. However, when I go to view the layer in the Layer Preview, certain colors are distorted. This occurs only in GeoServer. When I open the same file in QGIS or Windows Photo Viewer it displays as expected.

I am just using the "raster" style in GeoServer for this layer. I'm using the Coverage Band Details from the file ("Reload band definitions"), which is a single band titled PALETTE_INDEX. It seems to be handling the color palette incorrectly because some colors appear correct and others are not. See a comparison of how the file appears in GeoServer WMS vs how it appears in QGIS or an image viewer.

Is there additional setup I need to do for GeoServer can render this image properly? Or is this a limitation inside GeoServer?

I am using GeoServer 2.21.0.

Geoserver WMS Rendering

QGIS Rendering

Here's the output provided by gdalinfo for this file:

Driver: GTiff/GeoTIFF
Files: Sectional-Basemap.tif
Size is 18470, 10643
Coordinate System is:
GEOGCRS["WGS 84",
    DATUM["World Geodetic System 1984",
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["geodetic latitude (Lat)",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["geodetic longitude (Lon)",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
Origin = (-79.948223406597407,40.279214486163497)
Pixel Size = (0.000449207687334,-0.000449207687334)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_DATETIME=2022:10:07 10:28:05
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
  TIFFTAG_SOFTWARE=Adobe Photoshop CC 2019 (Windows)
  TIFFTAG_XRESOLUTION=300
  TIFFTAG_YRESOLUTION=300
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  ( -79.9482234,  40.2792145) ( 79d56'53.60"W, 40d16'45.17"N)
Lower Left  ( -79.9482234,  35.4982971) ( 79d56'53.60"W, 35d29'53.87"N)
Upper Right ( -71.6513574,  40.2792145) ( 71d39' 4.89"W, 40d16'45.17"N)
Lower Right ( -71.6513574,  35.4982971) ( 71d39' 4.89"W, 35d29'53.87"N)
Center      ( -75.7997904,  37.8887558) ( 75d47'59.25"W, 37d53'19.52"N)
Band 1 Block=18470x1 Type=Byte, ColorInterp=Palette
  Color Table (RGB with 256 entries)
    0: 255,255,255,255
    1: 255,255,0,255
    2: 255,0,255,255
    3: 255,0,0,255
    4: 0,255,255,255
    5: 0,255,0,255
    6: 0,0,255,255
    7: 0,0,0,255
    8: 252,252,254,255
    9: 232,252,254,255
   10: 216,228,198,255
   11: 184,135,136,255
   12: 187,152,154,255
   13: 232,209,211,255
   14: 145,73,88,255
   15: 169,106,120,255
   16: 196,20,63,255
   17: 87,9,29,255
   18: 44,21,29,255
   19: 137,8,55,255
   20: 157,23,71,255
   21: 153,48,86,255
   22: 185,132,153,255
   23: 115,8,53,255
   24: 171,47,105,255
   25: 198,81,134,255
   26: 141,72,104,255
   27: 205,104,153,255
   28: 155,86,119,255
   29: 163,116,139,255
   30: 171,21,96,255
   31: 135,24,80,255
   32: 136,41,88,255
   33: 168,136,152,255
   34: 97,25,63,255
   35: 148,18,90,255
   36: 143,56,104,255
   37: 120,11,73,255
   38: 132,102,123,255
   39: 205,183,200,255
   40: 189,165,184,255
   41: 108,87,104,255
   42: 172,146,168,255
   43: 24,8,24,255
   44: 88,72,88,255
   45: 216,200,216,255
   46: 232,216,232,255
   47: 248,232,248,255
   48: 89,50,104,255
   49: 51,31,93,255
   50: 148,146,152,255
   51: 8,8,24,255
   52: 88,88,105,255
   53: 199,199,217,255
   54: 232,232,248,255
   55: 120,120,123,255
   56: 184,184,186,255
   57: 71,72,92,255
   58: 33,40,120,255
   59: 102,104,128,255
   60: 8,15,85,255
   61: 165,167,185,255
   62: 8,22,107,255
   63: 8,51,183,255
   64: 50,56,76,255
   65: 142,149,171,255
   66: 8,40,120,255
   67: 28,56,120,255
   68: 8,40,104,255
   69: 8,52,136,255
   70: 25,72,153,255
   71: 51,72,107,255
   72: 27,56,99,255
   73: 8,68,152,255
   74: 8,56,120,255
   75: 9,42,85,255
   76: 24,72,136,255
   77: 10,85,175,255
   78: 8,23,41,255
   79: 64,94,127,255
   80: 201,216,232,255
   81: 8,72,135,255
   82: 8,56,104,255
   83: 28,113,202,255
   84: 24,88,152,255
   85: 56,138,220,255
   86: 43,104,168,255
   87: 31,75,119,255
   88: 40,90,140,255
   89: 60,128,200,255
   90: 76,119,159,255
   91: 134,194,247,255
   92: 23,104,172,255
   93: 43,119,183,255
   94: 52,105,150,255
   95: 8,88,152,255
   96: 24,88,136,255
   97: 92,136,170,255
   98: 113,150,178,255
   99: 146,176,200,255
  100: 90,151,194,255
  101: 119,167,202,255
  102: 69,136,178,255
  103: 8,88,136,255
  104: 23,104,151,255
  105: 118,183,219,255
  106: 180,215,233,255
  107: 21,39,47,255
  108: 136,192,217,255
  109: 148,205,232,255
  110: 172,202,216,255
  111: 112,138,149,255
  112: 152,199,216,255
  113: 88,136,152,255
  114: 71,88,93,255
  115: 119,168,178,255
  116: 136,185,195,255
  117: 211,235,240,255
  118: 100,124,127,255
  119: 140,168,171,255
  120: 85,110,112,255
  121: 162,184,186,255
  122: 180,232,235,255
  123: 152,233,234,255
  124: 8,24,24,255
  125: 152,216,216,255
  126: 155,200,200,255
  127: 192,216,216,255
  128: 232,248,248,255
  129: 199,200,200,255
  130: 196,248,246,255
  131: 152,216,200,255
  132: 151,200,183,255
  133: 168,216,200,255
  134: 183,232,215,255
  135: 134,169,151,255
  136: 168,200,184,255
  137: 200,233,216,255
  138: 56,72,63,255
  139: 160,184,168,255
  140: 197,216,200,255
  141: 8,24,8,255
  142: 24,40,24,255
  143: 200,248,200,255
  144: 72,88,72,255
  145: 88,104,88,255
  146: 184,216,184,255
  147: 200,232,200,255
  148: 104,120,104,255
  149: 216,248,216,255
  150: 184,200,184,255
  151: 216,232,216,255
  152: 232,248,232,255
  153: 168,216,164,255
  154: 168,200,166,255
  155: 120,138,114,255
  156: 184,216,168,255
  157: 200,232,184,255
  158: 216,248,200,255
  159: 136,168,119,255
  160: 152,168,139,255
  161: 168,184,152,255
  162: 184,200,168,255
  163: 200,216,184,255
  164: 216,232,200,255
  165: 232,248,216,255
  166: 168,200,127,255
  167: 184,200,151,255
  168: 200,216,168,255
  169: 216,232,184,255
  170: 232,248,200,255
  171: 161,175,114,255
  172: 212,230,144,255
  173: 196,213,123,255
  174: 216,232,105,255
  175: 183,196,104,255
  176: 232,248,104,255
  177: 232,248,120,255
  178: 207,210,104,255
  179: 243,244,145,255
  180: 248,248,71,255
  181: 229,227,68,255
  182: 24,24,8,255
  183: 248,248,88,255
  184: 88,88,34,255
  185: 129,128,51,255
  186: 177,177,73,255
  187: 248,248,104,255
  188: 232,232,99,255
  189: 248,248,120,255
  190: 232,232,133,255
  191: 216,216,166,255
  192: 248,248,200,255
  193: 88,88,71,255
  194: 168,168,136,255
  195: 200,200,168,255
  196: 216,216,184,255
  197: 232,232,199,255
  198: 248,248,216,255
  199: 168,168,152,255
  200: 184,184,168,255
  201: 200,200,184,255
  202: 216,216,200,255
  203: 232,232,216,255
  204: 248,248,232,255
  205: 49,49,48,255
  206: 210,207,84,255
  207: 156,152,58,255
  208: 45,44,21,255
  209: 186,184,152,255
  210: 107,105,88,255
  211: 142,140,119,255
  212: 146,145,136,255
  213: 248,232,102,255
  214: 248,240,176,255
  215: 232,207,88,255
  216: 232,210,104,255
  217: 248,228,120,255
  218: 136,127,85,255
  219: 193,183,133,255
  220: 208,198,149,255
  221: 123,120,104,255
  222: 206,173,79,255
  223: 235,214,159,255
  224: 186,168,133,255
  225: 232,216,184,255
  226: 248,232,200,255
  227: 185,144,67,255
  228: 216,197,168,255
  229: 168,152,136,255
  230: 185,168,152,255
  231: 248,231,216,255
  232: 185,131,91,255
  233: 216,197,184,255
  234: 200,180,168,255
  235: 185,152,136,255
  236: 168,136,135,255
  237: 24,8,8,255
  238: 169,91,91,255
  239: 89,71,71,255
  240: 149,120,120,255
  241: 107,87,87,255
  242: 126,104,104,255
  243: 168,152,152,255
  244: 184,168,168,255
  245: 216,200,200,255
  246: 248,232,232,255
  247: 72,68,68,255
  248: 248,248,248,255
  249: 232,232,232,255
  250: 216,216,216,255
  251: 168,168,168,255
  252: 104,104,104,255
  253: 88,88,88,255
  254: 24,24,24,255
  255: 8,8,8,255

Here is the GeoServer log during a WMS GetMap request:

09 026 15:26:35 INFO   [geoserver.flow] - Request [WMS 1.3.0 GetMap] starting, processing through flow controllers
09 026 15:26:35 INFO   [geoserver.flow] - Request control-flow performed, running requests: 1, blocked requests: 0
09 026 15:26:35 DEBUG  [lite.gridcoverage2d] - Rendering using interpolation javax.media.jai.InterpolationBilinear@5dd7bf8d
09 026 15:26:35 DEBUG  [lite.gridcoverage2d] - Rendering using interpolation javax.media.jai.InterpolationBilinear@5dd7bf8d
09 026 15:26:35 DEBUG  [lite.gridcoverage2d] - Rendering using interpolation javax.media.jai.InterpolationBilinear@5dd7bf8d
09 026 15:26:35 DEBUG  [grid.io] - coverageName:Sectional-Basemap,imageChoice:0,subSamplingFactorX:24,subSamplingFactorY:24
09 026 15:26:35 DEBUG  [grid.io] - Coverage read: width = 770 height = 444
09 026 15:26:35 DEBUG  [lite.gridcoverage2d] - CoverageDimensionCustomizerReader.GridCoverageWrapper["Sectional-Basemap", GeneralEnvelope[(-79.9482234065974, 35.49829706986711), (-71.65135742153734, 40.2792144861635)], DefaultGeographicCRS["WGS 84"]]
│   PALETTE_INDEX([0.0 ... 255.0])
│       Category("data0":[0.0 ... 255.0])
└ Image=RenderedOp["ImageRead"]

09 026 15:26:35 DEBUG  [lite.gridcoverage2d] - CoverageDimensionCustomizerReader.GridCoverageWrapper["Sectional-Basemap", GeneralEnvelope[(-79.9482234065974, 35.49829706986711), (-71.65135742153734, 40.2792144861635)], DefaultGeographicCRS["WGS 84"]]
│   PALETTE_INDEX([0.0 ... 255.0])
│       Category("data0":[0.0 ... 255.0])
└ Image=RenderedOp["ImageRead"]

09 026 15:26:35 DEBUG  [lite.gridcoverage2d] - CoverageDimensionCustomizerReader.GridCoverageWrapper["Sectional-Basemap", GeneralEnvelope[(-79.9482234065974, 35.49829706986711), (-71.65135742153734, 40.2792144861635)], DefaultGeographicCRS["WGS 84"]]
│   PALETTE_INDEX([0.0 ... 255.0])
│       Category("data0":[0.0 ... 255.0])
└ Image=RenderedOp["ImageRead"]

09 026 15:26:35 DEBUG  [lite.gridcoverage2d] - CoverageDimensionCustomizerReader.GridCoverageWrapper["Sectional-Basemap", GeneralEnvelope[(-79.9482234065974, 35.49829706986711), (-71.65135742153734, 40.2792144861635)], DefaultGeographicCRS["WGS 84"]]
│   PALETTE_INDEX([0.0 ... 255.0])
│       Category("data0":[0.0 ... 255.0])
└ Image=RenderedOp["ImageRead"]

09 026 15:26:35 DEBUG  [lite.gridcoverage2d] - Applying Raster Symbolizer 
09 026 15:26:35 DEBUG  [lite.gridcoverage2d] - GridCoverage2D["Sectional-Basemap", GeneralEnvelope[(-79.9482234065974, 35.49829706986711), (-71.65135742153734, 40.2792144861635)], DefaultGeographicCRS["WGS 84"]]
└ Image=RenderedOp["Scale"]

09 026 15:26:35 INFO   [geoserver.wms] - 
Request: getMap
    Angle = 0.0
    BaseUrl = {removed}
    Bbox = SRSEnvelope[35.4638671875 : 40.31982421875, -80.013427734375 : -71.575927734375]
    BgColor = java.awt.Color[r=255,g=255,b=255]
    Buffer = 0
    Clip = null
    CQLFilter = null
    Crs = GEOGCS["WGS 84", 
  DATUM["World Geodetic System 1984", 
    SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], 
    AUTHORITY["EPSG","6326"]], 
  PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
  UNIT["degree", 0.017453292519943295], 
  AXIS["Geodetic latitude", NORTH], 
  AXIS["Geodetic longitude", EAST], 
  AUTHORITY["EPSG","4326"]]
    Elevation = []
    Env = {}
    Exceptions = application/vnd.ogc.se_inimage
    FeatureId = null
    FeatureVersion = null
    Filter = null
    Format = image/jpeg
    FormatOptions = {}
    Get = true
    Height = 442
    Interpolations = []
    Layers = [org.geoserver.wms.MapLayerInfo@f4badff9]
    MaxFeatures = null
    Palette = null
    RawKvp = {EXCEPTIONS=application/vnd.ogc.se_inimage, REQUEST=GetMap, FORMAT=image/jpeg, CRS=EPSG:4326, BBOX=35.4638671875,-80.013427734375,40.31982421875,-71.575927734375, VERSION=1.3.0, STYLES=, SERVICE=WMS, WIDTH=768, HEIGHT=442, TRANSPARENT=true, LAYERS=Sectional-Basemap}
    RemoteOwsType = null
    RemoteOwsURL = null
    Request = GetMap
    RequestCharset = UTF-8
    ScaleMethod = null
    Sld = null
    SldBody = null
    SldVersion = null
    SortBy = null
    SortByArrays = null
    SRS = urn:ogc:def:crs:EPSG:4326
    StartIndex = null
    StyleBody = null
    StyleFormat = sld
    Styles = [StyleImpl[ name=raster]]
    StyleUrl = null
    StyleVersion = null
    Tiled = false
    TilesOrigin = null
    Time = []
    Transparent = true
    ValidateSchema = false
    Version = 1.3.0
    ViewParams = null
    Width = 768
09 026 15:26:36 INFO   [geoserver.flow] - releasing flow controllers for [WMS 1.3.0 GetMap]
11
  • What output format do you use in layer preview?
    – user30184
    Commented Dec 9, 2022 at 10:17
  • can you add the gdalinfo output and have a look in the log file to see if it says anything relevant
    – Ian Turton
    Commented Dec 9, 2022 at 11:11
  • Do you have the sampling set to average rather than nearest neighbour?
    – Ian Turton
    Commented Dec 9, 2022 at 14:34
  • Any chance you can link to a small sample of this file? Commented Dec 9, 2022 at 14:54
  • @AndreaAime Yes, this is a sectional chart GeoTIFF from the FAA. It can be downloaded here: aeronav.faa.gov/visual/11-03-2022/sectional-files/… Commented Dec 9, 2022 at 15:02

1 Answer 1

1

Figured it out... the WMS "Default Interpolation Method" for the layer needed to be set to "Nearest neighbor". The default for this GeoServer instance was Bilinear. I thought I had tried all interpolation methods, but I realize I was actually changing the WCS "Default Interpolation Method" which is shown on the GeoServer admin UI just above the WMS settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.