[Geomoose-users] Making a select parcel list, need ideas

Bistrais, Bob Bob.Bistrais at maine.gov
Fri Sep 21 11:58:20 PDT 2012


I'm working on a parcel viewer application, making a new service for GeoMoose.  The idea is to input a town name, the scripts will then query the parcel shapefile's dbf file (will probably switch to database soon, doesn't matter for now), this in turn populates a select list containing the parcel map-book-lot values for the selected town.

So far, I've done that much and it works well.  What I'd like to do next (and where I'm stuck) is to capture the selected parcel map-book-lot value, and send that to a followup service which actually queries the data layer.  I experimented with doing it as a form, and capturing the select value as a variable, without success.

Does anyone have suggestions?  I know several of us are working with parcel viewing applications, and think it could be of interest.  I'd be happy to submit this tool for all to use when it's done.

Here is my code which creates the pick list (it is called as a service from the toolbar):

<?
//Connect to the database
$objConnect = odbc_connect ('mapserver', '', '') or die('Could Not Connect to ODBC Database!');
$town=$_REQUEST['town'];

if($_REQUEST['town']){
  $command = "SELECT MAP_BK_LOT FROM parcels.dbf WHERE TOWN='".$_REQUEST['town']."'";
  $query=odbc_exec($objConnect,$command) or die ("Error executing query");

//Make a select list from the result set
  $results='<select name="parcellist" >';
  while($row=odbc_fetch_array($query)){
                $mapbklot = $row['MAP_BK_LOT'];
                $results.='<option value="'.$mapbklot.'">'.$mapbklot;
  }
$results.='</select>';
}

odbc_close($objConnect);  //close database

//print the select list to the window
header('Content-type: text/xml');
print "<results>";
print "<script><![CDATA[";
print "]]></script>";
print "<html><![CDATA[";
print $output;
print $results;
print '<div style="display: [SHOW_FOLLOWUP]"/>';
print "<br/><br/>";
print "</div>";
print "]]></html>";
print "</results>";

?>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geomoose-users/attachments/20120921/fc3aaedf/attachment.html>


More information about the Geomoose-users mailing list