2

I am having some trouble trying to serve 48 bit GeoTIFF images with a MapServer 7 WMS.

I created two layers for speed purposes with scale limiters.

The low resolution (lowres) layer is served well and looks good, it is 24 bit GeoTIFF data (8 bits per channel). But if the layer changes to the high resolution (highres), 48 bit GeoTIFF data (16 bits per channel), the data is wrong.

I searched for some hints regarding a similar issue but could not find something.

This is a screenshot of the loaded highres layer. It does not matter if I load a bbox inside the browser, QGIS or another WMS client. The highres data looks always the same.

image loaded from highres layer:

https://i.imgur.com/PJVnZW6.jpg

The Mapfile:

MAP
NAME TESTMAP
STATUS ON
SIZE 4000 4000
EXTENT 606000 5400000 642000 5878000

OUTPUTFORMAT
 NAME "GEOTIFF"
 DRIVER "GDAL/GTiff"
 MIMETYPE "image/tiff"
 IMAGEMODE RGB
 EXTENSION "tif"
END # outputformat end

WEB
    IMAGEPATH "/maps/2016"
    IMAGEURL "/maps/2016"

    METADATA
      "wms_title" "TEST"
      "wms_onlineresource"  "http://192.168.3.235:8080/?map=eo" ### recommended
      "wms_srs" "epsg:32718"
      "wms_enable_request" "*"
      "wms_formatlist" "image/jpeg, image/geotiff"
      "wms_format" "image/geotiff"

    END #METADATA end
END #web end

PROJECTION
"init=epsg:32718"

END #PROJECTION end
  LAYER
      NAME EO2016_Full 
      GROUP EOGroup
      STATUS ON
      TYPE RASTER
      TILEINDEX "/maps/SHP/2016higres.shp"
      TILEITEM "Location"
      MINSCALEDENOM 1
      MAXSCALEDENOM 20000

      METADATA
      "wms_title"  "HighRes"
      "wcs_extent" "606000 5400000 642000 5878000"
      "wms_srs" "epsg:32718"
      "wcs_formats" "GEOTIFF"
      "wcs_bandcount" "3"
      END #METADATA end

      PROJECTION
      "init=epsg:32718"
      END #PROJECTION end
  END #layer END

  LAYER
      NAME EO2016_Overview
      GROUP EOGroup
      STATUS ON
      TYPE RASTER
      TILEINDEX "/maps/SHP/2016lowres.shp"
      TILEITEM "Location"
      MINSCALEDENOM 20000

      METADATA
      "wms_title"  "LowRes"
      "wcs_extent" "606000 5400000 642000 5878000"
      "wms_srs" "epsg:32718"
      "wcs_formats" "GEOTIFF"
      "wcs_bandcount" "3"

      END # METADATA end

      PROJECTION
      "init=epsg:32718"
      END

  END #layer end

END #map end

Geotiff gdalinfo for one file:

 Driver: GTiff/GeoTIFF
 Files: XXXXX.tif
 Size is 4000, 4000
 Coordinate System is:
 PROJCS["WGS 84 / UTM zone 18S",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.2572235604902,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-75],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",10000000],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","32718"]]
 Origin = (896000.000000000000000,6144000.000000000000000)
 Pixel Size = (0.500000000000000,-0.500000000000000)
 Metadata:
  AREA_OR_POINT=Area
 Image Structure Metadata:
  INTERLEAVE=PIXEL
 Corner Coordinates: 
 Upper Left  (  896000.000, 6144000.000) ( 70d40'26.07"W, 34d46' 9.64"S)
 Lower Left  (  896000.000, 6142000.000) ( 70d40'22.69"W, 34d47'14.39"S)
 Upper Right (  898000.000, 6144000.000) ( 70d39' 7.62"W, 34d46' 6.84"S)
 Lower Right (  898000.000, 6142000.000) ( 70d39' 4.21"W, 34d47'11.58"S)
 Center      (  897000.000, 6143000.000) ( 70d39'45.15"W, 34d46'40.62"S)
 Band 1 Block=4000x1 Type=UInt16, ColorInterp=Red
  Overviews: 2000x2000, 1000x1000, 500x500, 250x250, 125x125, 63x63, 32x32, 
 16x16, 8x8
 Band 2 Block=4000x1 Type=UInt16, ColorInterp=Green
  Overviews: 2000x2000, 1000x1000, 500x500, 250x250, 125x125, 63x63, 32x32, 
 16x16, 8x8
 Band 3 Block=4000x1 Type=UInt16, ColorInterp=Blue
  Overviews: 2000x2000, 1000x1000, 500x500, 250x250, 125x125, 63x63, 32x32, 
 16x16, 8x8
  • Does it work as a WCS request? – nmtoken Apr 12 '17 at 7:48
  • the "wcs..." in the map file are copy paste relics. i forgot to delete them. I tried to get a wcs service running on the tile_indexed data set but it is not working. but if i add the wcs services to qgis i always get a timeout but no error message. this is the testing map file for the WCS iam working with at the moment: – zwnk Apr 12 '17 at 12:40
  • wcs map file: pastebin.com/kveNQjBX – zwnk Apr 12 '17 at 12:47
1

The mapserver user mailing list helped to solve the problem.

The high resolution layer is lacking the attribute PROCESSING "SCALE=AUTO":

  LAYER
      # 50cm full resolution baselayer
      NAME 50cm 
      GROUP TEST
      STATUS ON
      TYPE RASTER
      TILEINDEX "/maps/SHP/2016highres.shp"
      TILEITEM "Location"
      MINSCALEDENOM 1
      MAXSCALEDENOM 20000

      PROCESSING "SCALE=AUTO" <-- WAS MISSING


      METADATA
      "wms_title"  "50cm"
      "wms_srs" "epsg:32718"
      "wms_format" "image/geotiff_16"
      END #METADATA end

      PROJECTION
      "init=epsg:32718"
      END #PROJECTION end
  END #layer END

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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