Opened 14 years ago

Closed 14 years ago

#3211 closed defect (fixed)

Query by features or shape not working properly against projected layers...

Reported by: sdlime Owned by: sdlime
Priority: normal Milestone: 5.6 release
Component: MapServer C Library Version: unspecified
Severity: normal Keywords:
Cc: dmorissette, aboudreault

Description

A bug was recently uncovered on mapserver-users where layer tolerances seemingly had little or no effect on projected layers. I tracked the problem to the search rect used for the initial bbox filter (via msLayerWhichItems()). In these cases the search rect is the bbox of a search shape (either user supplied or from a selection layer). The problem is that the code is currently applying a tolerance (in map units) after the search rect is projected back to the projection of the layer being searched. The tolerance should be applied beforehand when the rect is in map coordinates (and units).

The effects of the problem really depend on the units and projections. It may just cause oversampling due to a much larger search rect than necessary resulting in lousy performance or the exact opposite, an incorrect query when tolerances are used.

Steve

Attachments (1)

patch.3211 (2.4 KB ) - added by sdlime 14 years ago.
Initial patch for the problem

Download all attachments as: .zip

Change History (7)

by sdlime, 14 years ago

Attachment: patch.3211 added

Initial patch for the problem

comment:1 by sdlime, 14 years ago

Cc: dmorissette aboudreault added
Status: newassigned

Guys, if you could validate my logic I'd appreciate it. I hate fixing stuff like this late in a release process. I've tested with a test case supplied by a user (with a feature query) and things worked better. The shape query used the same process.

The testing uncovered other flaws relative to feature queries when the map is in epsg:4326 but the two layers are in the same projection we still are forced back through the map projection (and decimal degrees), but that's a 6.0 optimization...

Steve

comment:2 by dmorissette, 14 years ago

Your proposed change makes complete sense, based on my understanding of the code. If your test case demonstrated the problem and confirmed the fix then I'd say go ahead.

comment:3 by sdlime, 14 years ago

Cool, I'll commit. The other ticket (in case you're interested is #3212).

Steve

comment:4 by sdlime, 14 years ago

Oh, this might be one to backport... Steve

comment:5 by sdlime, 14 years ago

Committed in r9561... Will close for now and re-open if necessary.

Steve

comment:6 by sdlime, 14 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.