<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">You need to refer to the attributes next…<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><tr><td>[NAME]</td><td>[TYPE]</td></tr><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Steve<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Mark Mirrlees [mailto:mmirrlees@hotmail.com]
<br>
<b>Sent:</b> Wednesday, March 20, 2013 12:16 PM<br>
<b>To:</b> Lime, Steve D (MNIT); mapserver-users@lists.osgeo.org<br>
<b>Subject:</b> RE: [mapserver-users] query creation issues<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""><br>
Hi Steve,<br>
<br>
Thanks for your help. I've managed to get the query outputted. I have a couple of additional questions...after creating my query I need the footer to show the "name" and the "type" (based on the shapefile information), as based on the footer.html below<br>
<br>
<!-- MapServer Template --><br>
<h3><b>Layer: Major Roads</b></h3><br>
<br><br>
<INPUT NAME="img" TYPE="image" SRC="[img]" width=500 height=500 border=0 ALT="Map Image"><br>
<table border=1><br>
<tr> </td><br>
<th>Name</th><br>
<th>Type</th><br>
</tr><o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> As when I launch my query it only shows...<br>
<o:p></o:p></span></p>
<table class="MsoNormalTable" border="1" cellpadding="0">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><b>Name<o:p></o:p></b></p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><b>Type<o:p></o:p></b></p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt"></td>
<td style="padding:.75pt .75pt .75pt .75pt"></td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""><br>
<br>
Based on readings from the mapserver website, it looks like I have to edit the query.html to make this populated...but not sure where (global.map file?) I can get this information that is supposed to go between the <td> and </td> tags.<br>
<br>
<!-- MapServer Template --><br>
<!--<IMG src="<a href="http://[host]/cgi-bin/mapserv.exe?mode=INDEXQUERY&qformat=png24&qlayer=mjrroads&shapeindex=%5bshpidx%5d&shpext=%5bshpext_esc%5d&mapext=shape&map=%5bmap">http://[host]/cgi-bin/mapserv.exe?mode=INDEXQUERY&qformat=png24&qlayer=mjrroads&shapeindex=[shpidx]&shpext=[shpext_esc]&mapext=shape&map=[map</a>]">--><br>
<tr><br>
<td> </td><br>
<td></td><br>
</tr><br>
<br>
Thanks,<br>
Mark<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">> From:
<a href="mailto:Steve.Lime@state.mn.us">Steve.Lime@state.mn.us</a><br>
> To: <a href="mailto:mmirrlees@hotmail.com">mmirrlees@hotmail.com</a>; <a href="mailto:mapserver-users@lists.osgeo.org">
mapserver-users@lists.osgeo.org</a><br>
> Subject: RE: [mapserver-users] query creation issues<br>
> Date: Wed, 20 Mar 2013 17:00:47 +0000<br>
> <br>
> Hi Mark: Personally I'd steer you to the simplified query templates as described here:<br>
> <br>
> <a href="http://mapserver.org/development/rfc/ms-rfc-36.html">http://mapserver.org/development/rfc/ms-rfc-36.html</a><br>
> <br>
> This allows you to put everything in one place and better separates data from presentation. No more header/footer's. Plus you can have multiple presentations for the same layer.
<br>
> <br>
> That said, the mapfile below doesn't have any queryable layers. There is no TEMPLATE defined for the one layer that is present.<br>
> <br>
> If you want to use the new style templating you'd do something like this:<br>
> <br>
> 1- Define an output format:<br>
> <br>
> OUTPUTFORMAT<br>
> NAME 'my-template'<br>
> DRIVER 'TEMPLATE'<br>
> MIMETYPE 'text/html; subtype=compass'<br>
> FORMATOPTION "FILE=templates/my-template.html"<br>
> END<br>
> <br>
> 2- Optionally make it the default query format (otherwise you need to use qformat CGI parameter):<br>
> <br>
> WEB<br>
> QUERYFORMAT 'my-template'<br>
> ...<br>
> END<br>
> <br>
> 3- Make layers queryable by adding something like:<br>
> <br>
> TEMPLATE 'void'<br>
> <br>
> 4- Write your template, for example my-template.html might look like:<br>
> <br>
> --- snip ---<br>
> <!-- MapServer Template --><br>
> This is my template:<br/><br>
> <br>
> [resultset layer="mjrroads"]<br>
> [feature]<b>Type</b>: [TYPE][/feature]<br>
> [/resultset]<br>
> <br>
> Done presenting layers.<br>
> --- snip ---<br>
> <br>
> Steve<br>
> <br>
> From: <a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a> [<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mailto:mapserver-users-bounces@lists.osgeo.org</a>] On Behalf Of Mark Mirrlees<br>
> Sent: Wednesday, March 20, 2013 10:45 AM<br>
> To: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
> Subject: [mapserver-users] query creation issues<br>
> <br>
> Hello everyone,<br>
> <br>
> I'm trying to create a query so I can query the roads/expressways from the map. I'm pretty sure I have created the headers and footers correctly but not sure...regardless i'm not entirely too sure where to stick the particular code in my .map file (shown
below). I have bolded the code that I'm trying to incorporate into the .map file but not sure why it's not working. Thanks Mark<br>
> <br>
> # Map file created from QGIS project file C:/wwwroot/M_Mirrlees_Assign3/markassign3.qgs<br>
> # Edit this file to customize for your map interface<br>
> # (Created with PyQgis MapServer Export plugin)<br>
> MAP<br>
> NAME "QGIS-MAP"<br>
> # Map image size<br>
> SIZE 500 500<br>
> UNITS meters<br>
> EXTENT -2400000 -900000 3100000 4000000<br>
> FONTSET "/wwwroot/fonts/fontset.txt"<br>
> SYMBOLSET "/wwwroot/symbols/symbols.sty"<br>
> PROJECTION<br>
> "proj=lcc"<br>
> "ellps=GRS80"<br>
> "lat_0=49"<br>
> "lon_0=-95"<br>
> "lat_1=49"<br>
> "lat_2=77"<br>
> "datum=NAD83"<br>
> "units=m"<br>
> "no_defs"<br>
> END<br>
> # Background color for the map canvas -- change as desired<br>
> IMAGECOLOR 0 100 250<br>
> IMAGEQUALITY 95<br>
> IMAGETYPE agg<br>
> OUTPUTFORMAT<br>
> NAME agg<br>
> DRIVER AGG/PNG<br>
> IMAGEMODE RGB<br>
> END<br>
> # Legend<br>
> LEGEND<br>
> IMAGECOLOR 255 255 255<br>
> STATUS ON<br>
> KEYSIZE 18 12<br>
> LABEL<br>
> TYPE BITMAP<br>
> SIZE MEDIUM<br>
> COLOR 0 0 89<br>
> END<br>
> END<br>
> # Web interface definition. Only the template parameter<br>
> # is required to display a map. See MapServer documentation<br>
> WEB<br>
> # Set IMAGEPATH to the path where MapServer should<br>
> # write its output.<br>
> IMAGEPATH "/ms4w/tmp/ms_tmp/"<br>
> # Set IMAGEURL to the url that points to IMAGEPATH<br>
> # as defined in your web server configuration<br>
> IMAGEURL "/ms_tmp/"<br>
> # WMS server settings<br>
> METADATA<br>
> 'ows_title' 'QGIS-MAP'<br>
> 'ows_onlineresource' 'localhost.com/cgi-bin/mapserv.exe?map=C:/wwwroot/M_Mirrlees_Assign3/global.map'<br>
> 'ows_srs' 'EPSG:4326'<br>
> END<br>
> #Scale range at which web interface will operate<br>
> # Template and header/footer settings<br>
> # Only the template parameter is required to display a map. See MapServer documentation<br>
> TEMPLATE 'C:/wwwroot/M_Mirrlees_Assign3/global.html'<br>
> END<br>
> <br>
> SCALEBAR<br>
> STATUS EMBED<br>
> UNITS KILOMETERS<br>
> INTERVALS 3<br>
> TRANSPARENT TRUE<br>
> OUTLINECOLOR 0 0 0<br>
> END # End for scalebar<br>
> <br>
> QUERYMAP<br>
> STATUS ON # sets the map to be queryable<br>
> STYLE HILITE # the selected object is highligthed<br>
> END # End for QueryMap<br>
> <br>
> WEB<br>
> TEMPLATE global.html<br>
> IMAGEPATH "/ms4w/tmp/ms_tmp/"<br>
> IMAGEURL "/ms_tmp/"<br>
> HEADER "/maps/M_Mirrlees_assign3/header.html"<br>
> FOOTER "maps/M_Mirrlees_assign3/footer.html"<br>
> EMPTY "/maps/M_Mirrlees_Assign3/blank.html"<br>
> END #End for WEB<br>
> <br>
> <br>
> LAYER<br>
> NAME 'mjrroads'<br>
> TYPE LINE<br>
> DUMP false<br>
> EXTENT -143.210462 39.001401 -50.461045 85.911094<br>
> DATA '../data/mjrroads.shp'<br>
> METADATA<br>
> 'ows_title' 'mjrroads'<br>
> END<br>
> STATUS default<br>
> TRANSPARENCY 100<br>
> PROJECTION<br>
> 'proj=longlat'<br>
> 'datum=WGS84'<br>
> 'no_defs'<br>
> END<br>
> <br>
> CLASSITEM 'TYPE'<br>
> CLASS<br>
> NAME "default"<br>
> EXPRESSION "" <br>
> STYLE<br>
> WIDTH 0.91 <br>
> COLOR 201 157 32<br>
> END<br>
> END<br>
> CLASS<br>
> NAME "TYPE = Expressway" <br>
> EXPRESSION "Expressway" <br>
> STYLE<br>
> WIDTH 2.0 <br>
> COLOR 255 0 0<br>
> END<br>
> END<br>
> CLASS<br>
> NAME "TYPE = Primary Highway" <br>
> EXPRESSION "Primary Highway" <br>
> MAXSCALEDENOM 2500000<br>
> STYLE<br>
> WIDTH 1.0 <br>
> COLOR 0 0 0<br>
> END<br>
> END<br>
> END<br>
> <o:p></o:p></span></p>
</div>
</div>
</div>
</body>
</html>