msQueryByPoint() fails when doing a reprojection with tolerance=0
Frank, Steve,
We ran into a problem doing GetFeatureInfo with some WMS service when the SRS of
the request was different from the native projection of the data and the
TOLERANCE is 0 in the layer definition (i.e. not set). I could send you a
testcase to reproduce if needed, but I can't attach it to this bug, and you
probably won't need it anyway once you read the description below.
It turns out that when tolerance is sero, msQueryByPoint() creates a zero-size
searchrect:
(gdb) p rect
$6 = {minx = -123.56434997895762, miny = 48.452835466316486,
maxx = -123.56434997895762, maxy = 48.452835466316486}
... and then passes it to msProjectRect().
Inside msProjectRect(), we calculate dx and dy, which happen to be zero, and
because of that all tests in the function fail and the original rect is never
reprojected.
If msQueryByPoint() had tested the return value of msProjectRect() then it would
have seen the MS_FAILURE, but that still wouldn't help the user get meaningful
results.
We could possibly modify msQueryByPoint() to use a pointObj to reproject if
tolerance is zero, but that would just make the code more complicated and the
same situation could still fail elsewhere. I think the best would be to modify
msProjectRect() to properly handle the case where dx==0 && dy==0.
What do you think?
Change History
(5)
Resolution: |
→ fixed
|
Status: |
assigned → closed
|