<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18702"></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<DIV>Hi everyone, </DIV>
<DIV>I successfully queried the same view twice in two separate layers in order to show two related shapes, but now I have decided that there are too many options (and thus too many mapfiles to create and combinations for the developers on the other end to handle) so I am trying to write a php script to generate the two new layers according to the parameters passed into the script via url. </DIV>
<DIV> </DIV>
<DIV>I'll paste in my code currently.  I have issues with oraclespatial, and I just keep getting errors that the layer can't be drawn.  I'm having a hard time finding examples of this use, so I'm just hoping someone might be able to point out where I'm going wrong.  The lack of error reporting from php hasn't been helping matters either ;) </DIV>
<DIV> </DIV>
<DIV>Please forgive me if I have made a (or several) silly mistake.  I'm new to php, oracle, and mapserver. </DIV>
<DIV> </DIV>
<DIV>Cheers, </DIV>
<DIV>Jess</DIV>
<DIV> </DIV>
<DIV>URL:  <A href='http://local/multiLayer2.php?map=base2.map&map_name="Asset Survey related map"orig_type=POLYGON&orig_name=ASSET&orig_id=19117&rel_type=LINE&rel_name=SURVEY&rel_id=42'>http://local/multiLayer2.php?map=base2.map&map_name="Asset Survey related map"orig_type=POLYGON&orig_name=ASSET&orig_id=19117&rel_type=LINE&rel_name=SURVEY&rel_id=42</A></DIV>
<DIV>This is what I want the url to look like, but currently, I've hardcoded the values into the script.</DIV>
<DIV> </DIV>
<DIV>MAPFILE:</DIV>
<DIV>MAP<BR> NAME base<BR> STATUS ON<BR> SIZE 800 600<BR> EXTENT 227154 5165779 627108 5614539<BR> UNITS METERS<BR> IMAGECOLOR 234 255 255<BR> SYMBOLSET "base.sym"<BR> FONTSET "base.list"<BR> PROJECTION<BR>  "proj=utm"</DIV>
<DIV>[..................]<BR>##Changeable layers </DIV>
<DIV> LAYER<BR>  NAME layer1<BR>  TYPE POINT<BR>  STATUS OFF<BR> END</DIV>
<DIV> </DIV>
<DIV> LAYER<BR>  NAME layer2<BR>  TYPE POINT<BR>  STATUS OFF<BR> END</DIV>
<DIV>## end ##</DIV>
<DIV>[..............]</DIV>
<DIV>END</DIV>
<DIV> </DIV>
<DIV>PHP:</DIV>
<DIV><?php</DIV>
<DIV>if(!extension_loaded('Mapscript'))<BR> dl('php_mapscript.dll');</DIV>
<DIV> </DIV>
<DIV>//open the mapfile and change the mapname<BR>$map = ms_newMapObj($map_file);<BR>$map -> set("name", $_GET['map_name']);</DIV>
<DIV> </DIV>
<DIV>//set up layer 1<BR>//set the parameters</DIV>
<DIV> //temp setup<BR>$orig_name = "ASSET";<BR>$orig_id = "19117";<BR>$orig_type = "MS_LAYER_POLYGON";</DIV>
<DIV> </DIV>
<DIV>$rel_name = "SURVEY";<BR>$rel_id = "42";<BR>$rel_type = "MS_LAYER_LINE";<BR> <BR> //temporary data created <BR>$orig_data = "asset_shape FROM  FOD.ASSET_RELATED_SHP_MAP USING UNIQUE ASSET_ID";<BR>$rel_data = "rel_shape from fod.asset_related_shp_map using unique shape_id";</DIV>
<DIV> </DIV>
<DIV>//create the original shape layer<BR>$orig_layer = $map->getLayerByName("layer1");<BR>$orig_layer->set("name", $orig_name);<BR>$orig_layer->set("status", MS_ON);<BR>$orig_layer->set("type", $orig_type);<BR>$orig_layer->set("connectiontype", MS_ORACLESPATIAL);<BR>$orig_layer->set("connection", "<A href="mailto:mapserver/mapserver@gistest">mapserver/mapserver@gistest</A>");<BR>$orig_layer->set("data", $orig_data); <BR>$orig_layer->setProcessing("CLOSE_CONNECTION=DEFER");<BR>$orig_layer->setProjection('+proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');<BR> //create class within the layer <BR>  //set the symbology and style</DIV>
<DIV><BR>//create the related layer<BR>$rel_layer = $map->getLayerByName("layer2");<BR>$rel_layer->set("name", $rel_name);<BR>$rel_layer->set("status", MS_ON);<BR>$rel_layer->set("type", $rel_type);<BR>$rel_layer->set("connectiontype", MS_ORACLESPATIAL);<BR>$rel_layer->set("connection", "<A href="mailto:mapserver/mapserver@gistest">mapserver/mapserver@gistest</A>");<BR>$rel_layer->set("data", $rel_data); </DIV>
<DIV>$rel_layer->setProcessing("CLOSE_CONNECTION=DEFER");<BR>$rel_layer->setProjection('+proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');<BR> //create class within the layer<BR>  //set the symbology and stylee</DIV>
<DIV> </DIV>
<DIV><BR>//draw the map<BR>ms_ResetErrorList();<BR>$map_image=$map->drawQuery();<BR>$error=ms_GetErrorObj();<BR>while($error && $error->code != MS_NOERR)<BR>{<BR> printf("Error in %s: %s<br>\n", $error->routine, $error->message);<BR> $error = $error->next();<BR>}<BR>echo $map_image->saveWebImage();</DIV>
<DIV> </DIV>
<DIV>?></DIV><BR>

    <p>
      <font face="Arial" size="1">--------------------------------------------------------------------------------------------------------------------------------------------- 
      </font><br>
    </p>
    <p>
      <font face="Arial" size="1">This transmission is intended solely for the 
      person or organisation to whom it is addressed. </font>
    </p>
    <p>
      <font face="Arial" size="1">It is confidential and may contain legally 
      privileged information. </font>
    </p>
    <p>
      <font face="Arial" size="1">If you have received this transmission in 
      error, you may not use, copy or distribute it. </font>
    </p>
    <p>
      <font face="Arial" size="1">Please advise us by return e-mail or by 
      phoning 61 3 6235 8333 and immediately delete the transmission in its 
      entirety. </font>
    </p>
    <p>
      <font face="Arial" size="1">We will meet your reasonable expenses of 
      notifying us. </font>
    </p>
    <p>
      <font face="Arial" size="1">Despite our use of anti-virus software, 
      Forestry Tasmania cannot guarantee that this transmission is virus-free. </font>
    </p>
    <p>
      <font face="Arial" size="1">-------------------------------------------------------------------------------------------------------------------------------------------- 
      </font>
    </p>
  </BODY></HTML>