[Mapserver-users] Where are legend, reference and .qyimages stored? MORE INFO
Paul Peterson
pwpeterson at iesc.net
Mon Apr 7 16:23:21 PDT 2003
Steve, et al.
I tested the Itasca demo app and it acts the same way as the 3.5 Tutorial on
my system.
The legend and reference images end up in /var/www/tmpMaps
The map image ends up in /var/www/html/tmpMaps
The three files I used in the Itasca demo follow:
===============
demo.map
===============
#
# Start of map file
#
NAME DEMO
STATUS ON
SIZE 600 600
EXTENT 388107.634400379 5203120.88405952 500896.339019834 5310243.30613897
UNITS METERS
SHAPEPATH "data"
IMAGECOLOR 255 255 255
# you may need to change this to match your MapServer build
#IMAGETYPE PNG
#
# Projection definition, consult the PROJ.4 documentation for parameter
discussion
#
#PROJECTION
# "proj=utm"
# "ellps=GRS80"
# "zone=15"
# "north"
# "no_defs"
#
# OR:
#
# "init=epsg:26915"
#END
#
# Start of web interface definition (including WMS enabling metadata)
#
WEB
HEADER demo_header.html
TEMPLATE demo.html
FOOTER demo_footer.html
MINSCALE 1000
MAXSCALE 1550000
IMAGEPATH "set in demo_init.html"
IMAGEURL "set in demo_init.html"
METADATA
WMS_TITLE "UMN MapServer Itasca Demo"
WMS_ABSTRACT "This is the UMN MapServer demonstration application for
Itasca County located in north central Minnesota."
WMS_ACCESSCONSTRAINTS none
# change this value to match your setup
WMS_ONLINERESOURCE "http://192.168.1.199/itasca/demo_init.html"
WMS_SRS "EPSG:26915"
END
END
QUERYMAP
SIZE 200 200
STATUS ON
STYLE HILITE
COLOR 255 0 0
END
#
# Start of reference map
#
REFERENCE
IMAGE graphics/reference.png
EXTENT 393234.393701263 5205405.16440722 495769.579718949 5307959.02579127
SIZE 120 120
STATUS ON
COLOR -1 -1 -1
OUTLINECOLOR 255 0 0
END
#
# Start of legend
#
LEGEND
KEYSIZE 18 12
LABEL
TYPE BITMAP
SIZE MEDIUM
COLOR 0 0 89
END
STATUS ON
END
#
# Start of scalebar
#
SCALEBAR
IMAGECOLOR 255 255 255
LABEL
COLOR 255 255 255
SIZE tiny
END
STYLE 1
SIZE 80 2
COLOR 255 255 255
UNITS MILES
INTERVALS 1
TRANSPARENT TRUE
STATUS TRUE
END
#
# Start of symbol definitions (we're only using a few)
#
SYMBOL
NAME 'circle'
TYPE ELLIPSE
POINTS 1 1 END
FILLED TRUE
END
#
# Start of layer definitions
#
LAYER
NAME ctybdpy2
TYPE POLYGON
STATUS DEFAULT
DATA ctybdpy2
CLASSITEM 'cty_name'
CLASS
EXPRESSION 'Itasca'
OUTLINECOLOR 128 128 128
COLOR 225 225 185
END
CLASS # every other county in the state
EXPRESSION /./
OUTLINECOLOR 128 128 128
COLOR 255 255 255
END
METADATA
WMS_TITLE "County Boundary"
WMS_ABSTRACT "Itasca County boundary shapefile. See
http://deli.dnr.state.mn.us/metadata/full/ctybdne2.html for more
information."
WMS_SRS "EPSG:26915"
END
END
LAYER
NAME mcd90py2
GROUP cities
TYPE POLYGON
DATA mcd90py2
STATUS OFF
CLASSITEM city_name
CLASS
NAME "Cities & Towns"
EXPRESSION /./
COLOR 255 225 90
TEMPLATE "mcd90py2.html"
END
HEADER "mcd90py2_header.html"
FOOTER "mcd90py2_footer.html"
DUMP TRUE # allow GML export
METADATA
WMS_TITLE "Minor Civil Divisions"
WMS_ABSTRACT "Minor civil divisions for Itasca County. (boundaries
only)"
WMS_SRS "EPSG:26915"
END
END
LAYER
NAME twprgpy3
TYPE POLYGON
DATA twprgpy3
STATUS OFF
CLASS
SYMBOL 'circle'
SIZE 2
NAME 'Townships'
OUTLINECOLOR 181 181 145
END
METADATA
WMS_TITLE "Township Boundaries"
WMS_ABSTRACT "Pulic Land Survey (PLS) township boundaries for Itasca
County. See http://deli.dnr.state.mn.us/metadata/full/twprgne2.html for more
information."
WMS_SRS "EPSG:26915"
END
END
LAYER
NAME lakespy2
TYPE POLYGON
STATUS OFF
DATA lakespy2
CLASS
NAME 'Lakes & Rivers'
TEMPLATE "lakespy2.html"
COLOR 49 117 185
END
HEADER "lakespy2_header.html"
FOOTER "lakespy2_footer.html"
TOLERANCE 3
DUMP TRUE # allow GML export
METADATA
WMS_TITLE "Lakes and Rivers"
WMS_ABSTRACT "DLG lake and river polygons for Itasca County. See
http://deli.dnr.state.mn.us/metadata/full/dlglkpy2.html for more
information."
WMS_SRS "EPSG:26915"
END
END # lakes
LAYER
NAME dlgstln2
TYPE LINE
STATUS OFF
DATA dlgstln2
CLASS
NAME "Streams"
TEMPLATE "dlgstln2.html"
COLOR 49 117 185
END
HEADER "dlgstln2_header.html"
FOOTER "dlgstln2_footer.html"
TOLERANCE 5
DUMP TRUE # allow GML export
METADATA
WMS_TITLE "Streams"
WMS_ABSTRACT "DLG streams for Itasca County. See
http://deli.dnr.state.mn.us/metadata/full/dlgstln2.html for more
information."
WMS_SRS "EPSG:26915"
END
END # streams
LAYER
NAME ctyrdln3
GROUP roads
MAXSCALE 300000
STATUS OFF
DATA ctyrdln3
TYPE LINE
CLASS
COLOR 0 0 0
END
METADATA
WMS_TITLE "County Roads"
WMS_ABSTRACT "County roads. (lines only) Derived from MNDOT roads
layer, see http://deli.dnr.state.mn.us/metadata/full/dotrdln2.html for more
information."
WMS_SRS "EPSG:26915"
END
END # county roads
LAYER
NAME ctyrdln3_anno
GROUP roads
MAXSCALE 300000
STATUS OFF
DATA ctyrdln3
TYPE ANNOTATION
LABELITEM "road_name"
CLASS
COLOR 255 255 255
SYMBOL 'symbols/ctyhwy.png'
LABEL
MINFEATURESIZE 40
MINDISTANCE 150
POSITION CC
SIZE TINY
COLOR 0 0 0
END
END
METADATA
WMS_TITLE "County Roads"
WMS_ABSTRACT "County roads. (shields only) Derived from MNDOT roads
layer, see http://deli.dnr.state.mn.us/metadata/full/dotrdln2.html for more
information."
WMS_SRS "EPSG:26915"
END
END # county road annotation
LAYER
NAME majrdln3
GROUP roads
MAXSCALE 600000
STATUS OFF
DATA majrdln3
TYPE LINE
CLASS
NAME "Roads"
COLOR 0 0 0
END
METADATA
WMS_TITLE "Highways"
WMS_ABSTRACT "Highways- state, US and interstate. (lines only) Derived
from MNDOT roads layer, see
http://deli.dnr.state.mn.us/metadata/full/dotrdln2.html for more
information."
WMS_SRS "EPSG:26915"
END
END # highways
LAYER
NAME majrdln3_anno
GROUP roads
MAXSCALE 600000
STATUS OFF
DATA majrdln3
TYPE ANNOTATION
LABELITEM "road_num"
CLASSITEM "road_class"
CLASS
EXPRESSION "3"
COLOR 0 0 0 # dummy color
SYMBOL 'symbols/sthwy.png'
LABEL
MINFEATURESIZE 50
MINDISTANCE 150
POSITION CC
SIZE TINY
COLOR 0 0 0
END
END
CLASS
EXPRESSION "2"
COLOR 0 0 0 # dummy color
SYMBOL 'symbols/ushwy.png'
LABEL
MINFEATURESIZE 50
MINDISTANCE 150
POSITION CC
SIZE TINY
COLOR 0 0 0
END
END
CLASS
EXPRESSION "1"
COLOR 0 0 0 # dummy color
SYMBOL 'symbols/interstate.png'
LABEL
MINFEATURESIZE 50
MINDISTANCE 150
POSITION CC
SIZE TINY
COLOR 255 255 255
END
END
METADATA
WMS_TITLE "Highways"
WMS_ABSTRACT "Highways- state, US and interstate. (shields only)
Derived from MNDOT roads layer, see
http://deli.dnr.state.mn.us/metadata/full/dotrdln2.html for more
information."
WMS_SRS "EPSG:26915"
END
END # highway annotation
LAYER
NAME airports
TYPE POINT
DATA airports
STATUS OFF
CLASS
NAME 'Airports'
COLOR 128 255 164
SYMBOL 'circle'
SIZE 7
TEMPLATE "airports.html"
END
HEADER "airports_header.html"
FOOTER "airports_footer.html"
TOLERANCE 5
METADATA
WMS_TITLE "Airports"
WMS_ABSTRACT "Airport runways for Itasca County."
WMS_SRS "EPSG:26915"
END
END
LAYER
NAME mcd90py2_anno
NAME cities
TYPE ANNOTATION
DATA mcd90py2
STATUS OFF
LABELITEM "city_name"
CLASSITEM "city_name"
LABELMAXSCALE 500000
CLASS
EXPRESSION /./
COLOR -1 -1 -1
LABEL
COLOR 0 0 0
SHADOWCOLOR 218 218 218
SHADOWSIZE 2 2
TYPE BITMAP
SIZE MEDIUM
POSITION CC
PARTIALS FALSE
BUFFER 2
END
END
METADATA
WMS_TITLE "Minor Civil Divisions"
WMS_ABSTRACT "Minor civil divisions for Itasca County. (annotation
only)"
WMS_SRS "EPSG:26915"
END
END
END # Map File
========================
demo_init.html
========================
<html>
<head><title>MapServer Demo Interface</title></head>
<body bgcolor="#FFFFFF">
<center><h2>MapServer Demo Interface</h2></center>
<p><hr><p>
Click on the initialize button to fire up the demo with 3 layers turned on
will be accessible for browsing. The
data are of Itasca County, MN and were derived, for the most part, from USGS
1:24,000 quadrangles. Some things to note are:
<form method=GET action="/cgi-bin/mapserv">
<input type="hidden" name="map" value="/var/www/html/itasca/demo.map">
<input type="hidden" name="layer" value="lakespy2">
<input type="hidden" name="layer" value="dlgstln2">
<input type="hidden" name="zoomsize" value=2>
<input type="hidden" name="program" value="/cgi-bin/mapserv">
<input type="hidden" name="map_web_imagepath" value="../tmpMaps/">
<input type="hidden" name="map_web_imageurl" value="/tmpMaps/">
<center><input type="submit" value="Initialize"></center>
</form>
<p><hr><p>
</body></html>
========================
demo.html
========================
<html>
<head><title>MapServer Demo Interface</title></head>
<body bgcolor=#FFFFFF>
<center><h1>MapServer Demo Interface</h1></center>
<hr>
<form method=GET action="[program]">
<center>
<table border=0 cellspacing=0 cellpadding=4 bgcolor="#000000">
<tr>
<td valign="top" align=center>
<table cellpadding="0" cellspacing="0" border="0">
<tr><td colspan="2"><INPUT NAME="img" TYPE="image" SRC="[img]" width=600
height=600 border=0></td></tr>
<tr>
<td> <font size=-1 face="arial,helvetica"
color="#FFFFFF"><b>Powered by MapServer</b></font></td>
<td align="right"><img src="[scalebar]"></td>
</tr>
</table>
</td>
<td valign="top" bgcolor=#ffffff>
<table cellpadding="5" cellspacing="0" border="0" bgcolor="#ffffff">
<tr><td>
<center><input type="submit" value="Refresh/Query"></center>
<p>
<input type="radio" name="mode" value="browse" checked> <b>Browse
map</b><br>
<input type="radio" name="mode" value="query"> <b>Query
feature</b><br>
<input type="radio" name="mode" value="nquery"> <b>Query multiple
features</b>
<hr>
<p>
<b>Select Layers to Display: </b><br>
<select multiple name="layer" size=3>
<option value="airports" [airports_select]> Airports
<option value="cities" [cities_select]> Cities
<option value="lakespy2" [lakespy2_select]> Lakes & Rivers
<option value="dlgstln2" [dlgstln2_select]> Streams
<option value="roads" [roads_select]> Roads
<option value="twprgpy3" [twprgpy3_select]> Townships
</select>
<p>
Zoom In <input type=radio name=zoomdir value=1 [zoomdir_1_check]>
Pan <input type=radio name=zoomdir value=0 [zoomdir_0_check]>
Zoom Out <input type=radio name=zoomdir value=-1 [zoomdir_-1_check]>
<p>
Zoom Size <input type=text name=zoomsize size=4 value=[zoomsize]>
<p>
<font size=+1><b>Legend</b></font><br><hr>
<img src="[legend]"><hr>
<p>
<center><INPUT NAME="ref" TYPE="image" SRC="[ref]"
border="0"></center>
</td></tr></table>
</td></tr>
</table>
</center>
<input type="hidden" name="imgxy" value="299.5 299.5">
<input type="hidden" name="imgext" value="[mapext]">
<input type="hidden" name="map" value="[map]">
<input type="hidden" name="savequery" value="true">
<input type="hidden" name="program" value="[program]">
<input type="hidden" name="map_web_imagepath" value="[map_web_imagepath]">
<input type="hidden" name="map_web_imageurl" value="[map_web_imageurl]">
</form>
<p><hr><p>
</body></html>
-----Original Message-----
From: Steve Lime [mailto:steve.lime at dnr.state.mn.us]
Sent: Monday, April 07, 2003 5:17 PM
To: pwpeterson at iesc.net; mapserver-users at lists.gis.umn.edu
Subject: RE: [Mapserver-users] Where are legend, reference and .qyimages
stored? MORE INFO
Well, everything *should* be heading into the same directory. That's
certainly
the intention anyway and it was working last time I ran the Itasca
demo. Can
anyone else out there verify this behavior? Image file names are
created by
simply concatenating the IMAGEPATH with the filename. That behavior has
been
the same for many versions. I just took a quick swing through the code
and it
all looks fine.
Can you post full versions of your template and map files?
Steve
Stephen Lime
Data & Applications Manager
Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> "Paul Peterson" <pwpeterson at iesc.net> 04/07/03 04:21PM >>>
Steve, Thank you for the insight, however...
My experience with 3.7 is that the map images are placed in one
directory
and the ref, leg and .qy files are being placed in another. Is this
suppose
to be the case with 3.7? I can get either the map image to show OR
the
reference and legend images to show, but not both at the same time.
My .map file is in /var/www/html/tutorial/s3/
IMAGEPATH "../tmpMaps/"
IMAGEURL "/tmpMaps/"
I am running Redhat 8.0
Apached 2.0.40
DocumentRoot: /var/www/html
ScriptAlias: /cgi-bin/ /var/www/cgi-bin/
I created /var/www/tmpMaps and added the following to httpd.conf
Alias: /tmpMaps/ /var/www/tmpMaps/
after which the legend and reference images displayed but the map did
not.
I ran my test and did a search on the server's directory for the map
image
but nothing turned up. I then created /var/www/html/tutorial35/tmpMaps
and
ran my tests again. The legend and reference images where created in
/var/www/tmpMaps and displayed as expected, and the map image was
created in
/var/www/html/tutorial35/tmpMaps but did not display.
What am I doing wrong? Why can't I get everything to show up at the
same
time?
Paul Peterson
-----Original Message-----
From: Steve Lime [mailto:steve.lime at dnr.state.mn.us]
Sent: Monday, April 07, 2003 1:37 PM
To: pwpeterson at iesc.net; mapserver-users at lists.gis.umn.edu;
gerry.creager at tamu.edu
Subject: RE: [Mapserver-users] Where are legend, reference and .qy
images stored? MORE INFO
Remember that ../.. is relative to where the CGI program lives, not
where the web page
or map file lives. In 3.7 there is no more crazy chdir() going on.
Steve
Stephen Lime
Data & Applications Manager
Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> "Paul Peterson" <pwpeterson at iesc.net> 04/07/03 11:01AM >>>
Gerry, et al...
I did some more testing. I discovered to get the ref, leg and *.qy
files
stored the IMAGEPATH directory MUST be assigned the ownership and
group
of
the web server. In my case when I changed both of these to 'apache'
the
images were generated and stored, however, again they are showing up
in
/var/tmp!!!! They never get displayed along with the map image
because
the
process tries to get them from /var/www/html/tmp as it should.
My .map file is in /var/www/html/tutorial/s3/
Expected tmp directory /var/www/html/tmp
The IMAGEPATH and IMAGEURL are:
IMAGEPATH "../../tmp/"
IMAGEURL "/tmp/"
Apache serves html from /var/www/html
Paul Peterson
====================================================================
Gerry's response:
May be a 3.7 "feature"... I've not seen image evolution here, either.
gerry
Paul Peterson wrote:
> Rich, Thank you for your response
>
> I should have been more specific...
>
> My .map file is in /var/www/html/tutorial/s3/
> The IMAGEPATH and IMAGEURL are:
> IMAGEPATH "../../tmp/"
> IMAGEURL "/tmp/"
>
> Apache server html from /var/www/html
>
> I give the tmp directory +777 permission which is drwxrwxrwx.
>
> All the images should be placed in /var/www/html/tmp, however, only
the
map
> image is. I found the others (ref, leg and .qy) in /var/tmp!
>
> I add a tmp directory (/var/www/html/tutorial/s3/tmp) and made these
changes
> to IMAGEPATH and IMAGURL:
> IMAGEPATH "tmp/"
> IMAGEURL "/tutorial35/s3/tmp/"
>
> Again, the only image that shows up there is the map image and I
can't
find
> the others anywhere.
>
> Is this a bug with 3.7?
>
>
> Paul
>
>
>
>
> ================================================
> Rich's response:
>
> The images for the map, reference map, legend, and query files will
all be
> saved to the IMAGEPATH directory, which is relative to the .map
file.
So
in
> your case it looks like your map file is in /var/www/html/tutorial35
and
> ../../tmp/ would put you at /var/tmp/. Is your webserver aliasing
/tmp to
> /var/tmp/? Check the time stamps on the files in /var/www/html/tmp.
Try
> seleting everything in both /var/tmp/ and /var/www/html/tmp and
then
hit
> mapserver and see where the images files appear, because what you
describe
> below does not quite make sense.
>
> Rich
>
> At 06:02 PM 4/6/2003 -0500, you wrote:
>
>
>>Hello all.
>>
>>I wrote yesterday regarding a problem with my legends and reference
images
>>not showing up. Does MapServer (3.7) store all generated images in
the
the
>>same tmp directory. I am testing out the Tutorial35 demo app and it
is
>>located at /var/www/html/tutorial35. I have a tmp directory
>>/var/www/html/tmp where only the map png files are showing up. I
was
>
> trying
>
>>out the cashed query and discovered that the legend, reference and
*.qy
>>files where being stored in /var/tmp.
>>
>>Where in the map file does the directory for the legend, reference
and .qy
>>files get set? If MapServer is smart enough to store these files
there
why
>>isn't it smart enough to download them from there as well?
>>
>>A snippet of the map file follows:
>>
>>NAME S3EX4
>>EXTENT -97.5 41.619778 -82.122902 49.38562
>>SIZE 400 300
>>SHAPEPATH "../data"
>>FONTSET "../fonts/fonts.list"
>>SYMBOLSET "../symbols/symbols35.sym"
>>
>>WEB
>> HEADER header.html
>> TEMPLATE s3ex4.html
>> FOOTER footer.html
>> IMAGEPATH "../../tmp/"
>> IMAGEURL "/tmp/"
>> LOG /var/www/html/mapserver.log
>>END
>>
>>Again the IMAGEPATH and IMAGEURL as defined above work for the map
png,
but
>>not the legend, reference ro .qy files.
>>
>>Any ideas what I am doing wrong?
>>
>>Paul Peterson
>>
>>_______________________________________________
>>Mapserver-users mailing list
>>Mapserver-users at lists.gis.umn.edu
>>http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>
>
> Richard W. Greenwood, PLS
> (307) 733-0203
> Rich at GreenwoodMap.com
> www.GreenwoodMap.com
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
--
Gerry Creager -- gerry.creager at tamu.edu
Network Engineering -- AATLT, Texas A&M University
Cell: 979.229.5301 Office: 979.458.4020 FAX: 979.847.8578
Page: 979.228.0173
Office: 903A Eller Bldg, TAMU, College Station, TX 77843
_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
More information about the MapServer-users
mailing list