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

Lime, Steve D (DNR) Steve.Lime at state.mn.us
Sat Feb 26 08:33:51 EST 2011


I'm not sure what state the OGR driver is in wrt RFC65. There was some confusion because the implementation I did for the RFC is a bit different than stated in document. I'll fix that up. Frank was doing some work this in the last day or two so it's probably best for him to weigh in on status.

Your suggestion for auto-styling seems reasonable.

I don't quite follow the query map issue. That problem must have existed pre-RFC-65 correct?

Steve
________________________________________
From: mapserver-dev-bounces at lists.osgeo.org [mapserver-dev-bounces at lists.osgeo.org] On Behalf Of Tamas Szekeres [szekerest at gmail.com]
Sent: Friday, February 25, 2011 5:32 PM
To: mapserver-dev at lists.osgeo.org
Subject: [mapserver-dev] Single pass query with OGR is not working (RFC-65)

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 the ticket 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




More information about the mapserver-dev mailing list