<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>MapServer Query QuickStart</title>
</head>
<body bgcolor="#FFFFFF">
<p><font size="4" face="Arial"><strong>MapServer Query QuickStart</strong></font></p>
<p> </p>
<p><font face="Arial"><strong>What MapServer can do with little
effort on your part</strong></font></p>
<p><font face="Arial"><u>1. Query by spatial region</u></font></p>
<blockquote>
<p><font face="Arial">From a single mouse click (or bounding
box), display attributes for the geographical objects in the
area. This can be features in one, some, or all themes
(layers).</font></p>
<p><font face="Arial">The implementor's tasks:</font></p>
<ol>
<li><font face="Arial">Decide which layers will be
queriable from the user-interface. In the map
configuration file, add a QUERY entry for each of the
layers to be queried</font>:</li>
</ol>
<blockquote>
<pre>
LAYER
NAME Cities
TYPE POLYGON
STATUS ON
DATA cities
CLASS
NAME Cities
SYMBOL 2
COLOR 0 0 0
END # class
QUERY
TEMPLATE cities.html
END # Query
END # Layer
</pre>
</blockquote>
<ol type="1" start="2">
<li><font face="Arial">Create a "template" HTML
file to hold the query results. The keywords in the
"[ ]" can be either MapServer keywords or
field names in the DBF file related to the layer's
shapefile:</font></li>
</ol>
<blockquote>
<p><br>
<font size="2" face="Courier New">Result [rn]
([cl])<br><br>
<br>
<menu><br>
City name is: [PPPTNAME]<br>
</menu><br>
<br>
<p></font></p>
</blockquote>
<p><font face="Arial"></font> </p>
<ol type="1" start="2">
<li value="3"><font face="Arial">Edit the
"main" web HTML file to make sure there are
HTML controls to set MapServer's "mode"
variable to "query":</font></li>
</ol>
<blockquote>
<p><font size="2" face="Courier New"><input
type="radio" name="mode"
value="browse" checked> <b>Browse
map</b><br><br>
<blockquote><br>
<input type=radio name=zoomdir value=0
[zoomdir_0_check]> Pan <br><br>
<input type=radio name=zoomdir value=1
[zoomdir_1_check]> Zoom In <br><br>
<input type=radio name=zoomdir value=-1
[zoomdir_-1_check]> Zoom Out <br><br>
Zoom Size: <input type=text name=zoomsize size=4
value=2> <br><br>
</blockquote><br>
<input type="radio" name="mode"
value="query"> <b>Query
feature</b><br><br>
<input type="radio" name="mode"
value="nquery"> <b>Query multiple
features</b></font></p>
</blockquote>
<p><font face="Arial"></font> </p>
<p><font face="Arial">The user's task would be to select the
"query" control on web page and click the area near
the feature. Mapserver will do the searching and present the
results by substituting values in the HTML template</font><br>
</p>
<p><font face="Arial">Note that queries don't work on tiled
shapefiles.</font></p>
<p> </p>
</blockquote>
<p><font face="Arial"><strong>What MapServer can do with some
effort on your part:</strong></font></p>
<p> </p>
<p><font face="Arial"><strong>What MapServer can't do (unless you
are a programmer):</strong></font></p>
</body>
</html>