<div>hi, Skalski,</div>
<div>&nbsp;</div>
<div>Thanks for the reply. However could you please give more information on this. Maybe an example.</div>
<div>&nbsp;</div>
<div>The code was working partly ok, the new point can be added, however&nbsp;as I said, it will overwrite the old one. It's attribute was inherited from the old one. I now want to change it's attribute and when I use&nbsp;&nbsp;$poLayer-&gt;getResult(0); there seems not point was picked up.
</div>
<div>&nbsp;</div>
<div>regards,</div>
<div>&nbsp;</div>
<div>Jonathan</div>
<div><br><br>&nbsp;</div>
<div><span class="gmail_quote">On 26/01/06, <b class="gmail_sendername">Skalski Artur - askals</b> &lt;<a href="mailto:Artur.Skalski@acxiom.com">Artur.Skalski@acxiom.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div><span><font face="Arial" color="#0000ff" size="2">To change an attribute of added point You have to also update a dbase file (I don't see that in your code)&nbsp;wihich stores all atributes of shapes in shp.file, otherwise you get nothing. And if you try to open such a file in ArcViwe it will promt taht tha file was damaged which is because dbf. file record number doesn't mach shp. file record number.
</font></span></div>
<div><span><font face="Arial" color="#0000ff" size="2">dbase.dll which is used to create and update dbf. file comes with standard distribution off all lates php binaries</font></span></div>
<div><span><font face="Arial" color="#0000ff" size="2"></font></span>&nbsp;</div>
<div><span><font face="Arial" color="#0000ff" size="2">ragards</font></span></div>
<p><font face="Arial CE" size="2">Artur Skalski</font> </p>
<p><b><font face="Arial CE" color="#000080" size="2">ACXIOM Polska</font></b><br><font face="Arial CE" color="#000080" size="2">Telephone:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (+48 22) 606 11 27&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Budynek Saturn<br>Facsimile:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (+48 22) 606 11 28&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Domaniewska 41
<br>Mobile: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (+48) 503 070 036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 02-672 Warszawa</font><font face="Arial CE" color="#000080"><br></font><font face="Arial CE" color="#000080" size="2">E-mail: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:artur.skalski@acxiom.com" target="_blank">
artur.skalski@acxiom.com</a></font> </p>
<div><span class="e" id="q_10905fdad5449d08_1">
<blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
<div dir="ltr" align="left"><font face="Tahoma" size="2">-----Original Message-----<br><b>From:</b> UMN MapServer Users List [mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU" target="_blank">
MAPSERVER-USERS@LISTS.UMN.EDU</a>]<b>On Behalf Of </b>Xiaonan Zhang<br><b>Sent:</b> Wednesday, January 25, 2006 6:02 PM<br><b>To:</b> <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU" target="_blank">
MAPSERVER-USERS@LISTS.UMN.EDU</a><br><b>Subject:</b> [UMN_MAPSERVER-USERS] How to edit attribute of a selected shape?<br><br></font></div>
<div>Dear all,</div>
<div>&nbsp;</div>
<div>I am tring to create a function which can add comment point onto layer however I got a few problems here:</div>
<div>1. the newly added one always overwrite the existing point so there is always only one point in that layer.</div>
<div>2. I can not regain the added point.</div>
<div>3. how to change the attribute of the added point, say there is one attribue called &quot;Comment&quot;.</div>
<div>&nbsp;</div>
<div>thanks. </div>
<div>&nbsp;</div>
<div>My code is:</div>
<div>&nbsp;</div>
<div>//Create a new comment point<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ClickGeo = ms_newPointObj();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ClickGeo-&gt;setXY($nClickGeoX, $nClickGeoY);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //printf(&quot;ClickGeoX %f&lt;BR&gt;\n&quot;,$nClickGeoX); 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//printf(&quot;ClickGeoY %f&lt;BR&gt;\n&quot;,$nClickGeoY);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Add it to the comments layer<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$shape = ms_newShapeObj(MS_SHAPE_POINT);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$line = ms_newLineObj(); 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$line-&gt;add($oClickGeo);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$shape -&gt;add($line);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$poLayer = $gpoMap-&gt;getlayerbyname(comments); //get the layer &quot;comments&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$poLayer-&gt;open();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//printf(&quot;Layer Name: %f&lt;BR&gt;\n&quot;, $poLayer-&gt;name);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$poLayer-&gt; addfeature($shape); //add the new comment point&nbsp; 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Save the changes&nbsp;&nbsp; &nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;$cmmShapefile = &quot;../htdocs/data/comments&quot;; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$objShapefile = ms_newShapeFileObj( $cmmShapefile, MS_SHP_POINT ); 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$objShapefile-&gt;addshape($shape);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$objShapefile-&gt;free;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;$poLayer-&gt;close(); <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Task2: Use layer-&gt;querybypoint to regain the newly added point and then change it's comment attribut 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Task2.1:get the new added comment point<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;$poLayer-&gt;querybypoint($oClickGeo, MS_SINGLE, 2); <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;$numResults = $poLayer-&gt;getNumResults();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;printf(&quot;Find point: %f&lt;BR&gt;\n&quot;, $numResults);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;$oRes = $poLayer-&gt;getResult(0); <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;printf(&quot;tileindex: %f&lt;BR&gt;\n&quot;, $oRes-&gt;tileindex);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;printf(&quot;SHAPEINDEX: %f&lt;BR&gt;\n&quot;, $oRes-&gt;shapeindex);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;$oShape = $poLayer-&gt;getShape(-1,0); //(-1,-1)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;print_r($oShape-&gt;values); //print the keys of the values array<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;$comment = $oShape-&gt;Values[&quot;Comment&quot;]; 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;printf(&quot;The comment attribute is ---: %f&lt;BR&gt;\n&quot;,$comment ); //display comment attribute<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </div></blockquote></span></div><pre>***************************************************************************
The information contained in this communication is confidential, is
intended only for the use of the recipient named above, and may be legally
privileged.

If the reader of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited.

If you have received this communication in error, please resend this
communication to the sender and delete the original message or any copy
of it from your computer system.

Thank You.
****************************************************************************
</pre></blockquote></div><br>