Changeset 424
- Timestamp:
- 11/13/08 05:45:17 (8 weeks ago)
- Location:
- trunk/geowebcache/src/main/java/org/geowebcache
- Files:
-
- 5 modified
-
cache/Cache.java (modified) (1 diff)
-
cache/file/FileCache.java (modified) (4 diffs)
-
cache/file/FilePathKey2Filter.java (modified) (3 diffs)
-
rest/TruncateTask.java (modified) (4 diffs)
-
service/kml/KMLDebugGridLayer.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/geowebcache/src/main/java/org/geowebcache/cache/Cache.java
r418 r424 70 70 throws CacheException, GeoWebCacheException; 71 71 72 public voidtruncate(TileLayer tl, SRS srs, int zoomStart, int zoomStop,72 public int truncate(TileLayer tl, SRS srs, int zoomStart, int zoomStop, 73 73 int[][] bounds, MimeType mimeType) throws CacheException; 74 74 -
trunk/geowebcache/src/main/java/org/geowebcache/cache/file/FileCache.java
r420 r424 293 293 } 294 294 295 public voidtruncate(TileLayer tl, SRS srs, int zoomStart, int zoomStop,295 public int truncate(TileLayer tl, SRS srs, int zoomStart, int zoomStop, 296 296 int[][] bounds, MimeType mimeType) throws CacheException { 297 297 298 int count = 0; 299 298 300 String prefix = tl.getCachePrefix(); 299 301 … … 314 316 for (File tile : tiles) { 315 317 tile.delete(); 318 count++; 316 319 } 317 320 … … 319 322 if (chk == null || chk.length == 0) { 320 323 imd.delete(); 324 count++; 321 325 } 322 326 } … … 325 329 if (chk == null || chk.length == 0) { 326 330 srsZoom.delete(); 327 } 328 329 } 330 331 count++; 332 } 333 334 } 335 336 return count; 337 331 338 } else { 332 339 throw new CacheException(prefix -
trunk/geowebcache/src/main/java/org/geowebcache/cache/file/FilePathKey2Filter.java
r422 r424 78 78 } else { 79 79 int tmp = findZoomLevel(name); 80 if(tmp < = zoomStart || tmp >=zoomStop) {80 if(tmp < zoomStart || tmp > zoomStop) { 81 81 return false; 82 82 } … … 118 118 int[] box = bounds[zoomLevel]; 119 119 120 // [2, 5, 5, 6] , why that when we've got 00_05 ?120 121 121 if (x < box[0] || x > box[2]) { 122 122 return false; … … 128 128 } 129 129 130 System.out.println(dir.getAbsolutePath() + " " + name);130 //System.out.println(dir.getAbsolutePath() + " " + name); 131 131 132 132 return true; -
trunk/geowebcache/src/main/java/org/geowebcache/rest/TruncateTask.java
r422 r424 17 17 package org.geowebcache.rest; 18 18 19 import java.util.Arrays; 20 19 21 import org.apache.commons.logging.Log; 20 22 import org.apache.commons.logging.LogFactory; … … 33 35 private final TileLayer tl; 34 36 37 private final static double[] nullBbox = {0.0,0.0,0.0,0.0}; 38 35 39 public TruncateTask(SeedRequest req, TileLayer tl) { 36 40 this.req = req; … … 43 47 44 48 Cache cache = tl.getCache(); 45 46 BBOX bbox = req.getBounds(); 49 47 50 int[][] bounds = null; 48 51 49 if( bbox != null) {50 bounds = tl.getCoveredGridLevels(req.getSRS(), bbox);52 if(! Arrays.equals(req.getBounds().coords, nullBbox)) { 53 bounds = tl.getCoveredGridLevels(req.getSRS(), req.getBounds()); 51 54 } 52 55 … … 54 57 // we may have to throw a wider net 55 58 MimeType mimeType = null; 56 if (req.getMimeFormat() != null && req.getMimeFormat().length() > 0) {59 if (req.getMimeFormat() != null && req.getMimeFormat().length() > 0) { 57 60 mimeType = MimeType.createFromFormat(req.getMimeFormat()); 58 59 int[] metaFactors = tl.getMetaTilingFactors(); 60 61 int gridBounds[][] = tl.getGrid(req.getSRS()).getGridCalculator().getGridBounds(); 62 63 if(metaFactors[0] > 1 || metaFactors[1] > 1 64 && mimeType.supportsTiling()) { 65 bounds = GridCalculator.expandBoundsToMetaTiles(gridBounds, bounds, metaFactors); 61 62 if (bounds != null) { 63 int[] metaFactors = tl.getMetaTilingFactors(); 64 65 int gridBounds[][] = tl.getGrid(req.getSRS()) 66 .getGridCalculator().getGridBounds(); 67 68 if (metaFactors[0] > 1 || metaFactors[1] > 1 69 && mimeType.supportsTiling()) { 70 bounds = GridCalculator.expandBoundsToMetaTiles(gridBounds, 71 bounds, metaFactors); 72 } 66 73 } 67 74 } 68 75 69 cache.truncate(tl, req.getSRS(),76 int count = cache.truncate(tl, req.getSRS(), 70 77 req.getZoomStart(), req.getZoomStop(), 71 78 bounds, mimeType); 79 log.info("Completed truncating " + count + " tiles"); 72 80 } 73 81 -
trunk/geowebcache/src/main/java/org/geowebcache/service/kml/KMLDebugGridLayer.java
r418 r424 387 387 388 388 389 public voidtruncate(TileLayer tl, SRS srs, int zoomStart, int zoomStop,389 public int truncate(TileLayer tl, SRS srs, int zoomStart, int zoomStop, 390 390 int[][] bounds, MimeType mimeType) throws CacheException { 391 391 // TODO Auto-generated method stub 392 392 return 0; 393 393 } 394 394
