Ticket #2843 (closed defect: fixed)
WMS Layer requests offset by half pixel from desired
| Reported by: | warmerdam | Owned by: | warmerdam |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.4 release |
| Component: | WMS Client | Version: | svn-trunk (development) |
| Severity: | normal | Keywords: | BBOX |
| Cc: | rhow@…, dmorissette |
Description
My reading of section 6.5.6 of the WMS specification (1.1.0) is that the BBOX parameter in WMS is the bounds of the outer edge of the requested pixels. On the other hand, the EXTENT keyword in the mapfile, and the map->extent structure refers to bounds that are the centers of the edge pixels.
In msBuildWMSLayerURL() (mapwmslayer.c) the bbox is directly derived from map->extent and then put into the BBOX with no adjustment. I believe this is an error and that the BBOX should be offset by half a pixel from the map->extent.
The current situation is resulting in some reprojected/resample cascaded WMS requests being offset by one pixel (depending on half pixel off rounding) causing while edges on some tiles.
I'll attach a proposed patch. I can produce a test case demonstrating the problem if necessary.

