Perl Mapscript driving me bonkers?
Lowell Filak
lfilak at MEDINACO.ORG
Wed Apr 20 05:52:05 PDT 2005
The following message was sent by Nick Floersch <Nick at STONE-ENV.COM> on
Tue, 19 Apr 2005 17:35:38 -0400.
> Hello All,
>
> PROBLEM: Upgraded PerlMapscript does not work with web app written using
> older PerlMapscript
>
> BACKGROUND:
> New to the list, and relatively new to Mapserver and Perl MapScript.
>
> We recently upgraded our mapserver installation from some older version
> (perhaps 3.x) to 4.4.1.
> We have a web app that uses Perl MapScript to navigate/explore some maps
> and such - pretty standard.
> As part of the MapServer upgrade, I upgraded PerlMapscript because I was
> told that the previous Mapserver installation we had (which I did not
> build or install) did not have TIFF raster support built in, and we
> needed it for the next version of our little PerlMapscript web app. Our
> new mapserver executable reports that it supports as many raster formats
> as we're going to be able to use (png, bmp, gif, tiff, gd, pdf, ming,
> etc..). I'm fairly sure I've built it right because it works for some
> other purposes.
>
> So, after building the newest mapserver and then installing the perl
> mapscript which came with it, the web app does not work. I saved the old
> PerlMapscript libs and put them back in place, and stuff works again.
> Good...
>
> CURRENT STATUS:
> We either need to know that the old version of Perlmapscript did have
> support for TIFF rasters, or figure out how to make the new version of
> mapscript and our webapp work together. I am a sysadmin who does not
> know anything about Mapserver beyond what it takes to build it. I am a
> Perl programmer (no Guru, but still). I do not know enough about GIS to
> write a Mapfile from scratch.
>
> Currently, the web app gets to the following line:
> v---snip---
> #Create map object that refers to full extent map
> my $mapObjFull = new mapscript::mapObj("../mapserver/malibu.map") or
> die("$mapscript::ms_error->{message}");
> warn "Got Here 2.5";
> ^---snip---
> And never prints "Got Here 2.5" or continues or does anything. There
> are, of course, various "Got Here 2.x" items before this point, and it
> prints all of them (no I don't use debuggers, I use 'warn' statements).
>
> I tried using the $ENV{MS_ERRFILE} or whatever it is to setup a debug
> log - it never seems to work, no matter where I put the file or what
> permissions I give it. So that hasn't helped.
>
> As I said, this is a web app, so my "Got Here" statements print into the
> Apache error_log file. I decided to try a command line version to see if
> I missed anything... But I didn't.
Nicholas,
A LOT has changed (for the better) between 3.x & 4.4 so alterrations to
the code AND the 'knowngood' mapfile need to be expected.
However, there is a direct relationship between the mapserv executable
and mapscript. If you can locate the mapserv executable from your
previous install and run it from the command line with the -v option, as
you expect, it will list whether tiff support is available. Otherwise
you can always do the guess & check method of adding a raster tiff layer
to the mapfile used in the app and then drawing it (try this with a 256
color, 8-bit, no compression, tiff with an associated .wld file).
Either way you will want to upgrade at some point but this may save you
some immediate trouble.
Lowell
More information about the MapServer-users
mailing list