[Mapserver-users] Relative Paths vs. Absolute Paths
McNeil, Todd W. TMCNEIL
TMCNEIL at arinc.com
Wed Oct 15 15:53:21 PDT 2003
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_000_01C3936F.21C4BBA0
Content-Type: text/plain
Hi all,
I sent out an email about this last week, but never got a reply. I am going
through Section 3 of the MapServer 3.5 Tutorial and am having the toughest
time figuring out why my html page does not show the legend, reference and
the map images. This is my first time using MS, so I am at the point of
giving up on this because of this seemingly simple path problem that I have
no solution for. I've used the IE > View > Source menu option to determine
where the images maybe stored in the online tutorial on the MapServer web
page. I see this written in the html:
Map Image: <input type="image" name="img"
src="/tmp/S3EX1106625668213828.gif" border="0">
Legend Image: <img src="/tmp/S3EX1leg106625668213828.gif">
Reference Map Image: <img src="/tmp/S3EX1ref106625668213828.gif">
I just cut and pasted the important stuff from the html source code. The
mapfile listing shows this:
IMAGEPATH "/data/tmp/"
IMAGEURL "/tmp/"
So, I figured that if these paths work in online tutorial, they must work in
the downloadable tutorial. I copy and pasted them and because I have
windows, I changed the slashes in the other direction to look like this:
IMAGEPATH "\data\tmp\"
IMAGEURL "\tmp\"
I still get an html page without the images. So, enough background
information to fill your brain. My question is, if MapServer is used to
create the map images, where does it store them or does IIS store them
somewhere? I've even done a Find Files in Windows Explorer to see if I
could find the GIF images created by my tutorial and I find no trace of
them. This is why I think this is an absolute vs. a relative path issue and
I am just not finding the right directory to where the images are stored.
Are these temporary images and where are they? Is windows playing tricks on
me or is my syntax wrong in my html or mapfile? Any help would be greatly
appreciated and of course I will sum. I've also attached my map file and
template file to help you out.
<<s3ex2.html>>
<<s3ex2.map>>
Thanks in advance,
*********************************
Todd McNeil
GIS Specialist
Surface Transportation and Energy Systems
ARINC
Annapolis, MD
Tel: 410.266.2302 Email: tmcneil at arinc.com
Fax: 410.573.3170 Web: http://www.arinc.com <http://www.arinc.com>
------_=_NextPart_000_01C3936F.21C4BBA0
Content-Type: text/html;
name="s3ex2.html"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="s3ex2.html"
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>MapServer 3.5 Tutorial</title>
<link type=3D"text/css" rel=3D"stylesheet" =
href=3D"E:/projects/tutorial35/ms35.css" />
</head>
<body>
<h3>Section 3<br>
Example 2 Zoom Controls</h3>
<p>
<form method=3D"GET" action=3D"/Scripts/mapserv.exe">
<input type=3D"hidden" name=3D"map" value=3D"[map]">
<input type=3D"hidden" name=3D"imgext" value=3D"[mapext]">
[<a href=3D"E:/projects/tutorial35/s3/s3ex2_map.html">map file =
listing</a>]
[<a href=3D"E:/projects/tutorial35/s3/s3ex2_code.html">template =
file listing</a>]
<table border=3D1 cellpadding=3D3>
<tr>
<td align=3Dcenter>
<input type=3D"image" name=3D"img" src=3D"[img]" border=3D"0">
</td>
<td valign=3Dtop>
<font size=3D+1 face=3Darial,helvetica>Map Controls</font>
<p>
Set your zoom option:<br>
<select name=3D"zoom" size=3D"1">
<option value=3D"10" [zoom_10_select]> Zoom in 10 times
<option value=3D"8" [zoom_8_select]> Zoom in 8 times
<option value=3D"4" [zoom_4_select]> Zoom in 4 times
<option value=3D"3" [zoom_3_select]> Zoom in 3 times
<option value=3D"2" [zoom_2_select]> Zoom in 2 times
<option value=3D"1" [zoom_1_select]> Recenter Map
<option value=3D"-2" [zoom_-2_select]> Zoom out 2 times
<option value=3D"-3" [zoom_-3_select]> Zoom out 3 times
<option value=3D"-4" [zoom_-4_select]> Zoom out 4 times
<option value=3D"-8" [zoom_-8_select]> Zoom out 8 times
<option value=3D"-10" [zoom_-10_select]> Zoom out 10 times
</select>
<p>
<font face=3Darial,helvetica><b>Legend</b></font><br>
<img src=3D"[legend]"><p>
<img src=3D"[ref]">
</td>
</tr></table>
=20
<p> <a href=3D"index.html">Back to Section 3</a> | <a =
href=3D"/Scripts/mapserv.exe?map=3DE:/Projects/tutorial35/s3/s3ex2.map&l=
ayer=3Dwater&layer=3Dstates&zoom=3D1&submit=3DRedraw">Proceed=20
to Example 3</a>=20
</form>
</body>
</html>
------_=_NextPart_000_01C3936F.21C4BBA0
Content-Type: application/octet-stream;
name="s3ex2.map"
Content-Disposition: attachment;
filename="s3ex2.map"
NAME S3EX2
EXTENT -97.5 41.619778 -82.122902 49.38562
SIZE 400 300
SHAPEPATH "E:\Projects\tutorial35\data"
FONTSET "E:\Projects\tutorial35\data\fonts.list"
SYMBOLSET "E:\Projects\tutorial35\symbols\symbols35.sym"
WEB
TEMPLATE s3ex2.html
IMAGEPATH "\data\tmp"
IMAGEURL "\tmp\"
END
LEGEND
STATUS ON
LABEL
TYPE TRUETYPE
FONT arial
COLOR 0 0 0
SIZE 12
ANTIALIAS TRUE
END
END
REFERENCE
STATUS ON
IMAGE "../images/ref1.gif"
SIZE 150 113
EXTENT -97.5 41.619778 -82.122902 49.38562
COLOR -1 -1 -1
OUTLINECOLOR 255 0 0
END
# LAYER DEFINITIONS ---------------------------------------------
LAYER # Shaded Relief Raster
NAME "relief"
DATA "raster\shdrlfi020g_ugl.tif"
STATUS DEFAULT
TYPE RASTER
# OFFSITE 0
END
LAYER # States
NAME "states"
DATA states_ugl
STATUS OFF
TYPE POLYGON
# CLASSITEM "CLASS"
CLASS # States class
NAME "States"
EXPRESSION ('[CLASS]' eq 'land')
# EXPRESSION 'land'
COLOR 240 240 240
OUTLINECOLOR 0 0 0
END # end of States class object
END # end of layer object
LAYER # water features layer
NAME "water features"
DATA hydrop_ugl
STATUS DEFAULT
TYPE POLYGON
CLASSITEM "FEATURE"
CLASS
NAME "Bay/Estuarine"
EXPRESSION /Bay*/
COLOR 164 164 255
END
CLASS
NAME "Lakes/Reservoir"
EXPRESSION ('[FEATURE]' eq 'Lake' or '[FEATURE]' = 'Reservoir')
COLOR 64 64 255
END
CLASS
NAME "Marsh/Swamp"
EXPRESSION /Sw*/
COLOR 210 235 255
END
CLASS
NAME "Major Rivers"
EXPRESSION 'Stream'
COLOR 128 128 220
END
CLASS
NAME "Canal"
EXPRESSION 'Canal'
COLOR 200 128 255
END
END # end of water features layer
#LAYER # Roads
# NAME "roads"
# DATA roads_ugl
# TYPE LINE
# STATUS DEFAULT
#
# CLASSITEM "CLASS"
# CLASS
# NAME "Interstate Highways"
# EXPRESSION 'Interstate'
# COLOR 128 0 0
# SYMBOL 'circle'
# SIZE 2
# END
# CLASS
# NAME "US Highways"
# EXPRESSION 'US'
# COLOR 255 128 0
# SYMBOL 'line1'
# SIZE 1
# END
#END
LAYER # States
NAME "states"
DATA states_ugl
STATUS DEFAULT
TYPE LINE
# CLASSITEM "CLASS"
CLASS # States class
NAME "States"
EXPRESSION ('[CLASS]' eq 'land')
# EXPRESSION 'land'
COLOR 0 0 0
END # end of States class object
END # end of layer object
LAYER # States
NAME "states"
DATA states_ugl
STATUS DEFAULT
TYPE ANNOTATION
LABELITEM "STATE"
CLASSITEM "CLASS"
CLASS # States class
EXPRESSION 'land'
COLOR -1 -1 -1
LABEL
COLOR 132 31 31
SHADOWCOLOR 218 218 218
SHADOWSIZE 2 2
TYPE TRUETYPE
FONT arial-bold
SIZE 14
ANTIALIAS TRUE
POSITION CL
PARTIALS FALSE
MINDISTANCE 250
BUFFER 4
END # end of label
END # end of States class object
END # end of layer object
END # end of map file
------_=_NextPart_000_01C3936F.21C4BBA0--
More information about the MapServer-users
mailing list