Ticket #3211 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

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

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

Change History

Changed 3 years ago by sdlime

Initial patch for the problem

Changed 3 years ago by sdlime

  • cc dmorissette, aboudreault added
  • status changed from new to assigned

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

Changed 3 years ago by dmorissette

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.

Changed 3 years ago by sdlime

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

Steve

Changed 3 years ago by sdlime

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

Changed 3 years ago by sdlime

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

Steve

Changed 3 years ago by sdlime

  • status changed from assigned to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.