[Mapserver-users] query on dynamic point data

Eric Bridger eric at gomoos.org
Fri Apr 16 05:50:17 PDT 2004


On Fri, 2004-04-16 at 07:43, Gijs Epping wrote:
> Hello,
> 
> We got a problem with querying on dynamic created points. The error we
> get is:
> 
> Fatal error: [MapServer Error]: msLayerGetShape(): Cannot retrieve
> inline shapes randomly.
> 
> I understand the error, we need to index the inserted data but we can't,
> because index is readonly. 
> 
> Is there a way that we can give a point an number (index number) and
> read it out.
> 
>   $layer = ms_newlayerObj($gpoMap);
>   $layer->set("name", "pnts");
>   $layer->set("type", MS_LAYER_POINT);
>   $layer->group='standaard';
>   $layer->set("status", MS_ON);
> 
>     $class = ms_newClassObj($layer);
>    $class->set("template", "blabla.html");
>    $style = ms_newStyleObj($class);
>    $style->color->setRGB(0,0,0);
>    $style->set("symbolname", "star");
>    $style->set("size", 10);
> 
> 
> 
>   $point_lookup1 = array(146626, 511696);
>   $layerObj = $gpoMap->getLayerByName(pnts);
>   $line = ms_newLineObj();
>   $shp =ms_newShapeObj(MS_SHAPE_POINT);
> 
> 
>   $point = ms_newPointObj();
>   $point->setXY($point_lookup1[0], $point_lookup1[1]);
>   $line->add($point);
>   $shp->add($line);
> 
> 
>   $layerObj->addFeature($shp);
> 
>   $gpoMap->draw();

In mapserver3.6 I use very similiar code but with the addition of:
$shp->{index} = $id

$id must be numeric. This $id is returned by the query.






More information about the MapServer-users mailing list