<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1528" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=170455907-26012006><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) 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 class=170455907-26012006><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 class=170455907-26012006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=170455907-26012006><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: (+48 22) 606 11
27 Budynek
Saturn<BR>Facsimile: (+48 22) 606 11
28 Domaniewska 41<BR>Mobile:
(+48) 503 070
036 02-672 Warszawa</FONT><FONT
face="Arial CE" color=#000080><BR></FONT><FONT face="Arial CE" color=#000080
size=2>E-mail:
artur.skalski@acxiom.com</FONT> </P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> UMN MapServer Users List
[mailto:MAPSERVER-USERS@LISTS.UMN.EDU]<B>On Behalf Of </B>Xiaonan
Zhang<BR><B>Sent:</B> Wednesday, January 25, 2006 6:02 PM<BR><B>To:</B>
MAPSERVER-USERS@LISTS.UMN.EDU<BR><B>Subject:</B> [UMN_MAPSERVER-USERS] How to
edit attribute of a selected shape?<BR><BR></FONT></DIV>
<DIV>Dear all,</DIV>
<DIV> </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 "Comment".</DIV>
<DIV> </DIV>
<DIV>thanks. </DIV>
<DIV> </DIV>
<DIV>My code is:</DIV>
<DIV> </DIV>
<DIV>//Create a new comment
point<BR>
$ClickGeo =
ms_newPointObj();<BR>
$ClickGeo->setXY($nClickGeoX,
$nClickGeoY);<BR>
<BR>
//printf("ClickGeoX %f<BR>\n",$nClickGeoX);
<BR> //printf("ClickGeoY
%f<BR>\n",$nClickGeoY);<BR> <BR> //Add
it to the comments
layer<BR> $shape =
ms_newShapeObj(MS_SHAPE_POINT);<BR> $line
= ms_newLineObj();
<BR> $line->add($oClickGeo);<BR> $shape
->add($line);<BR> <BR> <BR> $poLayer
= $gpoMap->getlayerbyname(comments); //get the layer
"comments"<BR> $poLayer->open();<BR> //printf("Layer
Name: %f<BR>\n",
$poLayer->name);<BR> <BR> <BR> $poLayer->
addfeature($shape); //add the new comment point
<BR> <BR> <BR> //Save
the changes
<BR>
$cmmShapefile = "../htdocs/data/comments";
<BR> $objShapefile
= ms_newShapeFileObj( $cmmShapefile, MS_SHP_POINT );
<BR> $objShapefile->addshape($shape);<BR> $objShapefile->free;<BR>
$poLayer->close();
<BR> <BR> //Task2:
Use layer->querybypoint to regain the newly added point and then change
it's comment attribut
<BR> <BR> //Task2.1:get
the new added comment
point<BR>
$poLayer->querybypoint($oClickGeo, MS_SINGLE, 2);
<BR>
$numResults =
$poLayer->getNumResults();<BR>
printf("Find point: %f<BR>\n",
$numResults);
<BR>
$oRes = $poLayer->getResult(0);
<BR>
printf("tileindex: %f<BR>\n",
$oRes->tileindex);<BR>
printf("SHAPEINDEX: %f<BR>\n",
$oRes->shapeindex);
<BR>
$oShape = $poLayer->getShape(-1,0);
//(-1,-1)<BR>
print_r($oShape->values); //print the keys of the
values
array<BR>
$comment = $oShape->Values["Comment"];
<BR>
printf("The comment attribute is ---:
%f<BR>\n",$comment ); //display comment
attribute<BR> <BR>
</DIV></BLOCKQUOTE><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></BODY></HTML>