[mapserver-users] perl mapscript issues...

Kent S Ridl kridl at cs.und.edu
Wed Oct 17 17:07:29 EDT 2001


Greetings all!

Beware the newbie (i.e. me!)... I am working on setting up mapserver via
the perl mapscript module for UMAC at the Univ. of North Dakota.  I have
absolutely no imaging-type/related experience, and I am trying to pick up
perl as I go, so it's been quite the adventure for me thusfar.  Anyhoo...
on to my problem...

Here is the meat of my perl script:

   my $map = new mapObj("../html/testdata/foo.map") or die("Unable to open
mapfile... $!");
   my $img = $map->prepareImage();

   my $layer = $map->getLayerByName('testmapserv');
   $result = $layer->draw($map,$img) or die("Unable to draw layer...
$result... $!");

   $img = $map->draw() or die("Unable to draw image... $!");
   mapscript::msSaveImage($img,'../testdata/test_img.tif',$map->{interlace},$map->{transparent});


As is, execution of this script outputs this:

   Unable to draw layer... 0... Inappropriate ioctl for device at
testmapserv.pl line 15.


As you can see, this is hardly successful even though
$layer->draw($map,$img) appears to return 0 (indicative of success, as per
the online documentation).  If I comment out the die part after attempting
to draw the layer, the script then appears to work; it runs to completion
and test_img.tif is saved appropriately.  However, when I try to display
test_img.tif, what is instead displayed is a big, white nothing of
appropriate dimensions.

I've followed every mapfile and perl example I have managed to get my hand
on, yet I can't make heads of tails of what's going on.  Any and all help
is GREATLY appreciated, but please try not to make the solution very
obvious... I'm apt to kick myself pretty hard in that case!  Thanks in
advance!

Kent Ridl




More information about the mapserver-users mailing list