[Mapserver-users] Rendering Raster Layers with Mapscript 3.7 Using OutputFormat

John Norton jnorton at fs.fed.us
Thu Apr 24 18:45:54 EDT 2003


A raster layer..
  LAYER
    NAME "Topo"
    STATUS ON
    DATA "new_l48_topo.tif"
    TYPE RASTER
  END
***********  OR ***********
  LAYER
    NAME "Topo"
    STATUS ON
    DATA "lower"
    TYPE RASTER
    TILEINDEX "lower.shp" # there is only one tile
    TILEITEM "location"
  END
Displays just fine with Mapserver 3.7 in CGI mode but when using Mapscript
it does not. The map file is using the new OutputFormat Object, which looks
like:
  OUTPUTFORMAT
    NAME png
    MIMETYPE "image/png"
    DRIVER "GD/PNG"
    IMAGEMODE RGB
    FORMATOPTION "QUALITY=80"
  END
The PHP code looks like this...
<?php
$map_path="c:/msapps/maplab/large_fires/";
$map = ms_newMapObj($map_path."l48p.map");
if($map->selectOutputFormat('png')){
  $image=$map->draw();
  $image_url=$image->saveWebImage();
  echo "<img scr=".$image_url.">";
}
else
  echo "OutputFormat not selected";

?>
The vector layers that sit on top of the raster layer render just fine with
the code above but, the raster layer does not. Here is the version string
from mapscript...

MapServer version 3.7 (development) OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=PDF OUTPUT=SWF SUPPORTS=PROJ SUPPORTS=TTF SUPPORTS=WMS_SERVER
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=GD2_RGB INPUT=EPPL7
INPUT=OGR INPUT=GDAL INPUT=

What am I doing wrong? I have spent the day reading wiki docs, faqs and
readmes with much experimentation. It has been informative and I have learn
a good deal but, I would like to get the Mapscript to work for rendering
raster layers. Mapscript 3.6 renders the raster layer (minus OutputFormat
stuff) but, at the standard 256 colors...I am excited about the RGB output
Any suggestions? Could someone point me/send me some a sample project?
Thanks
Cheers

------------------------------------------------------
John Norton
USDA-RSAC
2222 W 2300 S
Salt Lake City, UT 84119
Phone: 801-975-3766
Fax: 801-975-3478
Intranet: fsweb.rsac.fs.fed.us
Internet: www.fs.fed.us/eng/rsac/
------------------------------------------------------





More information about the mapserver-users mailing list