[ms4w-users] ms4w mapserver 5.0 can't display raster image.

ptang83 at yahoo.com ptang83 at yahoo.com
Sun Apr 13 23:47:38 EDT 2008


I used Mapserver + Openlayers + Postgis. I can load shp data to postgis and display it without any problem. However, somehow I am not able to display any raster map even without using postgis. I only see a blank rectangular on my web browzer. I wonder whether there is a bug or something I did wrong. Thanks in advance..


I have downloaded ms4w Mapserver and has the following config.
# Apache 2.2.8
# PHP 5.2.5
# mapserv 5.0.2 at /cgi-bin/mapserv.exe
===========================
LOG files show nothing wrong:
======================================
Sun Apr 13 21:57:14 2008,12804,127.0.0.1,nitelti020l,3,-0.000000 -90.000000 180.000000 90.000000,-1.000000 -1.000000,,normal execution
Sun Apr 13 21:57:14 2008,14076,127.0.0.1,nitelti020l,3,-180.000000 -90.000000 0.000000 90.000000,-1.000000 -1.000000,,normal execution
=======================================
MAP file:
=========================================
# Map file created from QGIS project file C:/Program Files/Quantum GIS/nitelti020l.qgs
# Edit this file to customize for your map interface
MAP
  NAME nitelti020l
  # Map image size
  SIZE 600 600
  UNITS dd

  EXTENT -6086744.000000 -5878356.737659 4278894.138000 7580130.593659
  PROJECTION
#   'proj=longlat'
  #  'ellps=WGS84'
  #  'datum=WGS84'
   # 'no_defs'
"init=epsg:4326"
  END

  # Background color for the map canvas -- change as desired
  IMAGECOLOR 192 192 192
  IMAGEQUALITY 95
  IMAGETYPE jpeg
  OUTPUTFORMAT
    NAME jpeg
    DRIVER 'GD/JPEG'
    MIMETYPE 'image/jpeg'
    #IMAGEMODE PC256
    EXTENSION 'jpeg'
  END
  # Legend
  LEGEND
      IMAGECOLOR 255 255 255
    STATUS ON
    KEYSIZE 18 12
    LABEL
      TYPE BITMAP
      SIZE MEDIUM
      COLOR 0 0 89
    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
    IMAGEURL '/tmp/'

    # WMS server settings
    METADATA
      'wms_title'           'nitelti020l'
      'wms_onlineresource'  'http://localhost/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

  WEB
    LOG "c:\tmp\mapserv.log"
  END

  LAYER
    NAME 'nitelti020l'
    TYPE RASTER
    DATA 'C:\oatdir\nitelti020l.tar\nitelti020l.tif'
    METADATA
      'wms_title' 'nitelti020l'
    END
    STATUS DEFAULT
    TRANSPARENCY 100
    PROJECTION
#    'proj=longlat'
#    'ellps=WGS84'
#    'datum=WGS84'
#    'no_defs'
"init=epsg:4326"
    END
  END

END


==============
Raster date download
==============
http://edcftp.cr.usgs.gov/pub/data/nationalatlas/nitelti020l.tar.gz

================
simple open layer code
================
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <style type="text/css">
        #map {
            width: 800px;
            height: 475px;
            border: 1px solid black;
        }
    </style>
    <script src="http://openlayers.org/dev/lib/OpenLayers.js"></script>
    <script type="text/javascript">
        <!--
        var map, layer;

        function init(){
            map = new OpenLayers.Map( 'map' );
            layer = new OpenLayers.Layer.MapServer( "OpenLayers WMS",
                    "http://localhost/cgi-bin/mapserv.exe", {map: 'C:/Program Files/ms4w/Apache/htdocs/nitelti020l.map'} );
            map.addLayer(layer);
            map.zoomToMaxExtent();
        }
        // -->
    </script>
  </head>
  <body onload="init()">
    <div id="map"></div>
  </body>
</html>

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the ms4w-users mailing list