<!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> </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. I appreciate the broken down
explanation. You completely cleared things up for me! 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> </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> </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> </DIV>
<DIV><SPAN class=432173219-01092005><FONT face=Arial color=#0000ff
size=2>PS 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> </DIV>
<DIV>It appears you are using the CGI flavour of MapServer, which is also how
I use MapServer.</DIV>
<DIV> </DIV>
<DIV>The header / footer and results templates work as follows: (at
least the way I do it)</DIV>
<DIV> </DIV>
<DIV>1. you submit your query to mapserver, by clicking on the map (or
sending query information via URL parameters).</DIV>
<DIV> </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> </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,
the 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> </DIV>
<DIV>4. MapServer parses through the TEMPLATE "xxx" file for the first layer
that has results. think of this as a 'results' template. 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 of results into the
resulting webpage. </DIV>
<DIV> </DIV>
<DIV>5. steps 3 and 4 are repeated for any other layers that returned
results.</DIV>
<DIV> </DIV>
<DIV>6. MapServer closes off the webpage with the Footer template, where
you can close off the html table, or add whatever you want to be shown beneath
the results.</DIV>
<DIV> </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> </DIV>
<DIV>The CGI values in your result templates need to be [UPPER_CASE] for
shapefile layers, and [lower_case] for postgis layers.</DIV>
<DIV> </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> </DIV>
<DIV>I would suggest that you take your existing queryresults_template
file, and split it out into the main Header and Footer files, and a header and
template file for that first layer, then copy and modify the
header and template files to suit the other layers for which you want results.
</DIV>
<DIV> </DIV>
<DIV>You can view how this system works for me at the following mapserver
website:</DIV>
<DIV> </DIV>
<DIV><A
href="http://24.87.220.99/ms/iwafs.html">http://24.87.220.99/ms/iwafs.html</A></DIV>
<DIV> </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 end up
with a list of Soil Geochem and Drill Hole query results. </DIV>
<DIV> </DIV>
<DIV>Good luck,</DIV>
<DIV>Ken Lord</DIV>
<DIV>Vancouver BC</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><SPAN class=gmail_quote>On 8/25/05, <B class=gmail_sendername>Rebecca
Colwell</B> <<A
href="mailto:rcolwell@willcountyillinois.com">rcolwell@willcountyillinois.com</A>>
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. I'd like to query<BR>two layers (Parcels and Zoning
Districts)and have their attributes shown in <BR>the
QueryResults_template.html. 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. I don't understand header/footer
files. In case<BR>that's part of the answer, please share their
significance in the process.<BR>Any help would be most
appreciated. 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><html><BR><head><BR><title>Airport
Query
Results</title><BR></head><BR><body><BR><b><i><font
size="5" face="Georgia, Times New Roman, Times, serif">2005 Will
<BR>County Regional Airport<br><BR>
</font></i></b><BR><table><BR> <tr><BR> <td
width="300"
valign="top"><br><p><font<BR>face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"><br>
<BR><img<BR>src="/cgi-bin/mapserv?map=/home/colwell/public_html/Airport2/Map2.map&mapsize=300+225&mapxy=[shpmidx]+[shpmidy]&mapext=[shpext_esc]&scale=50000&state=[PIN]&mode=map"<BR>border="1"></font></p></td>
<BR> </tr><BR></table><BR><br><BR><br><BR> <table
width="331" border="1" cellspacing="2" cellpadding="0"
height="167"><BR> <tr><BR><td></td><BR><td
align="right"></td><BR> </tr><BR> <tr><BR><td>Parcel
#</td><BR><td
align="right">[PIN]</td><BR> </tr><BR> <tr>
<BR><td>Owner(s)</td><BR><td
align="right">[OWNER_1]</td><BR> </tr><BR> <tr><BR><td>Address</td><BR><td
align="right">[STREET]</td><BR> </tr><BR> <tr><BR><td>City/State/Zip</td><BR><td
align="right">[CITY], [ZIP1]</td><BR> </tr><BR> <tr><BR><td>Township</td><BR><td
align="right">[TWP_NAME]</td>
<BR> </tr><BR> <tr><BR><td>Zowning
District</td><BR><td
align="right">[ZONE_TYPE]</td><BR> </tr><BR></table><BR><p></p><BR><table
width="331" border="1" cellspacing="2" cellpadding="0" height="98">
<BR> <tr><BR> <td>Sale
Date</td><BR> <td
align="right"></td><BR> </tr><BR> <tr><BR> <td>Sale
Amount</td><BR> <td
align="right"></td>
<BR> </tr><BR> <tr><BR> <td>Acreage</td><BR> <td
align="right">[ACREAGE]
acres</td><BR> </tr><BR> <tr><BR> <td></td><BR> <td
align="right"></td>
<BR> </tr><BR></table><BR><p><font
face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"></font></p><BR></body><BR></html><BR></BLOCKQUOTE></DIV><BR><BR
clear=all></BLOCKQUOTE></BODY></HTML>