Skip to content

Commit

Permalink
Fixed rounding error in WMS client
Browse files Browse the repository at this point in the history
When using a tile size of 256 in Web Mercator the cascaded WMS request could be computed to a height or width of 257.
  • Loading branch information
Krister Wicksell authored and rouault committed Mar 9, 2021
1 parent 6f4da6e commit a13351f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mapwmslayer.c
Expand Up @@ -734,8 +734,8 @@ msBuildWMSLayerURL(mapObj *map, layerObj *lp, int nRequestType,

msRectIntersect( &bbox, &layer_rect );

bbox_width = ceil((bbox.maxx - bbox.minx) / cellsize);
bbox_height = ceil((bbox.maxy - bbox.miny) / cellsize);
bbox_width = round((bbox.maxx - bbox.minx) / cellsize);
bbox_height = round((bbox.maxy - bbox.miny) / cellsize);

/* Force going through the resampler if we're going to receive a clipped BBOX (#4931) */
if(msLayerGetProcessingKey(lp, "RESAMPLE") == NULL) {
Expand Down
Binary file modified msautotest/gdal/expected/wmsclient_3543.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a13351f

Please sign in to comment.