5

I'm using PAN image for raster publishing but the output in browser shows a full white image? Please give me the solution? My map file is ass follows:

MAP
NAME "terra"
# Map image size
SIZE 600 600
UNITS dd
EXTENT 77.0962025047 23.8718740333 84.6389301196 30.4075924299
  PROJECTION
   'proj=longlat'
   'ellps=WGS84'
   'datum=WGS84'
   'no_defs'
  END
  # Background color for the map canvas -- change as desired
  IMAGECOLOR 155 155 155
  IMAGEQUALITY 95
  IMAGETYPE png

  OUTPUTFORMAT
   NAME png
   DRIVER 'GD/PNG'
   MIMETYPE 'image/png'
   IMAGEMODE RGBA
   EXTENSION 'png'
  END
  # Legend
  LEGEND
      IMAGECOLOR 255 255 255
    STATUS ON
    KEYSIZE 18 12
    LABEL
      TYPE BITMAP
      SIZE MEDIUM
      COLOR 0 0 0
    END
  END

  # Web interface definition. Only the template parameter
  # is required to display a map. See MapServer documentation
  WEB
    # Set IMAGEPATH to the path where MapServer should
    # write its output.
    IMAGEPATH "../tmp"

    # Set IMAGEURL to the url that points to IMAGEPATH
    # as defined in your web server configuration
    IMAGEPATH "../tmp"

    # WMS server settings
    METADATA
      'wms_title'           'terra'
      'wms_onlineresource'  'http://my.host.com/cgi-bin/mapserv?map=wms.map&'
      'wms_srs'             'EPSG:4326'
    END

    #Scale range at which web interface will operate
    # Template and header/footer settings
    # Only the template parameter is required to display a map. See MapServer documentation
  END
  LAYER
    NAME "UPC1PAN10SISDP2012"
    TYPE RASTER
    OFFSITE 0 0 0
    DATA 'Z:\Rasters\10K\10D\UP\UPC1PAN10SISDP2012.img '
    METADATA
      'wms_title' 'UPC1PAN10SISDP2012'
      'WMS_ENABLE_REQUEST' '*'
    END
    STATUS DEFAULT
    TRANSPARENCY 100
    PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'datum=WGS84'
    'no_defs'
 ''
    END
  END

END
  • TRANSPARENCY 100makes the layer totally transparent. – user30184 Jan 28 '15 at 5:55
  • my out put showing black dotted boarder and remaining inside white.... – Satya Chandra Jan 28 '15 at 6:47
  • There may be something else wrong too but if you do not correct the transparency you will never get it right. Did you already correct it? – user30184 Jan 28 '15 at 6:53
  • ya i correct it....even image showing in white color but back ground color of image is as desired myself – Satya Chandra Jan 28 '15 at 6:56
  • Add gdalinfo report about Z:\Rasters\10K\10D\UP\UPC1PAN10SISDP2012.img into your question. – user30184 Jan 28 '15 at 7:19
1

There are two options 1) if input data is 16 bit convert into 8 bit data. 2)By placing PROCESSING "SCALE=AUTO" as follow

 MAP
NAME "terra"
# Map image size
SIZE 600 600
UNITS dd
EXTENT 77.0962025047 23.8718740333 84.6389301196 30.4075924299
  PROJECTION
   'proj=longlat'
   'ellps=WGS84'
   'datum=WGS84'
   'no_defs'
  END
  # Background color for the map canvas -- change as desired
  IMAGECOLOR 155 155 155
  IMAGEQUALITY 95
  IMAGETYPE png

  OUTPUTFORMAT
   NAME png
   DRIVER 'GD/PNG'
   MIMETYPE 'image/png'
   IMAGEMODE RGBA
   EXTENSION 'png'
  END
  # Legend
  LEGEND
      IMAGECOLOR 255 255 255
    STATUS ON
    KEYSIZE 18 12
    LABEL
      TYPE BITMAP
      SIZE MEDIUM
      COLOR 0 0 0
    END
  END

  # Web interface definition. Only the template parameter
  # is required to display a map. See MapServer documentation
  WEB
    # Set IMAGEPATH to the path where MapServer should
    # write its output.
    IMAGEPATH "../tmp"

    # Set IMAGEURL to the url that points to IMAGEPATH
    # as defined in your web server configuration
    IMAGEPATH "../tmp"

    # WMS server settings
    METADATA
      'wms_title'           'terra'
      'wms_onlineresource'  'http://my.host.com/cgi-bin/mapserv?map=wms.map&'
      'wms_srs'             'EPSG:4326'
    END

    #Scale range at which web interface will operate
    # Template and header/footer settings
    # Only the template parameter is required to display a map. See MapServer documentation
  END
  LAYER
    NAME "UPC1PAN10SISDP2012"
    TYPE RASTER
    PROCESSING "SCALE=AUTO"
    OFFSITE 0 0 0
    DATA 'Z:\Rasters\10K\10D\UP\UPC1PAN10SISDP2012.img '
    METADATA
      'wms_title' 'UPC1PAN10SISDP2012'
      'WMS_ENABLE_REQUEST' '*'
    END
    STATUS DEFAULT
    TRANSPARENCY 100
    PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'datum=WGS84'
    'no_defs'
 ''
    END
  END

END
  • It is usefull.. – CHANDU Apr 16 '15 at 5:36

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.