[mapserver-dev] Single pass query with OGR is not working (RFC-65)

Tamas Szekeres szekerest at gmail.com
Fri Feb 25 18:32:47 EST 2011


Hi All,

I've found a couple of issues with regards to the single-pass implementation
(as per RFC-65 <http://www.mapserver.org/development/rfc/ms-rfc-65.html>) in
the OGR driver. It seems the current implementation doesn't follow the
concept have been introduced in RFC 65 and treats shape->index as being
shape->resultindex (or something like this) which causes problems during the
queries. Attached a patch for
mapogr.cpp<http://trac.osgeo.org/mapserver/attachment/ticket/3647/mapogr.cpp.patch>along
with theticket of
RFC-65<http://trac.osgeo.org/mapserver/ticket/3647>which should
somewhat handle this confusion.

Another problem is caused by the signature of LayerGetAutoStyle which
doesn't allow to pass resultindex to the driver (if that wants to rely on).
For this reason I would suggest to change this signature to:

*int msLayerGetAutoStyle(mapObj *map, layerObj *layer, classObj *c,
shapeObj* shape);*

which would than fairly similar to:

*int msLayerGetFeatureStyle(mapObj *map, layerObj *layer, classObj *c,
shapeObj* shape);*

have already been introduced with
RFC-61<http://www.mapserver.org/development/rfc/ms-rfc-61.html>
.

Another issue with this OGR implementation (which is not handled in the
patch) is that when drawing the query map in MS_NORMAL or MS_HILITE the
background layer messes up the spatial filter of the query layer because of
the connection pooling. This causes that a different feature set is
retrieved during the query and drawn during querymap rendering. This is due
to the code in mapdraw.c (at line 1080) where the background is drawn by
using a copy of the query layer which in fact uses the same OGR connection.
(Not sure whether it applies to other connection types or not.)

Any ideas how to handle these issues?


Best regards,

Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20110226/e15207db/attachment-0001.html


More information about the mapserver-dev mailing list