[mapserver-users] Re: Querying type=circle layer

Christian Jauvin cjauvin at gmail.com
Wed Apr 8 11:06:32 EDT 2009


I found the answer to my question:

You have to manually add a "shapeindex" value for each feature that
you add, and it has to start from zero.

Christian


On Tue, Apr 7, 2009 at 5:23 PM, Christian Jauvin <cjauvin at gmail.com> wrote:
> Hi,
>
> I use Python-Mapscript 5.2 on Windows. I have a layer of type=circle
> on which I dynamically add features:
>
> layer = ..
> circle_shape = shapeObj(MS_SHAPE_LINE)
> p1 = pointObj(..)
> p2 = pointObj(..)
> line = lineObj()
> line.add(p1)
> line.add(p2)
> circle_shape.add(line)
> layer.addFeature(circle_shape)
>
> Then later I'd like to query that same layer using either
> queryByPoint() or queryByRect(), and there my problems begin:
>
> (1) queryByPoint does not work at all (but the same code I use works
> for other layers with static content, loaded from a shapefile or
> PostGIS)
>
> (2) queryByRect seems to work, as it returns MS_SUCCESS when there is
> an overlap, but then it seems that I cannot retrieve the shape I want
> using the result's shapeindex (I get an error message telling me that
> it doesn't exist).
>
> Am I missing something? Maybe queryByXX work differently with
> dynamical content layers? Or maybe with type=circle layers?
>
> Thanks a lot in advance for any help!
>
> Christian
>


More information about the mapserver-users mailing list