Problem with Perl script and image maps

Robert Parsons rparsons at TAPPUBLISHING.COM
Mon Aug 29 13:38:01 EDT 2005


Can anyone offer any insight for this problem? I get "Segmentation Fault" 
any time I attempt to call $map->draw() for any map that is set to output 
via the "imagemap" driver. It's quite easy for me to reproduce and it even 
happens when simply opening a .map file from within a perl script. For 
example, this simple script throw a Seg Fault during the draw().

#!/usr/bin/perl

use mapscript;

my $msmap = mapscript::mapObj->new('test.map');
my $image=$msmap->draw();
$image->save('test');


Here's the test.map file:

MAP
   EXTENT -14023070.10627 1859777.927636 -7135266.299414 7255753.260196
   IMAGECOLOR 0 0 0
   IMAGETYPE imagemap
   SHAPEPATH "/wxhub/common/shapefiles"
   SIZE 868 680
   STATUS ON
   UNITS METERS
   NAME "TEST"

   OUTPUTFORMAT
     NAME "imagemap"
     MIMETYPE "text/html"
     DRIVER "imagemap"
   END

   PROJECTION
     "proj=merc"
     "lat_0=0"
     "lon_0=0"
     "datum=WGS84"
   END

   WEB
     IMAGEPATH ""
     IMAGEURL ""
       METADATA
       END
     QUERYFORMAT text/html
   END

   LAYER
     DATA "statesp020"
       METADATA
       END
     NAME "mylayer"
     PROJECTION
       "proj=latlong"
     END
     SIZEUNITS PIXELS
     STATUS ON
     TOLERANCEUNITS PIXELS
     TYPE POLYGON
     UNITS METERS
     CLASS
       METADATA
       END
       STYLE
         ANGLE 360
           COLOR 255 255 255
         SIZE 1
         SYMBOL 0
       END
     END
   END

END


The same code will work fine if I change the .map file to output to a GIF 
instead of an imagemap.

Any help would be appreciated.

- R. Parsons



More information about the mapserver-users mailing list