[Mapserver-users] swf output color problem

Aaron D. Hunt hunt at zedxinc.com
Thu Nov 13 12:13:55 EST 2003


This is a multi-part message in MIME format.

------=_NextPart_000_09BE_01C3A9DF.9BAC7E40
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I am trying to make a swf file with a single wms layer background. When =
I do the colors get reduced to what looks like 8 colors. The script I am =
using is below along with the map file. I can send the swf and a jpeg if =
anyone needs a sample of what is going on.

Aaron Hunt


#!/usr/bin/perl

use lib("/home/mapserver");
use mapscript40;


$ENV{MS_ERRORFILE} =3D "mapserver.log";=20
$ENV{PROJ_LIB} =3D "/home/mapserver/proj-4.4.7/nad/";=20


my $map =3D new mapscript40::mapObj("geotif.map") or die("Unable to open =
mapfile. $!");

$img =3D $map->draw() or die('Unable to draw map');

$imagename =3D "test.swf";

$img->save($imagename);


####map file

#
#
# Start of map file
#
NAME Soil
STATUS ON
SIZE 500 500
EXTENT -90.637762 33.623924 -90.601165 33.650091
#EXTENT -180 -90 180 90
UNITS DD
SHAPEPATH "/tmp"
IMAGECOLOR 255 255 255

 WEB
   IMAGEPATH "/home/hunt/"
   IMAGEURL ""
 END


 PROJECTION
  "proj=3Dlonglat"
  "ellps=3DWGS84"
  "unit=3Ddd"
 END


      OUTPUTFORMAT=20
        NAME swf=20
        MIMETYPE "application/x-shockwave-flash"=20
        DRIVER swf=20
        IMAGEMODE RGBA=20
        FORMATOPTION "OUTPUT_MOVIE=3DMULTIPLE"=20
      END=20


 LAYER
    NAME LandSat
    METADATA
      "wms_title" "LandSat"
      "wms_srs"   "EPSG:4326" #WGS 84
      "wms_connectiontimeout" "10"
      LYRNAME "LandSat"
      LINK "N/A"
    END
    STATUS ON=20
    TYPE RASTER
    OFFSITE 255 255 255
    CONNECTIONTYPE WMS
    CONNECTION =
"http://wms.jpl.nasa.gov/wms.cgi?WMTVER=3D1.0.0&REQUEST=3Dmap&LAYERS=3Dus=
_landsat7o&red=3D4&green=3D3&blue=3D1&ld=3D25&le=3D45&ls=3D0&gamma=3D2.5&=
STYLES=3D&FORMAT=3Djpeg&TRANSPARENT=3DTRUE&"
    PROJECTION
      "init=3Depsg:4326" #WGS 84
    END
 END

END



------=_NextPart_000_09BE_01C3A9DF.9BAC7E40
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1264" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I am trying to make a swf file with a =
single wms=20
layer background. When I do the colors get reduced to what looks like 8 =
colors.=20
The script I am using is below along with the map file. I can send the =
swf and a=20
jpeg if anyone needs a sample of what is going on.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Aaron Hunt</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>#!/usr/bin/perl</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>use lib("/home/mapserver");<BR>use=20
mapscript40;</FONT></DIV>
<DIV>&nbsp;</DIV><FONT face=3DArial size=3D2>
<DIV><BR>$ENV{MS_ERRORFILE} =3D "mapserver.log"; <BR>$ENV{PROJ_LIB} =3D=20
"/home/mapserver/proj-4.4.7/nad/"; </DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>my $map =3D new mapscript40::mapObj("geotif.map") or =
die("Unable to open=20
mapfile. $!");</DIV>
<DIV>&nbsp;</DIV>
<DIV>$img =3D $map-&gt;draw() or die('Unable to draw map');</DIV>
<DIV>&nbsp;</DIV>
<DIV>$imagename =3D "test.swf";</DIV>
<DIV>&nbsp;</DIV>
<DIV>$img-&gt;save($imagename);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>####map file</DIV>
<DIV>&nbsp;</DIV>
<DIV>#<BR>#<BR># Start of map file<BR>#<BR>NAME Soil<BR>STATUS =
ON<BR>SIZE 500=20
500<BR>EXTENT -90.637762 33.623924 -90.601165 33.650091<BR>#EXTENT -180 =
-90 180=20
90<BR>UNITS DD<BR>SHAPEPATH "/tmp"<BR>IMAGECOLOR 255 255 255</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;WEB<BR>&nbsp;&nbsp; IMAGEPATH "/home/hunt/"<BR>&nbsp;&nbsp; =
IMAGEURL=20
""<BR>&nbsp;END</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;PROJECTION<BR>&nbsp;&nbsp;"proj=3Dlonglat"<BR>&nbsp;&nbsp;=
"ellps=3DWGS84"<BR>&nbsp;&nbsp;"unit=3Ddd"<BR>&nbsp;END</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OUTPUTFORMAT=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NAME swf=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIMETYPE=20
"application/x-shockwave-flash" =
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
DRIVER swf <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IMAGEMODE RGBA =

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FORMATOPTION=20
"OUTPUT_MOVIE=3DMULTIPLE" <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END </DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;LAYER<BR>&nbsp;&nbsp;&nbsp; NAME =
LandSat<BR>&nbsp;&nbsp;&nbsp;=20
METADATA<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "wms_title"=20
"LandSat"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "wms_srs"&nbsp;&nbsp; =
"EPSG:4326"=20
#WGS 84<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "wms_connectiontimeout"=20
"10"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LYRNAME=20
"LandSat"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LINK =
"N/A"<BR>&nbsp;&nbsp;&nbsp;=20
END<BR>&nbsp;&nbsp;&nbsp; STATUS ON <BR>&nbsp;&nbsp;&nbsp; TYPE=20
RASTER<BR>&nbsp;&nbsp;&nbsp; OFFSITE 255 255 255<BR>&nbsp;&nbsp;&nbsp;=20
CONNECTIONTYPE WMS<BR>&nbsp;&nbsp;&nbsp; CONNECTION "<A=20
href=3D"http://wms.jpl.nasa.gov/wms.cgi?WMTVER=3D1.0.0&amp;REQUEST=3Dmap&=
amp;LAYERS=3Dus_landsat7o&amp;red=3D4&amp;green=3D3&amp;blue=3D1&amp;ld=3D=
25&amp;le=3D45&amp;ls=3D0&amp;gamma=3D2.5&amp;STYLES=3D&amp;FORMAT=3Djpeg=
&amp;TRANSPARENT=3DTRUE">http://wms.jpl.nasa.gov/wms.cgi?WMTVER=3D1.0.0&a=
mp;REQUEST=3Dmap&amp;LAYERS=3Dus_landsat7o&amp;red=3D4&amp;green=3D3&amp;=
blue=3D1&amp;ld=3D25&amp;le=3D45&amp;ls=3D0&amp;gamma=3D2.5&amp;STYLES=3D=
&amp;FORMAT=3Djpeg&amp;TRANSPARENT=3DTRUE</A>&amp;"<BR>&nbsp;&nbsp;&nbsp;=
=20
PROJECTION<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "init=3Depsg:4326" #WGS=20
84<BR>&nbsp;&nbsp;&nbsp; END<BR>&nbsp;END</DIV>
<DIV>&nbsp;</DIV>
<DIV>END</DIV>
<DIV>&nbsp;</DIV>
<DIV></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_09BE_01C3A9DF.9BAC7E40--




More information about the mapserver-users mailing list