PERL Mapscript
Stephen Davies
sdc at SDC.COM.AU
Wed Mar 15 17:43:33 PST 2006
One step forward; one step back;-(
I am now getting a non-blank output but it only contains those layers
which do not use data from the postGIS database.
Is there something extra that needs to be done in PERL/Mapscript to
turn on database access? If so, where is it documented?
Cheers and thanks,
Stephen Davies
On Thursday 16 March 2006 00:21, Lowell.Filak wrote:
> Stephen Davies writes:
> > Sorry; a mistake in my posting.
> >
> > The actual invocation of the script was:
> > ./genpics q 1 jpg 139.5143351 -34.7459112 139.5278707 -34.7207
> >
> > The problem remains.
> >
> > Cheers and thanks
> > Stephen
> >
> > On Wednesday 15 March 2006 17:01, Manfred Meier wrote:
> >> > ./genpics q 1 139.5143351 -34.7459112 139.5278707 -34.7207
> >>
> >> Is there a parameter missing before "139.5143351"? minx is ARGV[3]
> >> in your program.
> >>
> >> Hope that helps
> >> Manfred
> >>
> >> Stephen Davies schrieb:
> >> > I am having my first attempt at using PERL/Mapscript to save map
> >> > images to files and am not getting too far.
> >> >
> >> > I have a map file that works perfectly when used with:
> >> >
> >> > http://server/cgi-bin/mapserv?map=/tmp/q.map&mapext=139.5143351+
> >> >-34 .7459112+139.5278707+-34.7207
> >> >
> >> > I have the following PERL test bed:
> >> >
> >> > #! /usr/bin/perl
> >> > #
> >> > # args are UID (for mapfile), pic sequence #, image type
> >> > (extension), map extent
> >> > #
> >> > use strict;
> >> > use mapscript;
> >> > my $uno = $ARGV[0];
> >> > my $seq = $ARGV[1];
> >> > my $ext = $ARGV[2];
> >> > my $minx = $ARGV[3];
> >> > my $miny = $ARGV[4];
> >> > my $maxx = $ARGV[5];
> >> > my $maxy = $ARGV[6];
> >> >
> >> > #
> >> > my $mapfile = "/tmp/$uno.map";
> >> > my $map = mapscript::mapObj->new($mapfile);
> >> > $map->setExtent($minx,$miny,$maxx,$maxy);
> >> > #
> >> > my $img = $map->prepareImage();
> >> > $img = $map->draw();
> >> > my $fname = "/var/www/html/status_images/$uno_$seq.$ext";
> >> > print "$fname\n";
> >> > $img->save($fname);
> >> >
> >> > Called as:
> >> > ./genpics q 1 139.5143351 -34.7459112 139.5278707 -34.7207
> >> >
> >> > This generates a blank jpeg file (of some 2800 bytes).
> >> >
> >> > What am I missing?
> >> >
> >> > Cheers and thanks,
> >> > Stephen Davies
>
> Stephen,
>
> You should not need prepareImage in this case. map->draw will return
> the new imageObj.
> If you have additional/continuing problems you may need to include
> q.map.
>
> Lowell
--
=======================================================================
This email is for the person(s) identified above, and is confidential to
the sender and the person(s). No one else is authorised to use or
disseminate this email or its contents.
Stephen Davies Consulting Voice: 08-8177 1595
Adelaide, South Australia. Fax: 08-8177 0133
Computing & Network solutions. Mobile:0403 0405 83
More information about the MapServer-users
mailing list