Changeset 407
- Timestamp:
- 11/07/08 12:40:35 (2 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/geowebcache/src/main/java/org/geowebcache/layer/GridCalculator.java
r403 r407 235 235 double xLoc = xdiff / tileWidth; 236 236 retVals[0] = (int) Math.round(xLoc); 237 double absdiff = Math.abs(retVals[0] - xLoc); 238 if(absdiff/xLoc > 0.05 && absdiff > 0.05) { 237 double absdiff = Math.abs(retVals[0]*tileWidth - xdiff); 238 239 // This doesn't work too great 240 // http://localhost:8080/geowebcache/service/wms?LAYERS=topp%3Aopen_space&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A900913&BBOX=-8238077.159316406,4955673.447285157,-8218509.280078124,4965241.326523438&WIDTH=256&HEIGHT=256 241 if(absdiff > 0.00005 && (absdiff / tileWidth) > 0.05) { 239 242 throw new BadTileException("Your bounds in the x direction are offset" 240 + " by more than 5% compared to the underlying grid."); 243 + " by more than 5% compared to the underlying grid.\n" 244 + " Given " + tileBounds.coords[0] + " the closest match is index " + retVals[0] 245 + ", which corresponds to " + (retVals[0]*tileWidth + gridBounds.coords[0]) 246 ); 241 247 } 242 248 … … 245 251 double yLoc = ydiff / tileWidth; 246 252 retVals[1] = (int) Math.round(yLoc); 247 absdiff = Math.abs(retVals[1] - yLoc);248 if(absdiff /yLoc > 0.05 && absdiff > 0.05) {253 absdiff = Math.abs(retVals[1]*tileWidth - ydiff); 254 if(absdiff > 0.00005 && (absdiff / tileWidth) > 0.05 ) { 249 255 throw new BadTileException("Your bounds in the y direction are offset" 250 + " by more than 5% compared to the underlying grid."); 256 + " by more than 5% compared to the underlying grid.\n" 257 + " Given " + tileBounds.coords[1] + " the closest match is index " + retVals[1] 258 + ", which corresponds to " + (retVals[1]*tileWidth + gridBounds.coords[1]) 259 ); 251 260 } 252 261
