2

I have a multiband GeoTIFF that I'm serving up as a WMS. Doing a GetFeatureInfo request works fine, except for the ID of the pixel, which is the first band.

Somehow MapServer is converting the 10 digit number to a 8 digit exponent, thus missing off the last digits. Does anyone know how to force MapServer to write out all values in full?

Here is my mapfile:

MAP
  IMAGETYPE PNG24
  NAME "map_file"
  EXTENT -180 -90 180 90

  OUTPUTFORMAT
    DRIVER "GD/PNG"
    EXTENSION "png"
    IMAGEMODE RGB
    MIMETYPE "image/png"
    NAME "png24"
  END

  PROJECTION
    "init=epsg:4326"
  END

  WEB
    METADATA
      "wfs_title" "WFS Server"
      "wfs_srs" "EPSG:4326 EPSG:3857"
      "wfs_enable_request" "*"

      "wms_title" "WMS Server"
      "wms_enable_request" "GetMap GetCapabilities GetLegendGraphic GetFeatureInfo"
      "wms_srs" "EPSG:4326 EPSG:3857"
      "wms_feature_info_mime_type" "text/html"
    END
  END

  LAYER
    NAME "map_layer"
    EXTENT -180 -90 180 90
    STATUS ON
    TYPE RASTER
    PROCESSING "BANDS=1,2,3,4,5,6,7,8" 
    PROCESSING "RESAMPLE=AVERAGE"
    DATA "/file.tif"
    TEMPLATE "text.htm"
    PROJECTION
      "init=epsg:4326"
    END
    METADATA
      "wms_title"         "forecast"
      "wms_include_items" "value_list"
      "wms_getfeatureinfo_formatlist" "text/plain,application/vnd.ogc.gml,gml"
      "gml_include_items" "all"
    END
  END #layer
END
1
  • 1
    Just curious, does it do it for all output formats?
    – nmtoken
    Commented Jul 10 at 9:55

1 Answer 1

1

You could try "gml_types" "auto" to your LAYER METADATA:

    METADATA
      "wms_title"         "forecast"
      "wms_include_items" "value_list"
      "wms_getfeatureinfo_formatlist" "text/plain,application/vnd.ogc.gml,gml"
      "gml_include_items" "all"
      "gml_types" "auto" 
    END

For vector layers you can override the default types, but I'm not sure if this works for raster:

"gml_value_0_type" "long"
1
  • thanks, tried that but it didn't work. Commented Jul 15 at 9:50

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.