Still on Example 1.9 --same here!

Pericles S. Nacionales nacional at CBS.UMN.EDU
Wed Apr 13 13:49:35 PDT 2005


Hi, I just replied to Lawal's post and that reply should answer your issues as
well.  In your case, it looks like you installed the tutorial directly under
"/ms4w/Apache/htdocs"--that's fine but you're missing an opportunity to learn
more about Apache. ;)

Anyway, I see that you created a temp directory under tutorial but you're
pointing your IMAGEURL to "/tmp/"...  It should point to "/tutorial/tmp/".
This is really a web server issue--MapServer, when processing your mapfile,
uses local paths (that's why you have SHAPEPATH, IMAGEPATH, and all other
PATHs pointing to your local directories).  However, after MapServer finishes
processing the mapfile, the output images need to be referenced in web server
terms--the resulting HTML file that the browser reads has to reference the
location of your images in web server terms, not as local paths.  You need to
understand what your web root directory is and what an alias (or virtual
directory) is as they become important for referencing MapServer generated
images.  So, IMAGEURL is really the web server alias for your IMAGEPATH and
relative to your web root directory (which is "/ms4w/Apache/htdocs"), it is
under "/tutorial/tmp/".

This isn't an issue when using "mode=map" and when you're not using WMS or WFS
layers.  When you set "mode=map" you're telling MapServer to stream the image
directly to the browser and forego writing images to a tmp directory.  This
is also why you didn't have an issue with the images until now (when you use
"mode=browse").

I hope that clarify things up a little... (not quite like butter ;)

-Perry


On Wednesday 13 April 2005 08:55 am, Andreas Ritterbusch wrote:
> Hi: Not to hi-jack Lawal's thread too much... but I got the
> exact same problem (and I'm sure this has come up in the past,
> but unfortunately I can't get into the archives).
>
> In other words, if someone answers Lawal's question, he/she
> would make more than one new UMNer very, very happy.
>
> Having said that, I now allow myself to include my .html file
> and .map file (both clipped to save some bandwidth). Note that I
> ended up using full paths, since nothing made this thing work. I
> use Windows.
>
> All my static maps work fine and it's just a path problem that I
> can't seem to figure out.
>
>
>
> First the .MAP file:
>
> MAP
> NAME           EX1.9_
> IMAGETYPE      PNG24
> EXTENT         201621.496941 -294488.285333 1425518.020722
> 498254.511514 # LAEA
> #EXTENT         -97.5 41.619778 -82.122902 49.38562 # Geographic
> SIZE           400 300
> SHAPEPATH      "C:/ms4w/Apache/htdocs/tutorial/data"
> SYMBOLSET
> "C:/ms4w/Apache/htdocs/tutorial/symbols/symbols35.sym"
> FONTSET        "C:/ms4w/Apache/htdocs/tutorial/fonts/fonts.list"
>
> WEB
>   TEMPLATE  'C:/ms4w/Apache/htdocs/tutorial/example1-9.html'
>   IMAGEURL  '/tmp/'
>   IMAGEPATH 'C:/ms4w/Apache/htdocs/tutorial/tmp/'
>   #IMAGEURL  'http://localhost/tmp/'
>   #IMAGEPATH '/data/tmp/'
> END
>
> PROJECTION
> #  "proj=laea"
> #  "ellps=clrk66"
> #  "lat_0=45"
> #  "lon_0=-100"
> #
> # Alternatively, you can specify an EPSG code.
>  "init=epsg:2163"
> #
> END
> ...etc...etc...etc...
>
>
>
>
> Now the .HTML file:
>
> <html>
> <head>
> <title>MapServer 4.0 Tutorial</title>
> <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1">
> <link type="text/css" rel="stylesheet" href="ms35.css" />
> </head>
>
> <body bgcolor="#FFFFFF" text="#000000">
> <table align="center" width="600" border="0">
> <tr>
> <td>
> <h3 align="center">MapServer Tutorial:<br />
>         Example 1.8</h3>
>       <div align="center">
>           <img border="1"
> src="http://localhost/cgi-bin/mapserv40?map=C:/ms4w/Apache/htdocs/tutorial/
>example1-9.map&mode=map" />
>       </div>
>       <p align="left">The map above was created in
> "map" mode. It is
>         a static map.</p>
>
>           <!-- START OF MAPSERVER FORM -->
>       <form name="mapserv" method="GET"
> action="http://localhost/cgi-bin/mapserv40">
>         <!-- HIDDEN MAPSERVER CGI VARIABLES -->
>         <input type="hidden" name="map" value="[map]">
>         <input type="hidden" name="imgext" value="[mapext]">
>         <input type="hidden" name="imgxy" value="199.5 149.5">
>         <input type="hidden" name="zoom" value="1">
>         <input type="hidden" name="mode" value="browse">
>                 <div align="center">
>                   <table border="1" cellpadding="0" cellspacing="0">
>                     <tr><td>
>                           <!-- THE INTERACTIVE, DYNAMICALLY CREATED MAP -->
>                           <input type="image" name="img" src="[img]"
> width="400" height="300">
>                         </td></tr>
>                   </table>
>                 </div>
>           </form>
> ...etc...etc...etc...
>
> Thanks a lot in advance,
>
> Andreas.
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Small Business - Try our new resources site!
> http://smallbusiness.yahoo.com/resources/

--
Pericles S. Nacionales

Dept. of Ecology, Evolution, and Behavior
University of Minnesota
work: 612 624 6713
e-mail: nacional at cbs.umn.edu



More information about the MapServer-users mailing list