[Fwd: Re: [UMN_MAPSERVER-USERS] "map-mode" vers. "browse-mode"]

Ed McNierney ed at TOPOZONE.COM
Tue Aug 17 14:42:52 EDT 2004


Karsten -

Then using /tmp/ might be the right solution; be careful of relative file and URL paths, since it is difficult to know how they will be interpreted.

As long as the PNG or GIF image file is being created, don't worry about GD - if that were the problem, the image wouldn't be there.

        - Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
ed at topozone.com
(978) 251-4242 

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of K. Lessing
Sent: Tuesday, August 17, 2004 2:14 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] [Fwd: Re: [UMN_MAPSERVER-USERS] "map-mode" vers. "browse-mode"]

Hi Ed,

first of all thanx for your answer!
Unfortunatelly your hint did not solve the problem!
When activating the responsible source line in the .map file (IMAGEURL tmp) with the URL string in browse mode the source code of the generated .html file is:

<!-- MapServer version 4.2.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER
INPUT=EPPL7 INPUT=GDAL INPUT=SHAPEFILE --> <html> <head> <title>das erste Template</title> </head> <body><body bgcolor="#FBECA0"> <table> <td width="700" height="700" colspan="0" rowspan="0" align="center"
valign="middle" bgcolor="#205B8D">

<p><img src="tmpSoSo10927599274266.gif"></p>

</td>
</table>
</body>
</html>

Then I chanced the path to "tmp/" (without the quotations!).
What the WebServer gives back:
<p><img src="tmp/SoSo10927601474455.gif"></p>

So I also supposed that the problem could be up to the output format, because Apache2 might not be able to display .gif pictures (uses another
gd-library?) Therefore I inserted the following line in the .map file

OUTPUTFORMAT
NAME png
DRIVER "GD/PNG"
MIMETYPE "image/png"
IMAGEMODE PC256
EXTENSION "png"
END

What happens then is that a .png file is generated but obviously also not captured by the apache webserver:

What you can find in the /tmp directory is:
-rw-r--r-- 1 wwwrun www 1048 2004-08-17 18:25 SoSo10927529273216.png

Could the problem be breed by the webserver because it is running as another user (wwwrun) ??

regards Karsten


Karsten -

Wilkommen!  Your problem is with the "IMAGEURL" statement.  When MapServer gets a mode=map request, the image data is streamed back directly to the client browser.  In a mode=browse request, two new things must happen: the image is written to disk in the IMAGEPATH directory, and the IMAGEURL string is used to generate a URL that points to that image.

You report that you are creating images in the tmp directory, so that's good - but if the URL is incorrect you won't be able to see them.  Take a look at the source code of the HTML output, or look at the properties of the missing map image.  In either case you should be able to see the <IMG SRC="your tmp file"> tag, and you should see that there is something wrong with that URL - a missing / after the "tmp" is likely.  By looking at the incorrect string you should be able to deduce how to change the IMAGEURL to fix it.

If you still have trouble, post the HTML output from your mode=browse request.

        - Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
ed at topozone.com
(978) 251-4242

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of K. Lessing
Sent: Tuesday, August 17, 2004 11:33 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] "map-mode" vers. "browse-mode"

Dear List,

my name is Karsten Lessing. This is my first posting to this list, I am not sure if it goes without saying to introduce oneself here ... so I will make that part short:
I studied geography with a main fokus on geoinformatics and remote sensing. Since a couple of days I am trying to get Mapserver 4.2.2 running on SuSE 9.1 with Apache2.

Therefore I installed Apache2 and MapServer locally. Apache and MapServer themself are working fine: The start page of Apache can be displayed with the URL: http://localhost/ MapServers typical error answer: "No query information to decode.
QUERY_STRING is set, but empty" is displayed.
The mapserver is running in the directory: /srv/www/cgi-bin

I built a .map file (baumklassen.map) and a .html template file
(erstes_template.html)
The code of the .map file is:

MAP
NAME SoSo
SHAPEPATH "/srv/www/htdocs/daten"
EXTENT 22 -30 31 -34
STATUS ON
SIZE 300 300
WEB
TEMPLATE /srv/www/htdocs/erstes_template.html
IMAGEPATH /srv/www/htdocs/tmp/
IMAGEURL tmp
END
LAYER
NAME "vegetation"
DATA "vege"
STATUS DEFAULT
TYPE polygon
CLASS
COLOR 250 45 67
END
END
END


The code of the .html template is:

<html>
<head>
<title>das erste Template</title>
</head>
<body><body bgcolor="#FBECA0">
<table>
<td width="700" height="700" colspan="0" rowspan="0" align="center"
valign="middle" bgcolor="#205B8D">

<p><img src="[img]"></p>

</td>
</table>
</body>
</html>

Both are stored in the directory: srv/www/htdocs/ Further more I created a "tmp" directory under /srv/www/htdocs/ to store all temporary built pictures in.

Following URL string displays the data as a picture correctly:
http://localhost/cgi-bin/mapserv40?map=/srv/www/htdocs/baumklassen.map&mode=map

Folling URL (just with the "EURžmode" difference) http://localhost/cgi-bin/mapserv40?map=/srv/www/htdocs/baumklassen.map&mode=browse
displays the contents of the .html file (table background color, etc.) but not the mapdata.
Therefore just an icon is displayed which indicates that anything should be in this place!

Each time activating the MapServer with the second URL string a picture is stored locally in the "tmp" directory
- but obviously, it can not be displayed in the .html file.

Does anybody have an idea why ?
I also downloaded the whole MapServer tutorial 4.0 from:
http://terrasip.gis.umn.edu/projects/tutorial/
and installed it locally (This is also the reason why my mapserver is called "mapserv40" ) As in above described example everthing is fine up to chapter 1.9. In chapter 1.9 the first picture which is generated in "map"-mode is displayed, but not the second one which is generated in "browse"-mode !!!

I already assumed that it could be a authorisation problem. Therefore gave each directory: srv, www, cgi-bin, htdocs, daten, tmp and each above mentioned files all rights with "EURžchmod a+rwx ..." (I know, this can not be a solution ... but just to leave no doupts i did it in this all-embracing way.)

Does anybody have a clue what the answer to my problem could be? Is it just an incomplete .html coding or does it have anything to do with the Apache webserver ...?

best regards
karsten



More information about the mapserver-users mailing list