getFeature problem with C# MapScript

Zhonghai Wang zhonghaiw at GMAIL.COM
Mon Aug 14 06:03:55 PDT 2006


Hi Tamas,

thank you very much for the important hint to solve my problem, I thought
the value 1 means MS_SUCCESS, now I've changed the condition. Also this time
I've changed the query rectangle to map unit -- meters. All these changes
help me to get the shape objects successfully. Thanks again.

But I still have one question:

it seems that the the query by rectangle returns more than one shape object,
should I loop through the query results and store the shape objects in an
shapeObj type array?

BTW: I create an Inline Fearure layer for the shape object.

thanks a lot

zhonghai


On 8/14/06, Tamas Szekeres <szekerest at gmail.com> wrote:
>
> Hi Zhonghai,
>
> >
> > the intQuery value is 1, means that the query is successful, but the
> intOpen
> > is always 0, seems that the layer can not be opened for getFeature
> function.
> > The layer queried is a memory layer created with a function on the fly,
> I
> > don't know if this is a problem for the getFeature function.
> >
>
> Both of the functions should return MS_RETURN_VALUE.MS_SUCCESS (value
> 0) on the successful completion so i guess querybyrect was the
> problem.
>
> > the scenario of this function in my application is:
> >
> > a new layer is created on the fly with the data from the Oracle Spatial
> > database when the first user request comes in, and this layer will be
> always
> > the same through out a user session, so I am trying to get the shape
> objects
> > from the layer and store them into a data table, so that I can create a
> new
> > layer with these shape objects without connection with the oracle
> spatial
> > database any more, and this may improve the mapserver performance, since
> I
> > do not need to access the database anymore every time when a new map
> image
> > is needed to be rendered.
> >
> > and the shape object in the queried layer may be a point or a polygon.
> >
> > BTW: the map extent unit of the map object is meter, but the queried
> layer
> > has decimal degree (WGS84 layer) as map unit, but the values of the
> query
> > rectangle is also in degree unit, I don't know if this will cause the
> > getFeature problem. Just for info.
> >
> The query rect should be in the same projection as the map. The rect
> will be transformed into the layer projection internally.
> It would be useful to describe how the layer is created or making a
> sample project for the expected operation.
>
> Best Regards,
>
> Tamas Szekeres
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060814/ef9fe069/attachment.htm>


More information about the MapServer-users mailing list