[Geomoose-users] Query Service Code for GM 1.6

Jay Kapalczynski jkapalczynski at ci.maple-grove.mn.us
Tue Dec 15 15:23:53 EST 2009


If any of you are interested I have made a multi-search in GM 1.6 using a service and map file expressions.
My only issue right now is that it DOES NOT highlight the returned records in the map.  I don't think 1.6 was written to do this.
But would be very interested if anyone knew how to do this!!!!!!!!!!!
I am using the same area for the search out of the box on the search tab...I simply made it (with the help of others) a multiple search on one tab.

Any questions please feel free to contact me...

Demo.xml
The QuerySearch below is the service being used.  All you have to do is create more input types to increase the searching attributes
Notice in the Search service below the extra "subform title"
Demo.html
                Notice the input names reflected in the Service above
Itemquery_PID.map
                Notice the expression being built in the Filter using the input type ID value
                                              FILTER ('[USE1_DESC]'=~ /.*%idOwnerQueryDESC%.*/ AND '[BLOCK]'=~ /.*%idOwnerQueryBLOCK%.*/)
                USE1_DESC and BLOCK are actual field names in the Parcels shapefile
Itemquery_parcels_DESC.html
                Obviously at this point you just need to configure this file to show the data you wish for each returned record


In the Demo.xml

<service title="SearchByPID" selectable="false" default="false" locked="true" div="PIDsearch">
                        <url>/cgi-bin/mapserv.exe</url>
                        <input type="hidden" name="map" value="/ms4w/apps/GeoMOOSE/Maple_Grove_GeoMoose/itemquery_PID.map"/>
                        <input type="hidden" name="mode" value="nquery"/>
                        <input type="hidden" name="layer" value="parcels"/>
                        <input type="user" name="idPID" title="Zoom to PID#:"/>
</service>
<service title="SearchByAddress" selectable="false" default="false" locked="true" div="ADDRESSsearch">
                        <url>/cgi-bin/mapserv.exe</url>
             <input type="hidden" name="map" value="/ms4w/apps/GeoMOOSE/Maple_Grove_GeoMoose/itemquery_PID.map"/>
                        <input type="hidden" name="mode" value="nquery"/>
                        <input type="hidden" name="layer" value="parcel_points"/>
                        <input type="user" name="idPOINTS" title="Zoom to Address:"/>
</service>
<service title="QuerySearch" selectable="false" default="false" locked="true" div="QuerySearchTest">
                        <url>/cgi-bin/mapserv.exe</url>
                        <input type="hidden" name="map" value="/ms4w/apps/GeoMOOSE/Maple_Grove_GeoMoose/itemquery_PID.map"/>
                        <input type="hidden" name="mode" value="nquery"/>
                        <input type="hidden" name="layer" value="parcels"/>
                        <input type="user" name="idOwnerQueryDESC" title="Zoom to OwnerQueryDESC#:"/>
                        <input type="user" name="idOwnerQueryBLOCK" title="Zoom to OwnerQueryBLOCK#:"/>
</service>
<service title="Search" selectable="false" default="false" onclick="return false;" locked="false" type='multiform'>
                  <subform title="SearchByPID"/>
                    <subform title="SearchByAddress"/>
                  <subform title="QuerySearch"/>
  </service>


In the Demo.html at the bottom

<div id="CustomForms">

<div id="PIDsearch">
                           <font color="black"><p align="center">This section will allow you to search the Parcel Database by PID, Address, and Owner. Find the appropriate search criteria below and enter the text in the textbox and hit the Search button next to the textbox.</p></font>
                        <font color="black"><b>Search for PID:</b></font><br/>
                        <input name="idPID" type="text" id="idPID" onkeypress="return clickButton(event,'Button1')" />
                        <input type="submit" id="Button1" value="Search"/>
                        <input type="hidden" name="map" value="/ms4w/apps/GeoMOOSE/Maple_Grove_GeoMoose/itemquery_PID.map"/>
                        <input type="hidden" name="mode" value="nquery"/>
                        <br>&nbsp;&nbsp;&nbsp;<i>Enter PID number.<i/>
                        </div>
<div id="ADDRESSsearch">
                        <font color="black"><b>Search for Address:</b></font><br/>
<input name="idPOINTS" type="text" id="idPOINTS" onkeypress="return clickButton(event,'Button2')" />
                        <input type="submit" id="Button2" value="Search"/>
                        <input type="hidden" name="map" value="/ms4w/apps/GeoMOOSE/Maple_Grove_GeoMoose/itemquery_PID.map"/>
                        <input type="hidden" name="mode"value="nquery"/>
                        <br>&nbsp;&nbsp;&nbsp;<i>Enter Address number.<i/>
</div>
<div id="QuerySearchTest">
                        <font color="black"><b><u>Search Query: Build Query</u></b></font><br/>
                        <i>Description:<i/><br>
                  <input name="idOwnerQueryDESC" type="text" id="idOwnerQueryDESC" onkeypress="return clickButton(event,'Button4')" /> <br>
                        <i>Block:<i/><br>
<input name="idOwnerQueryBLOCK" type="text" id="idOwnerQueryBLOCK" onkeypress="return clickButton(event,'Button4')" />
                        <input type="submit" id="Button4" value="Search"/>
                        <input type="hidden" name="map" value="/ms4w/apps/GeoMOOSE/Maple_Grove_GeoMoose/itemquery_PID.map"/>
                        <input type="hidden" name="mode"value="nquery"/>
</div>
</div>


Itemquery_PID.map file

  LAYER # Parcels Owner Layer
                            NAME 'Parcels'
                            DATA 'parcels/parcels.shp'
                            STATUS DEFAULT
                            TYPE POLYGON
                            METADATA
                                              qstring_validation_pattern '.'
                            END
                            TEMPLATE 'parcels/itemquery_parcels_DESC.html'

                            FILTER ('[USE1_DESC]'=~ /.*%idOwnerQueryDESC%.*/ AND '[BLOCK]'=~ /.*%idOwnerQueryBLOCK%.*/)
 END

Itemquery_parcels_DESC.html file

Configure this anyway you see fit.








-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20091215/36def8ed/attachment.html


More information about the Geomoose-users mailing list