[Mapserver-users] cant label streets in mapscript -- please help

Murat Isik muratisik at megatek.com.tr
Tue Nov 11 19:08:09 EST 2003


I checked the error_log like you showed both with and without the 'ID' part.
Nothing showed up in the log. I added phpinfo() into the same test php right
before draw(). You are right about draw() crashing. If placed after draw(),
phpinfo() doesnot work.
As for GD/freetype, the gd title section of phpinfo() says that GD support
is enabled, version between 1.3 and 1.6.1, Freetype support enabled,
FreeType Linkage with freetype, GIF Read Support enabled, GIF Create Support
enabled. To me it all looks fine but maybe you can see something wrong here.
I dont know how to disable gd/freetype and what to do next :(
I have started to read wiki for 4.0 and redhat right away, too bad to meet
this problem at a point where I thought study had come to an end :(
Yes, lots of things to learn :) I hope someday my problems will be some
other beginners solutions.
By the way, I am planning to post my current php code (all of it) in another
post. It can read mapfile, fetch coordinates from mysql, print points
dynamically, zoom, pan, move up-down-left-right. Cant label though:)  Took
me a long time to put together, simple stuff for a proffessional but great
for another beginner. I hope it helps other beginners. Anyway...

Have a nice day.

Murat Isik


----- Original Message -----
From: "Daniel Morissette" <morissette at dmsolutions.ca>
To: "Murat Isik" <muratisik at megatek.com.tr>
Cc: <mapserver-users at lists.gis.umn.edu>
Sent: Wednesday, November 12, 2003 1:28 AM
Subject: Re: [Mapserver-users] cant label streets in mapscript -- please
help


> Murat Isik wrote:
> >
> > As for the "stopped rendering", the web page only has the part that is
until
> > the start of the php code, like the title or the logo gif. The source of
the
> > web page only has the page title and the url of the page logo. When I
check
> > the temporary folder into which images are written, I see no images are
> > produced. On the web page, there were no error messages. Unfortunately,
I
> > dont know how to use the error_log :(
> >
>
> The Apache error_log is located in /var/log/httpd/error_log.  You can
> monitor it using the following command in a shell window:
>
>    tail -f /var/log/httpd/error_log
>
> Then run the PHP script again and see if anything is sent to the
> error_log that could help figuring the source of the problem.
>
>
> > The lines I added to the mapfile for mapscript choose the streets by
their
> > value in the second column which is ID (numeric) and I choose all by /./
> >
> > CLASSITEM 'ID'
> >   CLASS
> >        EXPRESSION /./
> >   COLOR 66 34 249
> >   END
> >
>
> Makes sense.  All streets end up being caught by the first class and
> none are sent to the second class that contains the label definition.
> That's why it draws with no error but you don't get labels either: the
> label stuff is never used.
>
>
> > I applied your test with the following php code:
> >
> > <HEAD>
> > <TITLE>TEST</TITLE>
> > </HEAD>
> > <CENTER>
> > <?php
> >     dl("php_mapscript.so");
> >     $map =  ms_newMapObj("demonew.map");
> >     $img = $map->draw();
> >   #  $map->drawLabelCache($img);
> >     $url = $img->saveWebImage(GIF,1,1,0);
> >
> > ?>
> > <INPUT TYPE="image" SRC="<?php echo $url; ?>">
> >
> > Once again, the web page displays no images, no images produced in temp
> > directory and web page source ends at <CENTER>. Also tried it with
> > drawLabelCache on, getting the same result :(
> >
>
> It seems clear that php_mapscript crashes (segmentation fault) during
> the $map->draw() call then.
>
> First let's see if you'll get any hints about the source of the problem
> in the error_log, and if not then I think there are 75% chances that you
> are running conflicting versions of GD/freetype between your PHP and
> php_mapscript.so.  You can check if your PHP includes GD/freetype by
> running the phpinfo() command in a script and looking for GD/freetype
> stuff in the list of modules.  If you possible try to disable the PHP
> GD/freetype stuff.
>
> If that's not a GD/freetype conflict then it could be a bug somewhere in
> MapServer, and the only way to figure it would be to run in a debugger
> and you can't do that with the RPM version.  Anyway that's getting quite
> involved if you are a beginner so I would suggest instead uninstalling
> the RPMs and installing MapServer v4.0 using the instructions that you
> can find in the wiki at:
>
> http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?RedHat9AndMapserver40
>
> If the crash persists with version 4.0 then your best bet would be to
> package a small testcase that reproduces the problem with mapfile and
> sample data and submit a bug in the MapServer bugzilla.
>
> Lots to learn, eh?   :)
>
> Daniel
> --
> ------------------------------------------------------------
>   Daniel Morissette               morissette at dmsolutions.ca
>   DM Solutions Group              http://www.dmsolutions.ca/
> ------------------------------------------------------------





More information about the mapserver-users mailing list