Opened 15 years ago
Closed 15 years ago
#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.
Attachments (1)
Change History (4)
by , 15 years ago
comment:1 by , 15 years ago
I have confirmed that:
- mapwms.c adjusts incoming BBOX's by half a pixel when converting to map->extent.
- mapwmslayer.c adjusts the origin by half a pixel when writing to world file which is center of pixel oriented.
So I believe that the map extent to bbox translation is the only outstanding problem.
comment:2 by , 15 years ago
Cc: | added |
---|---|
Milestone: | → 5.4 release |
Owner: | changed from | to
I believe I wrote that code in mapwmslayer.c and I was not aware of the subtle difference in extent handling at the time, so I'd say go ahead with your patch, it makes complete sense.
comment:3 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
patch to WMS layer implementation