Ticket #4172 (closed defect: fixed)

Opened 16 months ago

Last modified 15 months ago

Raster layer fails to be drawn if the window is less than half a pixel

Reported by: aboudreault Owned by: aboudreault
Priority: normal Milestone:
Component: MapServer C Library Version: unspecified
Severity: normal Keywords:
Cc: warmerdam

Description

When we zoom deep in a raster layer and the window is less than half a pixel.. mapserver just returns a blank image. In a OL viewer the change is critical and pass from a valid colored images to a blank one without error.

MapServer should allow those special cases when the window is less than half a pixel but still positive.

Attachments

raster_half_pixel_window.patch Download (1.4 KB) - added by aboudreault 16 months ago.
fix
off_window.patch Download (0.7 KB) - added by aboudreault 15 months ago.

Change History

Changed 16 months ago by aboudreault

fix

Changed 16 months ago by aboudreault

FrankW, could you confirm that my patch is ok and if if I should backport it to branch-6-0. I've run the msautotest/gdal part and nothing change on this side.

Changed 16 months ago by warmerdam

Alan,

Could you try a slight variation that makes sure no special values fall through the cracks and so the issue is more fully explained? Something like (untested):

   src_xsize = MIN(MAX(0,(int) (urx - llx + 0.5)), GDALGetRasterXSize(hDS) - src_xoff); 

   /* We want very small windows to use at least one source pixel (#4172) */
   if( src_xsize == 0 && (urx - llx) > 0.0 )
       src_xsize = 1;

Changed 16 months ago by aboudreault

Excellent FrankW. I'm going to commit the fix with your variation. I also going to backport this.

Changed 16 months ago by aboudreault

  • status changed from new to closed
  • resolution set to fixed

Fixed in r13027 and backported in branch 6.0 in r13028.

Changed 15 months ago by aboudreault

  • status changed from closed to reopened
  • resolution fixed deleted

It has been reported that the fix do not work when the window is off (on the raster source boundaries). I will attach a patch from Frank's hints. Frank, please confirm that the patch is ok.

Changed 15 months ago by aboudreault

Changed 15 months ago by aboudreault

  • status changed from reopened to closed
  • resolution set to fixed

Fixed and committed in r13206 and backported in 6.0 in r13205

Note: See TracTickets for help on using tickets.