Ticket #3933 (new defect)

Opened 3 years ago

Last modified 3 years ago

WMS layer produces incorrect worldfile cell size distorting cascaded layers

Reported by: warmerdam Owned by: mapserverbugs
Priority: normal Milestone:
Component: WMS Client Version: unspecified
Severity: normal Keywords:
Cc: rhow, pramsey, dmorissette, assefa

Description

The following logic in mapwmslayer.c produces the wrong cell size:

            double dfCellSizeX = MS_CELLSIZE(pasReqInfo[iReq].bbox.minx,
                                             pasReqInfo[iReq].bbox.maxx, 
                                             pasReqInfo[iReq].width+1);	
            double dfCellSizeY = MS_CELLSIZE(pasReqInfo[iReq].bbox.maxy,
                                             pasReqInfo[iReq].bbox.miny, 
                                             pasReqInfo[iReq].height+1);

The problem is that MS_CELLSIZE() is designed for MapServer "center of pixel" extents but WMS bounding boxes are outer edge of pixels. The fix is to use width+1 and height+1.

I have a test case to demonstrate this but the data is potentially not redistributable. I can, if necessary, produce a redistributable demonstration.

Attachments

wms.patch Download (0.9 KB) - added by warmerdam 3 years ago.
Proposed Fix.

Change History

Changed 3 years ago by warmerdam

Proposed Fix.

Changed 3 years ago by warmerdam

  • cc pramsey, dmorissette, assefa added
Note: See TracTickets for help on using tickets.