Problem with Perl script and image maps
Lowell Filak
lfilak at MEDINACO.ORG
Tue Aug 30 10:11:36 PDT 2005
The following message was sent by Robert Parsons
<rparsons at TAPPUBLISHING.COM> on Mon, 29 Aug 2005 12:38:01 -0500.
> 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.
Robert,
There appears to be something wrong with the mapfile. Running shp2img on
the mapfile produces the same error (for imagemap)/success (for gif).
At this point I'm not sure what the mapfile requires (particularly in
the 'style' section) where the 'imagemap' seems to be blowing up.
Lowell
More information about the MapServer-users
mailing list