[mapserver-users] Re: mapserver grib example

kempe jesper.kempe at gmail.com
Tue Jan 26 13:53:14 EST 2010


I did not have the correct version of GDAL in my OSGeo4W Mapserver.

Now I installed a Linux version in a virtual machine instead and now I have
managed to get a bit further.

But now all my GetMap queries result in 500-Internal server error.
When I begin to look through log files this is everything I can find in the
Apache error_log:

Tue Jan 26 19:16:02 2010] [error] [client 10.46.1.100] malformed header from
script. Bad header=GribLen == 130404: mapserv


In my MAP-file I set DEBUG 5 but all that was shown in the log is:

[Tue Jan 26 19:16:01 2010].792879 msDrawRasterLayerLow(gfs.t00z.pgrbf03):
entering.
[Tue Jan 26 19:16:02 2010].641350 msDrawMap(): Layer 0 (gfs.t00z.pgrbf03),
0.857s
[Tue Jan 26 19:16:02 2010].641450 msDrawMap(): Drawing Label Cache, 0.000s
[Tue Jan 26 19:16:02 2010].641468 msDrawMap() total time: 0.865s
[Tue Jan 26 19:16:02 2010].818726 msSaveImage() total time: 0.177s
[Tue Jan 26 19:16:02 2010].818876 mapserv request processing time (msLoadMap
not incl.): 1.044s
[Tue Jan 26 19:16:02 2010].818906 msFreeMap(): freeing map at 0x940c738.


I did one more test. 
gdal_translate -b 2 gfs.t00z.pgrbf03 test.tif

And then copied the definitions of my grib-layer to a new layer and there
use the tif-file as data and then it works.


Anyone who has any idea on what might wrong?


My setup:
Ubuntu 9.10 server
mapserv -v
MapServer version 5.6.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE
SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=GEOS SUPPORTS=RGBA_PNG
INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

The gribfile I am trying is from Noaa GFS model.

I have tested the Mapserver using QGis.

My MAP file looks like this:

# Map file created from QGIS project file C:/Program Files/Quantum GIS
Enceladus/testProj.qgs
# Edit this file to customize for your map interface
# (Created with PyQgis MapServer Export plugin)
MAP
  NAME "QGIS-MAP"
  # Map image size
  SIZE 300 200
  UNITS meters

  CONFIG  "MS_ERRORFILE" "/tmp/mapserver.log"
  DEBUG 5

  EXTENT -9.000000 -110.772277 369.000000 109.772277
  FONTSET '../etc/fonts.txt'
  SYMBOLSET '../etc/symbols.sym'
  PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'datum=WGS84'
    'no_defs'
  END

  # Background color for the map canvas -- change as desired
  IMAGECOLOR 255 255 255
  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 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/ms_tmp/'

    # Set IMAGEURL to the url that points to IMAGEPATH
    # as defined in your web server configuration
        #IMAGEURL '/ms_tmp/'

          IMAGEPATH "/opt/fgs/tmp/ms_tmp/"
          IMAGEURL "/ms_tmp/"
          LOG "/tmp/gmap.log"

    # WMS server settings
    METADATA
      'ows_title'           'QGIS-MAP'
      'ows_onlineresource' 
'http://10.46.1.101/cgi-bin/mapserv?map=/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/htdocs/grib.map'
      'ows_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
    TEMPLATE 'templates/grib.html'
  END

  LAYER
    NAME 'gfs.t00z.pgrbf03'
    TYPE RASTER
    DUMP true
    TEMPLATE fooOnlyForWMSGetFeatureInfo
    EXTENT -9.000000 -110.772277 369.000000 109.772277
    DATA '/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/data/gfs.t00z.pgrbf03'
    METADATA
      'ows_title' 'gfs.t00z.pgrbf03'
    END
    STATUS OFF
    TRANSPARENCY 10
    PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'datum=WGS84'
    'no_defs'
    END
        PROCESSING 'BANDS=1'
        CLASS
                NAME 'red'
                EXPRESSION ([pixel] < -3)
                STYLE
                COLOR 255 0 0
                END
        END
        CLASS
                NAME 'green'
                EXPRESSION ([pixel] >= -3 and [pixel] < 3)
                STYLE
                COLOR 0 255 0
                END
        END
        CLASS
                NAME 'blue'
                EXPRESSION ([pixel] >= 3)
                STYLE
                COLOR 0 0 255
                END
        END


  END


  LAYER
    NAME 'gfstif'
    TYPE RASTER
    DUMP true
    TEMPLATE fooOnlyForWMSGetFeatureInfo
    EXTENT -9.000000 -110.772277 369.000000 109.772277
    DATA '/opt/fgs/apps/gmap-demo-cvs_MS_VERSION_54/htdocs/test.tif'
    METADATA
      'ows_title' 'gfstif'
    END
    STATUS OFF
    TRANSPARENCY 10
    PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'datum=WGS84'
    'no_defs'
    END
        PROCESSING 'BANDS=1'
        CLASS
                NAME 'red'
                EXPRESSION ([pixel] < -3)
                STYLE
                COLOR 255 0 0
                END
        END
        CLASS
                NAME 'green'
                EXPRESSION ([pixel] >= -3 and [pixel] < 3)
                STYLE
                COLOR 0 255 0
                END
        END
        CLASS
                NAME 'blue'
                EXPRESSION ([pixel] >= 3)
                STYLE
                COLOR 0 0 255
                END
        END


  END


END

-- 
View this message in context: http://n2.nabble.com/mapserver-grib-example-tp4439271p4462543.html
Sent from the Mapserver - User mailing list archive at Nabble.com.


More information about the mapserver-users mailing list