<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 6.00.2900.2722" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=432173219-01092005><FONT face=Arial color=#0000ff size=2>Thanks 
Ken!</FONT></SPAN></DIV>
<DIV><SPAN class=432173219-01092005><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=432173219-01092005><FONT face=Arial color=#0000ff size=2>Sorry 
I didn't respond sooner, things got crazy at work, and this is the first chance 
I've had to take a look at your feedback.&nbsp; I appreciate the broken down 
explanation.&nbsp; You completely cleared things up for me!&nbsp; I should be 
able to implement it by the end of the day.</FONT></SPAN></DIV>
<DIV><SPAN class=432173219-01092005><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=432173219-01092005><FONT face=Arial color=#0000ff size=2>Thanks 
again,</FONT></SPAN></DIV>
<DIV><SPAN class=432173219-01092005><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=432173219-01092005><FONT face=Arial color=#0000ff 
size=2>~Becky</FONT></SPAN></DIV>
<DIV><SPAN class=432173219-01092005><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=432173219-01092005><FONT face=Arial color=#0000ff 
size=2>PS&nbsp; Great mapserver site BTW!</FONT></SPAN></DIV>
<BLOCKQUOTE>
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> UMN MapServer Users List 
  [mailto:MAPSERVER-USERS@LISTS.UMN.EDU]<B>On Behalf Of </B>Ken 
  Lord<BR><B>Sent:</B> Thursday, August 25, 2005 7:28 PM<BR><B>To:</B> 
  MAPSERVER-USERS@LISTS.UMN.EDU<BR><B>Subject:</B> Re: [UMN_MAPSERVER-USERS] 
  Multiple Layer Queries<BR><BR></FONT></DIV>
  <DIV><BR>Hi Rebecca,</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>It appears you are using the CGI flavour of MapServer, which is also how 
  I use MapServer.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>The header / footer and results templates work as follows:&nbsp; (at 
  least the way I&nbsp;do it)</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>1.&nbsp; you submit your query to mapserver, by clicking on the map (or 
  sending query information via URL parameters).</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>2. MapServer parses together the results webpage, starting with the main 
  Header file, which you use to layout the structure of the page, such as a 
  title, the start of a table to show the results, whatever else you want at the 
  top of your page, etc. </DIV>
  <DIV>&nbsp;</DIV>
  <DIV>3. For the first layer containing query results, MapServer parses the 
  Header template you've made that is specific to that map layer,&nbsp; 
  the&nbsp;HEADER "xxx" parameter within a layer in your mapfile.</DIV>
  <DIV>This header can be used to add the layer name, attribute names etc for 
  that layer, and to layout the table structure specifically for the data that 
  is retrieved for this layer.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>4. MapServer parses through the TEMPLATE "xxx" file for the first layer 
  that has results. think of this as a 'results' template.&nbsp;This file is 
  processed once for each result found for that layer by the query, if you've 
  set it up as a table, this template adds rows&nbsp;of results into the 
  resulting webpage. </DIV>
  <DIV>&nbsp;</DIV>
  <DIV>5. steps 3 and 4 are repeated for any other layers that returned 
  results.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>6. MapServer closes off the webpage with&nbsp;the Footer template, where 
  you can close off the html table, or add whatever you want to be shown beneath 
  the results.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>You list your main Header and Footer template files in the WEB section of 
  your mapfile. Every layer for which you want to show query results must have 
  its own Header and Template files. I find it convenient to name them to match 
  the name of your layer, with a _header or _results appended to the end, such 
  as soilassay_header.htm and soilassay_results.htm. </DIV>
  <DIV>&nbsp;</DIV>
  <DIV>The CGI values in your result templates need to be [UPPER_CASE]&nbsp;for 
  shapefile layers, and [lower_case] for postgis layers.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>It is a good idea to include a TOLERANCE and TOLERANCEUNITS for each 
  layer being queried, some versions of mapserver have some funny quirks if you 
  leave them out.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>I would suggest that you take your existing &nbsp;queryresults_template 
  file, and split it out into the main Header and Footer files, and a header and 
  template file for that first layer,&nbsp; then&nbsp;copy and modify&nbsp;the 
  header and template files to suit the other layers for which you want results. 
  </DIV>
  <DIV>&nbsp;</DIV>
  <DIV>You can view how this system works for me at the following mapserver 
  website:</DIV>
  <DIV>&nbsp;</DIV>
  <DIV><A 
  href="http://24.87.220.99/ms/iwafs.html">http://24.87.220.99/ms/iwafs.html</A></DIV>
  <DIV>&nbsp;</DIV>
  <DIV>... Click on the 'Highlights' tab at the top right of the page, and then 
  view map number 3. Query the map with the ' i ' tool in a spot where there's 
  lots of big and small point symbols close together. You should&nbsp;end up 
  with&nbsp;a list of Soil Geochem and Drill Hole query results. </DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Good luck,</DIV>
  <DIV>Ken Lord</DIV>
  <DIV>Vancouver BC</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV><SPAN class=gmail_quote>On 8/25/05, <B class=gmail_sendername>Rebecca 
  Colwell</B> &lt;<A 
  href="mailto:rcolwell@willcountyillinois.com">rcolwell@willcountyillinois.com</A>&gt; 
  wrote:</SPAN> 
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi 
    Everybody,<BR><BR>I'm working on a new mapserver app after a long 
    hiatus.&nbsp;&nbsp;I'd like to query<BR>two layers (Parcels and Zoning 
    Districts)and have their attributes shown in <BR>the 
    QueryResults_template.html.&nbsp;&nbsp;I'm using NQUERY, but am still only 
    getting<BR>results from one layer in the results table.<BR><BR>I know this 
    is not a new question, but I'm having a hard time deciphering<BR>all the 
    necessary steps from the tutorial, and haven't found the answers on 
    <BR>previous list posts.&nbsp;&nbsp;I don't understand header/footer 
    files.&nbsp;&nbsp;In case<BR>that's part of the answer, please share their 
    significance in the process.<BR>Any help would be most 
    appreciated.&nbsp;&nbsp;I'll post my queryResults_template.html <BR>below in 
    case that'll help unlock the 
    mystery.<BR><BR>Thanks!<BR><BR>~Becky<BR><BR>&lt;html&gt;<BR>&lt;head&gt;<BR>&lt;title&gt;Airport 
    Query 
    Results&lt;/title&gt;<BR>&lt;/head&gt;<BR>&lt;body&gt;<BR>&lt;b&gt;&lt;i&gt;&lt;font 
    size="5" face="Georgia, Times New Roman, Times, serif"&gt;2005 Will 
    <BR>County Regional Airport&lt;br&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
    &lt;/font&gt;&lt;/i&gt;&lt;/b&gt;<BR>&lt;table&gt;<BR>&nbsp;&nbsp;&lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td 
    width="300" 
    valign="top"&gt;&lt;br&gt;&lt;p&gt;&lt;font<BR>face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"&gt;&lt;br&gt; 
    <BR>&lt;img<BR>src="/cgi-bin/mapserv?map=/home/colwell/public_html/Airport2/Map2.map&amp;mapsize=300+225&amp;mapxy=[shpmidx]+[shpmidy]&amp;mapext=[shpext_esc]&amp;scale=50000&amp;state=[PIN]&amp;mode=map"<BR>border="1"&gt;&lt;/font&gt;&lt;/p&gt;&lt;/td&gt; 
    <BR>&nbsp;&nbsp;&lt;/tr&gt;<BR>&lt;/table&gt;<BR>&lt;br&gt;<BR>&lt;br&gt;<BR>&nbsp;&nbsp;&lt;table 
    width="331" border="1" cellspacing="2" cellpadding="0" 
    height="167"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<BR>&lt;td&gt;&lt;/td&gt;<BR>&lt;td 
    align="right"&gt;&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<BR>&lt;td&gt;Parcel 
    #&lt;/td&gt;<BR>&lt;td 
    align="right"&gt;[PIN]&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt; 
    <BR>&lt;td&gt;Owner(s)&lt;/td&gt;<BR>&lt;td 
    align="right"&gt;[OWNER_1]&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<BR>&lt;td&gt;Address&lt;/td&gt;<BR>&lt;td 
    align="right"&gt;[STREET]&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<BR>&lt;td&gt;City/State/Zip&lt;/td&gt;<BR>&lt;td 
    align="right"&gt;[CITY],&nbsp;&nbsp;[ZIP1]&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<BR>&lt;td&gt;Township&lt;/td&gt;<BR>&lt;td 
    align="right"&gt;[TWP_NAME]&lt;/td&gt; 
    <BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<BR>&lt;td&gt;Zowning 
    District&lt;/td&gt;<BR>&lt;td 
    align="right"&gt;[ZONE_TYPE]&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<BR>&lt;/table&gt;<BR>&lt;p&gt;&lt;/p&gt;<BR>&lt;table 
    width="331" border="1" cellspacing="2" cellpadding="0" height="98"&gt; 
    <BR>&nbsp;&nbsp;&lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;Sale 
    Date&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td 
    align="right"&gt;&lt;/td&gt;<BR>&nbsp;&nbsp;&lt;/tr&gt;<BR>&nbsp;&nbsp;&lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;Sale 
    Amount&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td 
    align="right"&gt;&lt;/td&gt; 
    <BR>&nbsp;&nbsp;&lt;/tr&gt;<BR>&nbsp;&nbsp;&lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;Acreage&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td 
    align="right"&gt;[ACREAGE] 
    acres&lt;/td&gt;<BR>&nbsp;&nbsp;&lt;/tr&gt;<BR>&nbsp;&nbsp;&lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td 
    align="right"&gt;&lt;/td&gt; 
    <BR>&nbsp;&nbsp;&lt;/tr&gt;<BR>&lt;/table&gt;<BR>&lt;p&gt;&lt;font 
    face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"&gt;&lt;/font&gt;&lt;/p&gt;<BR>&lt;/body&gt;<BR>&lt;/html&gt;<BR></BLOCKQUOTE></DIV><BR><BR 
  clear=all></BLOCKQUOTE></BODY></HTML>