[Mapserver-users] Problems with PerlMapscript 3.7 Syntax

Babak Toloue Tehrani babak.tehrani at geosysnet.de
Thu May 1 10:34:07 EDT 2003


Hello,

I have still problems with perlmapscript 3.7. The demo below with the
syntax of perlmapscript 3.6 is working very fine on my system. shp2img
is also working for the mapfile below.
>From the WIKI MigrationGuide I Take the syntax for saveImage():

$img->saveImage('test37.png');

and get following output:

Can't locate auto/mapscript/imageObj/saveImage.al in @INC (@INC
contains: /usr/lib/perl5/5.8.0/i586-linux-thread-multi
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl .) at test37.pl
line 7

Then I looked for the string saveImage in the mapscript.pm module and
found the function msSaveImage who brings me following output:

Usage: msSaveImage(map,img,filename); at test37.pl line 7.

I tried: $map->msSaveImage($map,$img,'test37');

and got same errormessage as before. Then I tried to set the set the
ImageType with:

map->setImageType("png") or die('Unable to setImageType.');

and see that it failed. Here the script and the mapfile:

(Does someone now a tool to extract from a perl Module (mapscript.pm) a
list of all Classes/Objects, Members and Methods?)

Thanks a lot,

Babak

==========================================================================
#!/usr/bin/perl -w
use mapscript;
use strict;

my $map = new mapscript::mapObj("data/demo37.map") or die('Unable to
OPEN mapfile.');
$map->setImageType("png") or die('Unable to setImageType.');
my $img = $map->draw() or die('Unable to DRAW mapfile.');
$map->msSaveImage($map,$img,'test37');
$img->free();
--------------------------------------------------------------------------
NAME DEMO37
STATUS ON
SIZE 600 450
EXTENT 5.3 55.5 15.5 46.9
UNITS METERS
SHAPEPATH "data"
IMAGECOLOR 255 255 255

OUTPUTFORMAT
  NAME png
  DRIVER "GD/PNG"
  MIMETYPE "image/png"
  IMAGEMODE PC256
  EXTENSION "png"
END

LAYER
  NAME TESTLAYER
  TYPE POLYGON
  STATUS DEFAULT
  DATA lnd01dd.shp
  CLASS
      NAME TESTCLASS
      SYMBOL 0
      COLOR 195 195 195
      OUTLINECOLOR 102 102 102
  END
END
END

-- 
Babak Toloue Tehrani <babak.tehrani at geosysnet.de>




More information about the mapserver-users mailing list