[Mapserver-users] [PHP] dynamic point data query (again) HELP PLEASE!!!!!
Lowell Filak
lfilak at medinaco.org
Tue Apr 20 11:11:16 PDT 2004
There may be a work-a-round if your setup allows you to write a new
shapefile you can still create a temporary shapefile and use that as the
data item for a layer and query that layer.
HTH
Lowell
The following message was sent by "Gijs Epping" <gijs at gijs.com> on Tue,
20 Apr 2004 16:33:51 +0200.
> Hello poeple,
>
> Is there really nobody that creates point shapes on the fly and then
> wants to query on them with php, I Asked this before last week but I
> only got some reactions from perl people and they can do it because they
> can set the index from a shape.
>
> I can't set the index with php because it is only readable see the url:
>
> http://mapserver.gis.umn.edu/doc40/phpmapscript-class-guide.html#ShapeOb
> j
>
> There must be a work around for his problem because if you can do it
> with perl why can't you do it with php?????
>
> Here is the code again.
>
> $layerObj = $gpoMap->getLayerByName('virtpoint');
> $shp =ms_newShapeObj(MS_SHAPE_POINT);
> $line = ms_newLineObj();
> $line->addXY($point_lookup[0], $point_lookup[1]);
> $shp->add($line);
> //$shp->set(index, $i); // the problem!!!!!
> $layerObj->addFeature($shp);
>
>
> if you want to do the following you get the script say's "index is only
> readable" error:
>
> $shp->set(index, 1);
> In perl you would write this as following: $shp->{index}=2 And this
> works I think
>
> The point is created, and when you query the point it is marked as
> "queryd" but the result I get back from "$oRes =
> $oLayer->getResult($iRes);" is:
>
> stdClass Object ( [shapeindex] => -1 [tileindex] => -1 [classindex] => 0
> )
>
> The following code gets the queryd shape from the layer:
>
> $oShape = $oLayer->getShape($oRes->tileindex,$oRes->shapeindex);
>
> The error I get is:
> Fatal error: [MapServer Error]: msLayerGetShape(): Cannot retrieve
> inline shapes randomly.
>
> The shape index should be set but it is not.
>
> I hope somebody can help me I am really stuck at the moment and I really
> need this to work.
>
> Thanks in advance.
> Gijs
>
> _______________________________________________
> 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