[mapserver-users] buffer a point and select by buffer
Tamas Szekeres
szekerest at gmail.com
Wed Nov 26 15:01:29 PST 2008
William,
You could probably do something like:
layerObj layer = map.getLayerByName("POINTLAYER");
layerObj layer2 = map.getLayerByName("OTHERLAYER");
layer.queryByPoint(map, point, mapscript.MS_SINGLE, 0);
resultCacheObj results = layer.getResults()
if (results != null && results.numresults > 0)
{
layer.open();
resultCacheMemberObj res = results.getResult(0);
shapeObj shape = layer.getFeature(res.shapeindex, res.tileindex);
if (shape!= null)
{
layer2.queryByShape(shape.buffer(width));
resultCacheObj results2 = layer2.getResults()
if (results2 != null && results2.numresults > 0)
{
layer2.open();
for (int i=0; i < results2.numresults; i++)
{
resultCacheMemberObj res2 = results2.getResult(j);
shapeObj shape2 = layer2.getFeature(res2.shapeindex,
res2.tileindex);
// do something with shape2
}
layer2.close();
}
}
layer.close();
}
Best regards,
Tamas
2008/11/26 william paul <williampaul28 at yahoo.com>
> Hello:
>
> I have created a simple mapserver using mapscript C#. I want to be able to
> select a point feature from a point layer, buffer that point feature and use
> the buffer for a spatial query for features from other layer
>
> Does someone have an example or had similar projects?
>
> Thank you in advance,
>
> William
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20081127/a55e2114/attachment.htm>
More information about the MapServer-users
mailing list