Setting attributes of shapes on php-mapscript
bpicinbono at WORLDONLINE.FR
Tue Jul 17 09:31:23 EDT 2007
Le lundi 16 juillet 2007 21:13, Francesco Antognini a écrit :
> I'm stuck with this and need advice. I'm working with ms4w version 2.2.3.
> In php mapscript, I'm trying to assign values to attributes of newly
> created shape objects. However, whatever I do it doesn't seem to work.
> First of all shapeobj->setValue() is not defined:
> $shpn= ms_newShapeObj(MS_SHAPE_POLYGON);
> $shpn->setvalue(0,"foobar"); // >>> php generates error
> Then setting the directly the values array works on the php object:
> However changes are never transferred to the actual peer in the layer, as
> print_r clearly shows:
> .... [values] => Array ( ) .....
> At this point I wonder whether this is possible at all, at least in
> php-mapscript. If anyone can give me hint it would be very helpful. Even a
> negative one.
> F. Antognini
Assuming your are working with esri shape files (*.shp, *shx, and *.dbf),
php_mapscript allows you to add new shapes and you can use php dbase
functions to add new records (and datas) to the dbf file.
Have a look over here :
More information about the mapserver-users