[Mapserver-users] modifying a point location using php_mapscript

Lowell Filak lfilak at medinaco.org
Fri Sep 12 08:42:42 EDT 2003


At this point the editting of shapefiles isn't direct.
If you don't need to actually record the changes to cordinates in the
shapefile you can still use the altered point for map display purposes.
To save the changes, AFAIK, you will need to open a new shapefile and
transfer all the data from the existing one to the new one while
replacing the old point with the altered one.
It seems to be an issue that comes up now & then and, from what I
understand, stems from the original intent of shapefiles to provide fast
'read' access to data but not write.
If you need to do a lot of editting you may want to look into something
like PostGIS or MyGIS which is more suitable for the task.
The new shapeObj->copy should make it a easier to copy unaltered complex
shapes like lines & polygons from an existing file to a new file.
Here's another link in the archives that may provide additional help:
http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/9910/msg00031.html
There is also reportedly a '-2' option when opening a shapefile that
will allow an 'append' but I'm not sure it will allow a 'change' to an
existing point.
Lowell

The following message was sent by "fx gamoy" <fx.gamoy at mapxplore.com> on
Fri, 12 Sep 2003 00:14:14 +0100.

> thanks for your answer Eric
>  i have managed to get the pointobj and to use the setXY method
> but this method don't affect the location of the point in the shapefile
> 
> $oLayertest =
> ms_newShapefileObj("f:/mapserver_data/data/mobilier/mobilier_point",-2);
> $oPoint=$oLayertest->getPoint($_SESSION["STEP"]); //where
session["STEP"] is
> the index of the obj
> $oPoint->setXY($Xgeo,$Ygeo);
>  $oPoint->free();
>  $oLayertest->free();
> the point's location is not updated in the shape file
> any suggestion??
> thanks
> fx
> 
> ----- Original Message -----
> From: "Eric Bridger" <eric at gomoos.org>
> To: "fx gamoy" <fx.gamoy at mapxplore.com>
> Cc: "Mapserver List" <mapserver-users at lists.gis.umn.edu>
> Sent: Thursday, September 11, 2003 3:34 PM
> Subject: Re: [Mapserver-users] modifying a point location using
> php_mapscript
> 
> 
> > You probably need to call:
> >
> > $lineObj = $shapeObj->line(0);
> > $pointObj = $lineObj->point(0);
> >
> >
> > On Thu, 2003-09-11 at 18:16, fx gamoy wrote:
> > > hello world,
> > > i am using mapserver 3.6.3 using php_mapscript
> > > i have managed to create a pointObj on a shapefile using the
> shapefileObj and the addPoint Method.
> > >
> > > Then i would like to modify the location of this pointobj.
> > > Using getfeaturebyattribute, i obtain a shapeobj corresponding to the
> pointObj i want to modify.
> > > Can i create a pointobj instead of a shapeobj in order to use the
setXY
> method?
> > > or
> > > can i convert the shapeobj to a pointobj??
> > >
> > > i have seen in the doc that perl provide get,copy... methods? not in
> whith php_mapscript??
> > >
> > >
> > > thanks for all
> > > fx
> >
> >
> > _______________________________________________
> > Mapserver-users mailing list
> > Mapserver-users at lists.gis.umn.edu
> > http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> >
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the mapserver-users mailing list