1

I am trying to display raster image using MapServer but it is not displaying anything, page is blank

My map file code is:

MAP      
NAME "ny_pop"
SHAPEPATH "C:\ms4w\apps\webgis\mpgaps"       
EXTENT 8240841.450745 2400319.900386 9218007.463612 3107183.406947
SIZE  450 500
STATUS OFF
DEBUG ON
IMAGETYPE "png"

PROJECTION
    "init=epsg:900913"
END

OUTPUTFORMAT
  NAME "png"
  DRIVER AGG/PNG
  MIMETYPE "image/png"
  IMAGEMODE RGB
  EXTENSION "png"
  FORMATOPTION "GAMMA=0.75"
END

WEB             
    METADATA
        "wms_title" "WMS Pop Tif"
        "wms_onlineresource"  "http://localhost:8085/cgi-bin/mapserv.exe?mode=map&map=C:\ms4w\apps\webgis\mpgaps\raster.map"            
        "wms_enable_request"  "GetMap GetFeatureInfo GetCapabilities"
    END
END

###########
LAYER
    NAME "ny_pop"
    DATA "094_056_d_26mar2012_516_12-mar-08.tif"
    STATUS OFF
    TYPE RASTER   
    METADATA
        "wms_title" "WMS NY Raster"
        "wms_srs" "EPSG:900913"
    END
END

########### 

END

Data path is C:\ms4w\apps\webgis\mpgaps

  • Is the data (094_056_d_26mar2012_516_12-mar-08.tif) in EPSG:900913 projection? Do you have a definition for 900913 in your epsg file? Does – nmtoken Mar 21 '16 at 23:42
1

The problem appears to be the following line:

"wms_onlineresource" "http://localhost:8085/cgi-bin/mapserv.exe?mode=map&map=C:\ms4w\apps\webgis\mpgaps\raster.map"

Change that to:

"wms_onlineresource" "http://localhost:8085/cgi-bin/mapserv.exe?map=C:\ms4w\apps\webgis\mpgaps\raster.map"

The mode=map& option is not correct for a WMS

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.